Bug 213982
Summary: | WebKit autofocuses the last available autofocus element instead of the first available | ||
---|---|---|---|
Product: | WebKit | Reporter: | Maciej Stachowiak <mjs> |
Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | cdumez, rniwa, webkit-bug-importer, wenson_hsieh |
Priority: | P2 | Keywords: | InRadar |
Version: | Other | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Maciej Stachowiak
WebKit autofocuses the last available autofocus element instead of the first available. Other browsers autofocus the first.
Here is a test case: https://mehdi.cc/tests/multiple-autofocus/
In Safari, this focuses Field 2. In Firefox and Chrome, Field 1.
The spec says to autofocus the first. Well, sort of... autofocus for purposes of page load focus is only considered at element insertion time, not when the attribute is added or removed; and it's not the first element in document order that wins, it's the first (eligible) to be inserted.
Full spec details are here: https://html.spec.whatwg.org/#the-autofocus-attribute
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/65116588>
Ryosuke Niwa
*** This bug has been marked as a duplicate of bug 203139 ***