Summary: | [selectors] :focus-visible matches body after keyboard event | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Manuel Rego Casasnovas <rego> | ||||||||
Component: | CSS | Assignee: | Manuel Rego Casasnovas <rego> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | clopez, darin, ews-watchlist, koivisto, webkit-bug-importer, youennf | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
See Also: | https://github.com/web-platform-tests/wpt/pull/28051 | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 185859 | ||||||||||
Attachments: |
|
Description
Manuel Rego Casasnovas
2021-03-12 03:47:10 PST
Created attachment 423032 [details]
Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess Comment on attachment 423032 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423032&action=review > Source/WebCore/page/EventHandler.cpp:3543 > + bool shouldMatchFocusVisible = keydown->modifierKeys().isEmpty() || ((keydown->shiftKey() || keydown->capsLockKey()) && !initialKeyEvent.text().isEmpty()); > + element->setHasFocusVisible(shouldMatchFocusVisible && element->focused()); It would be nicer to make shouldMatchFocusVisible a lambda that covers the element->focused() test too. > Source/WebCore/page/EventHandler.cpp:3594 > + element->setHasFocusVisible(shouldMatchFocusVisible && element->focused()); ...invoked again here. Created attachment 423035 [details]
Patch for landing
Comment on attachment 423032 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423032&action=review Thanks for the review. >> Source/WebCore/page/EventHandler.cpp:3543 >> + element->setHasFocusVisible(shouldMatchFocusVisible && element->focused()); > > It would be nicer to make shouldMatchFocusVisible a lambda that covers the element->focused() test too. Done. >> Source/WebCore/page/EventHandler.cpp:3594 >> + element->setHasFocusVisible(shouldMatchFocusVisible && element->focused()); > > ...invoked again here. Done. Created attachment 423045 [details]
Patch for landing
Committed r274365: <https://commits.webkit.org/r274365> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423045 [details]. |