Closed Bug 1628500 Opened 6 years ago Closed 6 years ago

Remove aIgnoreTabindex argument from Element::IsInteractiveHTMLContent()

Categories

(Core :: DOM: Forms, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla77
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.

Depends on: 1627984
Status: UNCONFIRMED → NEW
Ever confirmed: true

This is apparently not Web compatible according to https://crbug.com/1069615. Repurposing this ticket to clean up Element::IsInteractiveHTMLContent() instead.

Assignee: nobody → timothygu99
Status: NEW → ASSIGNED
Type: defect → task
Summary: <label> should treat any HTML element with a tabindex attribute as interactive content → Remove aIgnoreTabindex argument from Element::IsInteractiveHTMLContent()

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.

Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/398b84162770 Remove aIgnoreTabindex argument from Element::IsInteractiveHTMLContent(). r=edgar
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
QA Whiteboard: [qa-77b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: