Last Comment Bug 109825 - Allow scripts to detect MathML-enabled builds
: Allow scripts to detect MathML-enabled builds
Product: Core
Classification: Components
Component: MathML (show other bugs)
: Trunk
: All All
-- normal with 2 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Anthony Jones (:kentuckyfriedtakahe, :k17e)
Depends on: 201903
  Show dependency treegraph
Reported: 2001-11-12 21:10 PST by rbs
Modified: 2010-09-06 13:03 PDT (History)
9 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

testcase to check if MathML is enabled (1.54 KB, application/xhtml+xml)
2003-04-11 18:46 PDT, rbs
no flags Details

Description User image rbs 2001-11-12 21:10:07 PST
Filing this bug for the record. There was thread on n.p.m.mathml asking how 
scripts can detect MathML-enabled builds. The thread is:

When MathML becomes an integral part of Mozilla, it is conceivable that this
might still be useful since some embedders may choose to disable it.

Following the code done in nsGenericElement::InternalIsSupported(), the 
fix for this could simply be to add recognition of something along the lines:
DOMImplementation.hasFeatures(feature = "MathML", version = "" | 1.0 | 2.0).

This is in line with the spec:
Comment 1 User image Johnny Stenback (:jst, 2001-11-13 02:29:17 PST
nsGenericElement::InternalIsSupported() doesn't seem like the right place to put
this, that method should be for *DOM* features only, there's no MathML DOM is
there? I'm happy to expose this *somewhere* in the DOM, but I'm not sure the DOM
feature query mechanism is the right place for it.
Comment 2 User image rbs 2001-11-13 03:21:46 PST
There is now a MathML DOM (in the latest V. 2.0):

There is a gray area in distinguishing between the MathML-DOM (lately introduced
in v2.0) and MathML-layout (which is all that was in MathML 1.0 that we aim at
for now). I have been wondering myself about the suitability of
DOMImplementation.hasFeatures() for both cases. The DOM as known today wasn't
yet there when MathML 1.0 was sitting there as an unimplemented recommendation
in mainstream browsers.
Comment 3 User image Andreas Franke (gone) 2002-02-25 13:21:36 PST
I think this would be nice to have for 1.0, because a significant number of
builds from that branch will have mathml enabled.
Comment 4 User image rbs 2002-03-19 02:19:53 PST itself is shipping builds that may or may not be MathML-enabled (Mac
vs Others).

jst, did you got a definite idea where the detection should go?
Comment 5 User image Hixie (not reading bugmail) 2002-03-19 04:45:29 PST
rbs: Do we support the MathML DOM?
Comment 6 User image rbs 2002-03-19 13:59:42 PST
No, that's why it is uncertain how to fix this bug.
(Note that the proposed MathML DOM cited in comment #2 is non-normative) 
Comment 7 User image rbs 2003-04-11 18:42:39 PDT
I had this idea of leveraging on document.load()... but curiously, the security
manager won't let me use the data: protocol. Will attatch the test I did.
Comment 8 User image rbs 2003-04-11 18:46:19 PDT
Created attachment 120262 [details]
testcase to check if MathML is enabled

The idea is to create a XML document and load some of those weird MathML
And if there is no parsing error during load, conclude that MathML is there.
Comment 9 User image rbs 2003-04-11 18:56:46 PDT
I am wondering if there are security risks in doing:
  document.load("data:text/xml, some-weird-entities-from-the-MathML-DTD")
if the security manager allowed the data: protocol, it have been a good enough
fix for the time being.
Comment 10 User image rbs 2003-04-13 17:55:50 PDT
Filed bug 201903 about the fact that document.load("data: protocol) doesn't
work. With that, this bug could have an interesting standard-compliant solution.
Comment 11 User image Henri Sivonen (:hsivonen) 2010-04-08 01:51:39 PDT
All MoCo builds now have MathML enabled, right? Would it be appropriate to WONTFIX this now?
Comment 12 User image Frédéric Wang (:fredw) 2010-08-10 12:24:34 PDT
(In reply to comment #11)
> All MoCo builds now have MathML enabled, right? Would it be appropriate to
> WONTFIX this now?

Yes, I agree. Moreover if we consider other browsers, Opera supports MathML and implementation is underway for WebKit (Internet Explorer still requires a plugin though). I suggest closing this bug if nobody complains.

Note You need to log in before you can comment on or make changes to this bug.