Skip to content

Rename HTMLOrSVGElement mixin to HTMLOrSVGOrMathMLElement#12416

Merged
annevk merged 3 commits into
whatwg:mainfrom
lukewarlow:htmlorsvgormathmlelement
May 4, 2026
Merged

Rename HTMLOrSVGElement mixin to HTMLOrSVGOrMathMLElement#12416
annevk merged 3 commits into
whatwg:mainfrom
lukewarlow:htmlorsvgormathmlelement

Conversation

@lukewarlow

@lukewarlow lukewarlow commented May 4, 2026

Copy link
Copy Markdown
Member

Rename HTMLOrSVGElement mixin to HTMLOrSVGOrMathMLElement

Also set default tabIndex value for MathML's a element to be 0.

Fixes #4702

SVG PR: w3c/svgwg#1103
MathML Core PR: w3c/mathml-core#324

(See WHATWG Working Mode: Changes for more details.)


/dom.html ( diff )
/infrastructure.html ( diff )
/interaction.html ( diff )
/urls-and-fetching.html ( diff )

@lukewarlow

Copy link
Copy Markdown
Member Author

Based on our last discussion in WhatNot I've gone with HTMLOrSVGOrMathMLElement rather than HTMLOrForeignElement. I've included MathML Core's newly added 'a' element to the tabIndex defaulting to 0 list, and various WPTs do check for that too.

@lukewarlow

lukewarlow commented May 4, 2026

Copy link
Copy Markdown
Member Author

Mozilla implemented the original name of HTMLOrForeignElement and included it in MathMLElement

WebKit seems to have done the same, and I believe chromium were supportive before so I think we can consider this to have implementor interest.

If there's a lack of consensus or very clear spec on MathML <a> specifically I'm happy to drop that reference from this PR and wait till it's further specified and prototyped before including that change.

@fred-wang

Copy link
Copy Markdown
Contributor

Mozilla implemented the original name of HTMLOrForeignElement and included it in MathMLElement

WebKit seems to have done the same, and I believe chromium were supportive before so I think we can consider this to have implementor interest.

FWIW Chromium has this too:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_or_foreign_element.idl;l=8;drc=047c7dc4ee1ce908d7fea38ca063fa2f80f92c77
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/mathml/mathml_element.idl

In any case, I believe this name is not exposed to Web developers.

If there's a lack of consensus on MathML specifically I'm happy to drop that reference from this PR and wait till it's further specified and prototyped before including that change.

Just some more context on this.

Historically in MathML3 the href attribute was supported on all elements but there were safety concerns about it. At the end, the consensus seems to be that we want to introduce an <a> as a single linkable tag, similar to SVG/HTML, which would have similar layout as <mrow>.

MathML Core says any unknown MathML element should be laid out as as <mrow>. Chromium's MathML Core implementation has always had this behavior, and it was implemented some months ago in Firefox and WebKit. This means <a> is already laid out that way in any case.

Additionally, Firefox and WebKit's implementation of the href attribute is still working for <a> and also being deprecated on other elements, see https://bugzilla.mozilla.org/show_bug.cgi?id=2026848 and WebKit/WebKit#61628

Chromium's initial implementation of MathML Core does not support links, essentially because we couldn't find a consensus on the issue I mentioned above. But now that we agreed on having a single linkable element I personally think it makes sense to implement it. I don't think there is an official position from the Chromium project on that though.

@annevk

annevk commented May 4, 2026

Copy link
Copy Markdown
Member

I don't think we need implementer interest. That's been established by everyone doing this before it got standardized. Are any implementers failing any of the tentative tests? If so we should have implementation bugs.

@lukewarlow

Copy link
Copy Markdown
Member Author

I've added bugs for each browser to at least rename the mixin, each of them appears to have at least one failure so I've linked to the relevant test to ensure its kept track of too. I suspect Eri or Fred will manage to fix them soon.

@lukewarlow

Copy link
Copy Markdown
Member Author

Let me know if there's anythin else that's needed from me to get this merged. Thanks for the quick reiview!

