Closed
Bug 1128054
Opened 10 years ago
Closed 5 years ago
invalid tabindex value makes element focusable
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
RESOLVED
FIXED
mozilla77
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: mail, Assigned: edgar)
References
()
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20150108202552
Steps to reproduce:
create the element <span tabindex="hello">...</span> and tried to focus it
Actual results:
the element with an obviously invalid tabindex was focused.
Expected results:
nothing, as the element should not be focusable
Comment 1•10 years ago
|
||
when using it on an element who is not focusable by default like span element it become only focusable on click but when using it on <a> without ahref it becomme focusable on click and keyboard navigation.
Furthermore there is the same problem when using tabindex with any value at all example :
<span tabindex>...</span>
Live example : https://jsfiddle.net/pxxnx9pc/
Comment 2•10 years ago
|
||
From [1] it's clear that an non-integer (and thus invalid) "tabindex" value should be the same
than an unspecified value.
Currently it's like tabindex=0 for links/buttons/likely others and tabindex=-1 otherwise.
[1] http://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute
Component: Untriaged → Event Handling
Product: Firefox → Core
Updated•10 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•10 years ago
|
Updated•6 years ago
|
Component: Event Handling → User events and focus handling
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee: nobody → echen
Assignee | ||
Comment 3•5 years ago
|
||
Assignee | ||
Comment 4•5 years ago
|
||
Instead of checking node name in nsGenericHTMLElement.
Assignee | ||
Comment 5•5 years ago
|
||
Given that the Element::TabIndexDefault returns -1 already.
Depends on D68208
Assignee | ||
Comment 6•5 years ago
|
||
See https://html.spec.whatwg.org/#attr-tabindex.
Depends on D68209
Assignee | ||
Comment 7•5 years ago
|
||
Assignee | ||
Comment 8•5 years ago
|
||
Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/784baedd224c
Part 1: Override IsInteractiveHTMLContent in HTMLEmbedElement; r=smaug
https://hg.mozilla.org/integration/autoland/rev/d44b8cf747e3
Part 2: Don't need to override TabIndexDefault in HTMLEmbedElement; r=smaug
https://hg.mozilla.org/integration/autoland/rev/89df17138443
Part 3: Invalid tabindex attribute should not make an element focusable; r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/22713 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Upstream PR merged by moz-wptsync-bot
Comment 13•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/784baedd224c
https://hg.mozilla.org/mozilla-central/rev/d44b8cf747e3
https://hg.mozilla.org/mozilla-central/rev/89df17138443
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox77:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in
before you can comment on or make changes to this bug.
Description
•