[webkit-reviews] review granted: [Bug 223113] [selectors] :focus-visible matches body after keyboard event : [Attachment 423032] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 12 04:20:44 PST 2021


Antti Koivisto <koivisto at iki.fi> has granted Manuel Rego Casasnovas
<rego at igalia.com>'s request for review:
Bug 223113: [selectors] :focus-visible matches body after keyboard event
https://bugs.webkit.org/show_bug.cgi?id=223113

Attachment 423032: Patch

https://bugs.webkit.org/attachment.cgi?id=423032&action=review




--- Comment #3 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 423032
  --> https://bugs.webkit.org/attachment.cgi?id=423032
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.


More information about the webkit-reviews mailing list