Hi everyone,

*Summary*: I'm planning to implement the MathMLElement interface. This
means adding support for new MathML content and IDL attributes (namely,
from the GlobalEventHandlers, DocumentAndElementEventHandlers,
HTMLOrForeignElement, ElementCSSInlineStyle mixins) that already exist
for HTML elements.

The goal is to make MathML less special as explained in
https://bkardell.com/blog/OnePlatform.html. Currently, all MathML
elements just use the Element interface and it is for instance not even
possible to use something like mathmlEl.style to access inline style.
This has been causing concrete issues e.g. in Marionette's testdriver's
implementation (https://bugzilla.mozilla.org/show_bug.cgi?id=1530110) or
in DevTools style rules
(https://bugzilla.mozilla.org/show_bug.cgi?id=1231085).

More generally, as suggested in
https://groups.google.com/forum/#!msg/mozilla.dev.platform/A6rs06cpt7I/0gOinxLvBQAJ
the idea is on the one hand to simplify native MathML implementations to
a core subset and on the other hand to provide to web developers the
necessary APIs to easily enhance it with their own math extensions. The
MathMLElement interface is a first step toward the latter.

*Bug*: https://bugzilla.mozilla.org/show_bug.cgi?id=1571487

*Link to standard*:
https://mathml-refresh.github.io/mathml-core/#dom-mathmlelement
https://mathml-refresh.github.io/mathml-core/#attributes-common-to-html-and-mathml-elements
https://github.com/mathml-refresh/mathml/issues/83
https://github.com/whatwg/html/issues/4702

*Platform coverage*: All

*Preference*: No preference for now, as these are not really new
features but really just "normalizing" MathML. However, one preference
can be introduced if people feel it is necessary.

*DevTools bug*:
https://bugzilla.mozilla.org/show_bug.cgi?id=1583020
https://bugzilla.mozilla.org/show_bug.cgi?id=1231085

*Other browsers*:

WebKit: Shipped in r249572 (without flag)
https://github.com/whatwg/html/issues/4702#issuecomment-529172144
https://github.com/mathml-refresh/mathml/issues/83#issuecomment-518398056

Blink: Considering (intent to be emailed in October)
https://www.chromestatus.com/feature/5240822173794304
https://log.csswg.org/irc.w3.org/css/2019-09-17/#e1241535
https://github.com/mathml-refresh/mathml/issues/83#issuecomment-510051714

*web-platform-tests*:

mathml/relations/html5-tree/clipboard-event-handlers.tentative.html
mathml/relations/html5-tree/css-inline-style-dynamic.tentative.html
mathml/relations/html5-tree/css-inline-style-interface.tentative.html
mathml/relations/html5-tree/href-click-3.html
mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html
mathml/relations/html5-tree/math-global-event-handlers.tentative.html
mathml/relations/html5-tree/tabindex-001.html
mathml/relations/html5-tree/tabindex-002.html
This will signicantly increase the Gecko's pass rate on
https://mathml-refresh.github.io/mathml-core/implementation-report.html

*Secure contexts*: Same as HTMLElement IDL.

*Is this feature enabled by default in sandboxed iframes?* Same as
HTMLElement IDL.

*How stable is the spec*: Although MathML Core is still a draft, as said
above these are really attributes that already exist in HTML5/CSSOM
specifications and implemented in all browsers.

*Web designer / developer use-cases AKA Why a developer would use
Feature X?*

- This would make easier to web developers to write interactive MathML
content or write extensions to MathML Core. Currently, it is possible to
implement equivalent behavior but in a more verbose way (consider for
example implementing tab navigation + focus ring for a large math
equation without tabindex).

- When writing generic JavaScript for HTML content, one has to add
special handling to support MathML (cf mentions of Marionette and
DevTools above).

*Example*:

https://people.igalia.com/fwang/blink-on-10/slides/#/12

A very basic demo presented at the last BlinkOn. One could use
MathMLElement.onclick = ...  and MathMLElement.style.color = ... to
easily change the color of the red alpha when clicked. Without
MathMLelement, one would use Element.addEventListener(...) and
Element.setAttribute("style", ...) which is a bit more verbose and
probably not how developers would do a quick implementation for "normal"
HTML elements.

-- 
Frédéric Wang
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to