Bug 1779311 [wpt PR 34819] - Child of delegatesFocus should not get :focus-visible...
commit5aa31a3321547d352832c2f7d61f1f2d6131e5e7
authorDi Zhang <dizhangg@chromium.org>
Wed, 20 Jul 2022 10:56:50 +0000 (20 10:56 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Thu, 21 Jul 2022 00:24:56 +0000 (21 00:24 +0000)
tree0213d86cd98611d64e9018e1ea0c177d20315872
parent04babc3ef8c76e69050ad2c25515bf64019770b0
Bug 1779311 [wpt PR 34819] - Child of delegatesFocus should not get :focus-visible styling if parent is clicked, a=testonly

Automatic update from web-platform-tests
Child of delegatesFocus should not get :focus-visible styling if parent is clicked

When matching the pseudo class of a delegatedFocus child element that
gets focused through a mouse click, the MouseEventManager unnecessarily assign it the "Forward" focus type. Then, in SelectorChecker, given it now has focus type "Forward", it is assigned the selector :focus-visible. This CL fixes this wrong logic and add a WPT test.

[1] https://drafts.csswg.org/selectors/#the-focus-visible-pseudo
[2] https://html.spec.whatwg.org/#element-has-the-focus

Change-Id: I76f4ccf8d20ba9886d01f0e185e02c257955c286
Fixed: 1327136
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3755450
Commit-Queue: Di Zhang <dizhangg@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1024371}

--

wpt-commits: fa49104bd886d5436d7f58a291e049e02cf157c9
wpt-pr: 34819
testing/web-platform/tests/shadow-dom/focus/focus-click-on-shadow-host.html [new file with mode: 0644]
testing/web-platform/tests/shadow-dom/focus/focus-tab-on-shadow-host.html