[Webkit-unassigned] [Bug 210223] New: <label> should treat any HTML element with a tabindex attribute as interactive content

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 8 15:58:04 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=210223

            Bug ID: 210223
           Summary: <label> should treat any HTML element with a tabindex
                    attribute as interactive content
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Forms
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: timothygu99 at gmail.com
                CC: cdumez at apple.com, wenson_hsieh at apple.com

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200408/a2c97eab/attachment.htm>


More information about the webkit-unassigned mailing list