WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
210223
<label> should treat any HTML element with a tabindex attribute as interactive content
https://bugs.webkit.org/show_bug.cgi?id=210223
Summary
<label> should treat any HTML element with a tabindex attribute as interactiv...
Timothy Gu
Reported
2020-04-08 15:58:04 PDT
Consider: <!DOCTYPE html> <label> <button onclick="alert('bad')">Don't click</button> <div tabindex="0">Click</div> </label> When one clicks on the div with tabindex attribute, the button gets clicked. But it should not, as the div should be considered interactive content [1], and the HTML Standard says that the activation behavior of the label [2] with events targeted at interactive content descendants of label must be a no-op. Previously Chrome and Firefox behaves similarly to Chrome, but whatwg/html#5414 [3] reaffirms the spec, and Chromium CL 2122369 [4] implements the spec behavior. I plan to implement this change in Firefox as well [5]. We should align once Chrome ship this change. More tests are available at [6]. [1]:
https://html.spec.whatwg.org/C/#interactive-content-2
[2]:
https://html.spec.whatwg.org/C/#the-label-element:activation-behaviour-2
[3]:
https://github.com/whatwg/html/issues/5414
[4]:
https://chromium-review.googlesource.com/c/chromium/src/+/2122369
[5]:
https://bugzilla.mozilla.org/show_bug.cgi?id=1628500
[6]:
https://github.com/web-platform-tests/wpt/pull/22749
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2020-04-08 16:25:52 PDT
<
rdar://problem/61484026
>
Timothy Gu
Comment 2
2020-04-13 12:32:24 PDT
This is apparently not web-compatible, according to
https://crbug.com/1069615
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug