Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0985315890a7ba02b5e034deaf980fc8ab177faf
https://github.com/WebKit/WebKit/commit/0985315890a7ba02b5e034deaf980fc8ab177faf
Author: Ahmad Saleem <[email protected]>
Date: 2026-07-31 (Fri, 31 Jul 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/mathml/relations/html5-tree/tabindex-003-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/mathml/relations/html5-tree/tabindex-003.html
A
LayoutTests/imported/w3c/web-platform-tests/svg/interact/scripted/focus-tabindex-invalid-value-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/svg/interact/scripted/focus-tabindex-invalid-value.svg
M Source/WebCore/mathml/MathMLElement.cpp
M Source/WebCore/svg/SVGElement.cpp
Log Message:
-----------
MathML and SVG elements do not reset tabIndex when tabindex is changed to an
invalid value
https://bugs.webkit.org/show_bug.cgi?id=320709
rdar://183696552
Reviewed by Frédéric Wang Nélar and Ryosuke Niwa.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
MathMLElement::attributeChanged() and SVGElement::attributeChanged() only
cleared the
explicitly set tab index when the new value was empty, leaving a previously
parsed value
in place for any other value that failed to parse. So after
<mi tabindex="3">.setAttribute("tabindex", "abc")
mi.tabIndex kept reporting 3 instead of falling back to the default of -1.
HTML resets the tab index for any value that is not a valid integer, not just
the empty
string, and both MathML Core and SVG2 defer tabindex to HTML.
HTMLElement::attributeChanged()
already implements this; the MathML and SVG copies predate that fix. Match them.
Tests:
imported/w3c/web-platform-tests/mathml/relations/html5-tree/tabindex-003.html
imported/w3c/web-platform-tests/svg/interact/scripted/focus-tabindex-invalid-value.svg
*
LayoutTests/imported/w3c/web-platform-tests/mathml/relations/html5-tree/tabindex-003-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/mathml/relations/html5-tree/tabindex-003.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/interact/scripted/focus-tabindex-invalid-value-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/svg/interact/scripted/focus-tabindex-invalid-value.svg:
Added.
* Source/WebCore/mathml/MathMLElement.cpp:
(WebCore::MathMLElement::attributeChanged):
* Source/WebCore/svg/SVGElement.cpp:
(WebCore::SVGElement::attributeChanged):
Canonical link: https://commits.webkit.org/318303@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications