Bug
1592170 [wpt PR 19965] - Fix default tabIndex IDL attribute values, a=testonly
Automatic update from web-platform-tests
Fix default tabIndex IDL attribute values
We follow https://html.spec.whatwg.org/C/#dom-tabindex by this CL.
The old behavior of default tabIndex was something like "Returns 0
if the element is focusable, -1 otherwise". But it didn't match to
the HTML standard, and was not interoperable.
Since this CL, some elements return -1 if "tabindex" attribute is
missing or invalid regardless of their focusability.
Implementation:
Node::tabIndex() is not a virtual function any longer. We have only
Element::tabIndex(), and it calls virtual DefaultTabIndex() if
"tabindex" attribute is missing or invalid.
DefaultTabIndex() for elements listed in the specification returns 0.
Otherwise, it returns -1.
- HTMLAnchorElement affects <a> and <area>
- HTMLFormControlElementWithState affects <input>, <select>, and
<textarea>.
- HTMLFrameElementBase affects <frame> and <iframe>
Blink can't use Element::tabIndex() for the purpose of focusability
check any longer. This CL updates existing tabIndex() callsites to
avoid behavior changes.
Change-Id: Ib1728d6be98ccf589fc0e3e153d07eb973532e25
Bug: 982350
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/
1883350
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710206}
--
wpt-commits:
c04bd1aa9ff4aa4075a33c2cca51a60d3a8c1b54
wpt-pr: 19965
Differential Revision: https://phabricator.services.mozilla.com/D53527