[webkit-changes] [WebKit/WebKit] 30959c: AX: NSApplicationAccessibilityFocusedUIElement is ...

Tyler Wilcock noreply at github.com
Tue Aug 15 10:37:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 30959c84f8ab268a8d50591afd6fe2bb10812153
      https://github.com/WebKit/WebKit/commit/30959c84f8ab268a8d50591afd6fe2bb10812153
  Author: Tyler Wilcock <tyler_w at apple.com>
  Date:   2023-08-15 (Tue, 15 Aug 2023)

  Changed paths:
    A LayoutTests/accessibility/editable-webpage-focused-ui-element-expected.txt
    A LayoutTests/accessibility/editable-webpage-focused-ui-element.html
    M LayoutTests/platform/glib/TestExpectations
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl

  Log Message:
  -----------
  AX: NSApplicationAccessibilityFocusedUIElement is sometimes an ignored object which breaks functionality for Voice Control in Mail
https://bugs.webkit.org/show_bug.cgi?id=260191
rdar://113689647

Reviewed by Andres Gonzalez.

Mail uses WebPage::setEditable(true) (indirectly through IPC) to make
the entire webpage of a Mail compose window be editable. One side-effect
of this is that the `body` element gains focus.

In https://bugs.webkit.org/show_bug.cgi?id=257739, we made the
assumption that any focused object is inherently unignored by way of
having focus, and removed this code from AXObjectCache::focusedObjectForNode:

if (focus->accessibilityIsIgnored())
    return focus->parentObjectUnignored();

This bug reveals two pieces of information:
  1. Our assumption (any focused object is inherently unignored) is
     wrong, as the AXGroup associated with the `body` is ignored despite
     it being focused
  2. Even if this assumption were true, we would still experience the
     bug, as Voice Control very specifically expects the web area to be
     focused when editing a Mail message (arguably a Voice Control bug
     that should be addressed later)

With this patch, we restore the above check to AXObjectCache::focusedObjectForNode,
restoring behavior for Voice Control. We may want to re-evaluate this again in the
future, as our original assumption still seems sound but clearly has some kinks that
need working out.

* LayoutTests/accessibility/editable-webpage-focused-ui-element-expected.txt: Added.
* LayoutTests/accessibility/editable-webpage-focused-ui-element.html: Added.
* LayoutTests/platform/glib/TestExpectations: Disable new test.
* LayoutTests/platform/ios/TestExpectations: Enable new test.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::focusedObjectForNode):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::setSelectionFromNone):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

Canonical link: https://commits.webkit.org/266917@main




More information about the webkit-changes mailing list