@annevk annevk merged commit 0965f59 into whatwg:main May 4, 2026
2 checks passed
beckysiegel pushed a commit to chromium/chromium that referenced this pull request May 4, 2026
See whatwg/html#12416

Bug: 509407077
Change-Id: Icdc9f615d9fedc3d716ed560f2457c33d455b78e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7810461
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Frédéric Wang Nélar <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1624827}
webkit-commit-queue pushed a commit to fred-wang/WebKit that referenced this pull request May 5, 2026
https://bugs.webkit.org/show_bug.cgi?id=313970

Reviewed by Anne van Kesteren.

See whatwg/html#12416

* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/html/HTMLElement.idl:
* Source/WebCore/html/HTMLOrSVGOrMathMLElement.idl: Renamed from Source/WebCore/html/HTMLOrForeignElement.idl.
* Source/WebCore/mathml/MathMLElement.idl:
* Source/WebCore/svg/SVGElement.idl:

Canonical link: https://commits.webkit.org/312609@main
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request May 5, 2026
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request May 5, 2026
webkit-commit-queue pushed a commit to fred-wang/WebKit that referenced this pull request May 6, 2026
https://bugs.webkit.org/show_bug.cgi?id=311644

Reviewed by Anne van Kesteren.

See whatwg/html#12416

* LayoutTests/imported/w3c/web-platform-tests/mathml/relations/html5-tree/tabindex-001.tentative-expected.txt: Update expectation now that the tests pass.
* Source/WebCore/mathml/MathMLElement.cpp:
(WebCore::MathMLElement::defaultTabIndex const): Make defaultTabIndex default to 0 for a elements and -1 otherwise.
* Source/WebCore/mathml/MathMLElement.h: Override defaultTabIndex.

Canonical link: https://commits.webkit.org/312681@main
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request May 7, 2026
…. r=emilio,webidl

See whatwg/html#12416

Differential Revision: https://phabricator.services.mozilla.com/D298271

UltraBlame original commit: 719fef3ab93b726fd7f64a4d2054fd533205ef17
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request May 7, 2026
See whatwg/html#12416

Differential Revision: https://phabricator.services.mozilla.com/D298477

UltraBlame original commit: 129e7e3bcdf836fb42ffd5620ad930d4dcf013f5
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request May 7, 2026
…. r=emilio,webidl

See whatwg/html#12416

Differential Revision: https://phabricator.services.mozilla.com/D298271

UltraBlame original commit: 719fef3ab93b726fd7f64a4d2054fd533205ef17
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request May 7, 2026
See whatwg/html#12416

Differential Revision: https://phabricator.services.mozilla.com/D298477

UltraBlame original commit: 129e7e3bcdf836fb42ffd5620ad930d4dcf013f5
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request May 7, 2026
…. r=emilio,webidl

See whatwg/html#12416

Differential Revision: https://phabricator.services.mozilla.com/D298271

UltraBlame original commit: 719fef3ab93b726fd7f64a4d2054fd533205ef17
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request May 7, 2026
See whatwg/html#12416

Differential Revision: https://phabricator.services.mozilla.com/D298477

UltraBlame original commit: 129e7e3bcdf836fb42ffd5620ad930d4dcf013f5
beckysiegel pushed a commit to chromium/chromium that referenced this pull request May 12, 2026
See whatwg/html#12416 and
https://html.spec.whatwg.org/multipage/urls-and-fetching.html#nonce-attributes

Bug: 469878491
Change-Id: Ic9e3b77791eba23708bcbf1fafc57036eb45c96b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7827786
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Frédéric Wang Nélar <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1629086}
webkit-commit-queue pushed a commit to fred-wang/WebKit that referenced this pull request May 12, 2026
https://bugs.webkit.org/show_bug.cgi?id=314614

Reviewed by Anne van Kesteren.

whatwg/html#12416
https://html.spec.whatwg.org/multipage/urls-and-fetching.html#nonce-attributes
web-platform-tests/wpt#59809

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::attributeChanged): Also handle nonce setter for MathML.
* Source/WebCore/mathml/MathMLElement.cpp:
(WebCore::MathMLElement::insertionSteps): Hide nonce for MathML.
* Source/WebCore/mathml/MathMLElement.h: Declare overridden method.

