[webkit-reviews] review granted: [Bug 234885] AX: AccessibilityObject::setFocused(true) should make the webpage focused, and make web content the first responder : [Attachment 448409] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 6 10:34:16 PST 2022


Darin Adler <darin at apple.com> has granted Tyler Wilcock <tyler_w at apple.com>'s
request for review:
Bug 234885: AX: AccessibilityObject::setFocused(true) should make the webpage
focused, and make web content the first responder
https://bugs.webkit.org/show_bug.cgi?id=234885

Attachment 448409: Patch

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




--- Comment #3 from Darin Adler <darin at apple.com> ---
Comment on attachment 448409
  --> https://bugs.webkit.org/attachment.cgi?id=448409
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=448409&action=review

> Source/WebCore/accessibility/AccessibilityObject.cpp:2797
> +#if PLATFORM(IOS_FAMILY)
> +	   // Mark the page as focused so the focus ring can be drawn
immediately. The page is also marked
> +	   // as focused as part assistiveTechnologyMakeFirstResponder, but
that requires some back-and-forth
> +	   // IPC between the web and UI processes, during which we can miss
the drawing of the focus ring for the
> +	   // first focused element. Making the page focused is a requirement
for making the page selection focused.
> +	   // This is iOS only until there's a demonstrated need for this
preemptive focus on other platforms.
> +	   if (!page->focusController().isFocused())
> +	       page->focusController().setFocused(true);
> +#endif

Once we call ChromeClient::focus, a lot of side effects may have happened;
almost anything could happen including arbitrary code running on webpages and
doing a lot. Not sure it’s OK to do more work after that using a page pointer
which might now be a deallocated object. We may need to reorder things, or
re-fetch document, frame, and page.


More information about the webkit-reviews mailing list