Bug 1592170 [wpt PR 19965] - Fix default tabIndex IDL attribute values, a=testonly
commit9648415dea297fdb0d2ded05afb9f8f6cbf32e44
authorKent Tamura <tkent@chromium.org>
Mon, 4 Nov 2019 11:10:38 +0000 (4 11:10 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Wed, 20 Nov 2019 11:19:03 +0000 (20 11:19 +0000)
tree8476c9decc85ba55ba8a7e730df351060b5a1e0c
parent6577b4717e82bddf1a2a5da9d96a65d2d3ae9457
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
testing/web-platform/tests/html/interaction/focus/sequential-focus-navigation-and-the-tabindex-attribute/tabindex-getter.html