Canonical link: https://commits.webkit.org/313075@main
fred-wang added a commit to web-platform-tests/wpt that referenced this pull request May 13, 2026
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request May 14, 2026
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request May 14, 2026
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request May 14, 2026
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request May 14, 2026
…ibute on MathML elements., a=testonly

Automatic update from web-platform-tests
Add tests for autofocus content/IDL attribute on MathML elements.

whatwg/html#12416
https://html.spec.whatwg.org/multipage/interaction.html#the-autofocus-attribute
https://w3c.github.io/mathml-core/#dfn-autofocus

--

wpt-commits: 4cc9a18629dffa80639bb996b56211ac13d5b29d
wpt-pr: 59816
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request May 14, 2026
…lements., a=testonly

Automatic update from web-platform-tests
 Add tests for focus()/blur() on MathML elements.

whatwg/html#12416

--

wpt-commits: 5bdd10dd60f5b33793d99fd34b4551946fcf3751
wpt-pr: 59817
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request May 16, 2026
…ibute on MathML elements., a=testonly

Automatic update from web-platform-tests
Add tests for autofocus content/IDL attribute on MathML elements.

whatwg/html#12416
https://html.spec.whatwg.org/multipage/interaction.html#the-autofocus-attribute
https://w3c.github.io/mathml-core/#dfn-autofocus

--

wpt-commits: 4cc9a18629dffa80639bb996b56211ac13d5b29d
wpt-pr: 59816

UltraBlame original commit: c2998c5bd44ed0843fb6ad599c6c679032221ceb
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request May 16, 2026
…lements., a=testonly

Automatic update from web-platform-tests
 Add tests for focus()/blur() on MathML elements.

whatwg/html#12416

--

wpt-commits: 5bdd10dd60f5b33793d99fd34b4551946fcf3751
wpt-pr: 59817

UltraBlame original commit: 971ce4b08494ec650690c0d72bff18344a31b266
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request May 16, 2026
…ibute on MathML elements., a=testonly

Automatic update from web-platform-tests
Add tests for autofocus content/IDL attribute on MathML elements.

whatwg/html#12416
https://html.spec.whatwg.org/multipage/interaction.html#the-autofocus-attribute
https://w3c.github.io/mathml-core/#dfn-autofocus

--

wpt-commits: 4cc9a18629dffa80639bb996b56211ac13d5b29d
wpt-pr: 59816

UltraBlame original commit: c2998c5bd44ed0843fb6ad599c6c679032221ceb
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request May 16, 2026
…lements., a=testonly

Automatic update from web-platform-tests
 Add tests for focus()/blur() on MathML elements.

whatwg/html#12416

--

wpt-commits: 5bdd10dd60f5b33793d99fd34b4551946fcf3751
wpt-pr: 59817

UltraBlame original commit: 971ce4b08494ec650690c0d72bff18344a31b266
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request May 16, 2026
…ibute on MathML elements., a=testonly

Automatic update from web-platform-tests
Add tests for autofocus content/IDL attribute on MathML elements.

whatwg/html#12416
https://html.spec.whatwg.org/multipage/interaction.html#the-autofocus-attribute
https://w3c.github.io/mathml-core/#dfn-autofocus

--

wpt-commits: 4cc9a18629dffa80639bb996b56211ac13d5b29d
wpt-pr: 59816

UltraBlame original commit: c2998c5bd44ed0843fb6ad599c6c679032221ceb
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request May 16, 2026
…lements., a=testonly

Automatic update from web-platform-tests
 Add tests for focus()/blur() on MathML elements.

whatwg/html#12416

--

wpt-commits: 5bdd10dd60f5b33793d99fd34b4551946fcf3751
wpt-pr: 59817

UltraBlame original commit: 971ce4b08494ec650690c0d72bff18344a31b266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Consider renaming HTMLOrSVGElement to HTMLOrForeignElement

3 participants