Remove aIgnoreTabindex argument from Element::IsInteractiveHTMLContent()
Categories
(Core :: DOM: Forms, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox77 | --- | fixed |
People
(Reporter: TimothyGu, Assigned: TimothyGu)
References
()
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36
Steps to reproduce:
<!doctype html>
<label>
<button onclick="alert('bad')">Don't click</button>
<div tabindex="0">Click</div>
</label>
Click on the div with tabindex.
(https://github.com/web-platform-tests/wpt/pull/22749)
Actual results:
The button got clicked.
Expected results:
The button should not get clicked, as the div should be considered interactive content, and the HTML Standard says that the activation behavior of the label with events targeted at interactive content descendants of label must be a no-op.
Previously Chrome and Safari behaves similarly to Firefox, but whatwg/html#5414 reaffirms the spec, and Chromium CL 2122369 implements the spec behavior. We should align with Chrome once they ship this change.
To fix this, one could change nsContentUtils::IsInInteractiveHTMLContent() to not call Element::IsInteractiveHTMLContent() with true as the aIgnoreTabindex argument.
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 1•6 years ago
|
||
This is apparently not Web compatible according to https://crbug.com/1069615. Repurposing this ticket to clean up Element::IsInteractiveHTMLContent() instead.
| Assignee | ||
Comment 2•6 years ago
|
||
This argument is set to true everywhere, and soon HTML will no longer consider
tabindex for interactive content: https://github.com/whatwg/html/pull/5457.
| Assignee | ||
Updated•6 years ago
|
Comment 4•6 years ago
|
||
| bugherder | ||
Updated•6 years ago
|
Description
•