rendering of semantics elements in mozilla.

0 views
Skip to first unread message

David Carlisle

unread,
Feb 3, 2003, 6:32:14 AM2/3/03
to mozilla...@mozilla.org

As Mozilla doesn't render Content MathML it would be nice to be able
to combine Content expressions together with Presentation MathML
(and other things) in a semantics element, and have mozilla ignore
everything except the presentation mathml.

In addition to Content mathml, editors and computer algebra systems
often use the semantics element to annotate an expression with
processor-specific information (which is the intended use of this
element). All a browser has to do is ignore the annotations.

there was/is a bugzilla report for this which is marked as fixed

http://bugzilla.mozilla.org/show_bug.cgi?id=154931


however the css rule added at that time appears to be:

/**********************************************************************/
/* Hide embedded semantic MathML content (as opposed to presentational
content, which we render). */
annotation-xml[encoding="MathML-Content"] {
display: none;
}


This leaves non xml annotation elements being rendered (these typically
contain maple or mathematica encodings of the expression)

Also it renders all annotation-xml except content-mathml (for example
the openmath as used examples in chapter 5 of the spec).

The simplest css based rendering rules would be

annotation{ display: none; }
annotation-xml{ display: none; }

ie don't render any annotation at all (and so just render the first child of
the semantics element)

A more complete rule would be:

if there is an <annotation-XML encoding="MathML-presentation">
render that annotation, and ignore the first child of the semantics
element and all other annotations,
else
render the first child of semantics and ignore all annotations


I don't think you can express this rule purely in css though.
The simpler rule of just ignoring all annotations is still conformant
with the specification and would cover most existing cases that are
causing problems. (The XSLT stylesheet for MathML implements the more
complete rule, as well as doing content-presentation transformation, for
cases when the full functionality is needed).


For example, asking maple to output the expression cos x as mathml
produces

<math xmlns='http://www.w3.org/1998/Math/MathML'>
<semantics>
<mrow xref='id3'>
<mi xref='id1'>cos</mi>
<mo>&ApplyFunction;</mo>
<mfenced><mi xref='id2'>x</mi></mfenced>
</mrow>
<annotation-xml encoding='MathML-Content'>
<apply id='id3'><cos id='id1'/><ci id='id2'>x</ci></apply>
</annotation-xml>
<annotation encoding='Maple'>
cos(x)
</annotation>
</semantics>
</math>


which renders as cos(x)cos(x) in mozilla 1.1 (which I suppose is a bit
old, but I believe newer mozilla are the same?)


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Roger B. Sidje

unread,
Feb 4, 2003, 3:00:57 AM2/4/03
to David Carlisle, mozilla...@mozilla.org
David Carlisle wrote:
>
> The simplest css based rendering rules would be
>
> annotation{ display: none; }
> annotation-xml{ display: none; }

I have re-opened the bug.

>
> which renders as cos(x)cos(x) in mozilla 1.1 (which I suppose is a bit
> old, but I believe newer mozilla are the same?)

Sadly no. the upcoming m1.3 is so far hanging on pages that refer to
the Universal MathML XSLT due to the usage of <script for="...">.
---
RBS

Reply all
Reply to author
Forward
0 new messages