Allow scripts to detect MathML-enabled builds




17 years ago
8 years ago


(Reporter: rbs, Unassigned)


(Depends on: 1 bug)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



17 years ago
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:
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

17 years ago
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

17 years ago
I think this would be nice to have for 1.0, because a significant number of
builds from that branch will have mathml enabled.
Keywords: mozilla1.0

Comment 4

17 years ago 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?
rbs: Do we support the MathML DOM?

Comment 6

17 years ago
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

16 years ago
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

16 years ago
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

16 years ago
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

16 years ago
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.
Depends on: 201903
QA Contact: ian → mathml
Assignee: rbs → nobody
All MoCo builds now have MathML enabled, right? Would it be appropriate to WONTFIX this now?
(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.
Last Resolved: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.