Add some CSS rules to select MathML annotations and alttext - by FredWang_

Status : 

 


ID 812595 Comments
Status Active Workarounds
Type Bug Repros 1
Opened 12/31/2013 8:00:36 AM
Access Restriction Public

Description

There does not seem to be any plan to add MathML support in IE soon. This is becoming critical now that MathPlayer is no longer supported in Internet Explorer 11 and that large websites like MDN are starting to use MathML content.  Hence an alternative for the short term would be to implement MathML annotation / alttext so that Web developers can still provide alternate content for Internet Explorer. I already reported that for IE9 but the issue was fixed "by design" without further explanation so I hope this one will get more attention. At least support for semantics annotations and altext can be done very easily with CSS-only rules, as shown in the testcase I'll attach. So I hope Microsoft will consider integrating these rules in the IE user-agent stylesheet. I already reported a bug for Chromium and plan to submit a patch there.

For more information, see
http://news.dessci.com/2013/10/microsoft-cripples-display-math-ie10-11.html
https://code.google.com/p/chromium/issues/detail?id=324764

UPDATE 2014/03/18:
1) A restricted version of the stylesheet landed in Chromium: https://src.chromium.org/viewvc/blink?revision=169439&view=revision
2) An alternative would be to use https://github.com/fred-wang/mathml.css to get support for a limited number of math constructions.
Sign in to post a comment.
Posted by Microsoft on 3/18/2014 at 1:59 PM
Thank you so much for the feedback.

Unfortunately, we are not able to address this feedback in our upcoming release. We will consider your feedback for a future release.
We will keep this connect feedback bug active to track this request.

Every piece of feedback we receive is important to us and helps us improve the quality of Internet Explorer.
We continue to welcome more feedback, so please don't hesitate to report other ways that we can improve Internet Explorer.

Best regards,
The Internet Explorer Beta Team
Posted by FredWang_ on 3/18/2014 at 4:52 AM
FYI, a stylesheet to do such CSS fallback landed in Chrome today.

I'm trying to think how Wikipedia could rely on these UA rules to provide SVG fallback in the future, so it would be great if we had something consistent on all browsers without MathML support.

So I'm thinking that something like this could be possible:

1) Use the original stylesheet or a restricted version like the one in Chrome. Normal MathML will render badly, but it will be replaced with the annotation fallback, if specified by the author.

2) Use the advanced https://github.com/fred-wang/mathml.css stylesheet but adapt it so that the basic math rendering will be used for normal MathML but it will be replaced with the annotation fallback, if specified by the author.

Than you to keep be updated about your plans so that I can coordinate with MediaWiki Math developers.
Posted by FredWang_ on 3/11/2014 at 3:55 PM
FYI, I've published on GitHub a CSS3 stylesheet based on Presto's former MathML stylesheet (http://www.w3.org/TR/mathml-for-css/):

https://github.com/fred-wang/mathml.css

This could be an alternative to display basic MathML constructions.
Posted by Microsoft on 1/31/2014 at 8:30 AM
Thank you for your feedback. We will be investigating this issue further.

Best regards,

The Internet Explorer Team
Posted by FredWang_ on 1/1/2014 at 9:24 AM
I just upload a test case. Here are more pages from MDN:

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#Types_of...
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Obje...
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Obje...
Posted by FredWang_ on 1/1/2014 at 8:47 AM
I just submitted a patch to implement this in Blink. I realized that there was a mistake in my previous attachment. Some CSS selectors should use "+" rather than "~" since we only want the first annotation to be displayed. Here is the user agent stylesheet I ended up writing:

--- mathml.css ---
@namespace "http://www.w3.org/1998/Math/MathML";

/* By default, we only display the MathML formulas without any formatting other than the one specified by the display attribute. */
math {
    display: inline;
}
math[display="block"] {
    display: block;
    text-align: center;
}

/* We only display the second child of a <semantics> element, which is its first annotation. */
semantics > * {
    display: none;
}
semantics > *:first-child + annotation,
semantics > *:first-child + annotation-xml {
    display: inline-block;
}

/* If an alttext attribute is specified, we replace the MathML formula with that text. */
math[alttext] * {
    display: none;
}
math[alttext]::after {
    content: attr(alttext);
}
Posted by FredWang_ on 12/31/2013 at 8:14 AM
I attached a mathml.xml file showing a testcase and CSS implementation.
See also https://code.google.com/p/chromium/issues/attachmentText?id=324764&aid=3247640003000&name=mathml.html&token=XBe8b5_3jlaT_d2DyxBs_dGAs7w%3A1388503951689 for a HTML version.