[webkit-changes] [WebKit/WebKit] 6be92f: AX: AXPropertyName::IsExpanded becomes stale for c...

Tyler Wilcock noreply at github.com
Thu Sep 21 17:35:41 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6be92f9431b6b6e00ab92b7e82540e3e16a74cbc
      https://github.com/WebKit/WebKit/commit/6be92f9431b6b6e00ab92b7e82540e3e16a74cbc
  Author: Tyler Wilcock <tyler_w at apple.com>
  Date:   2023-09-21 (Thu, 21 Sep 2023)

  Changed paths:
    M LayoutTests/accessibility/mac/expanded-notification-expected.txt
    M LayoutTests/accessibility/mac/expanded-notification.html
    M Source/WebCore/accessibility/AXLogger.cpp
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
    M Source/WebCore/html/HTMLElement.cpp
    M Source/WebCore/html/HTMLFormControlElement.cpp

  Log Message:
  -----------
  AX: AXPropertyName::IsExpanded becomes stale for certain elements with the popovertarget attribute
https://bugs.webkit.org/show_bug.cgi?id=261791
rdar://problem/115758014

Reviewed by Andres Gonzalez.

Multiple elements can point at a single popover:

<button id="show-popover-btn" popovertarget="mypopover" popovertargetaction="show">Show popover</button>
<button id="hide-popover-btn" popovertarget="mypopover" popovertargetaction="hide">Hide popover</button>
<div id="mypopover" popover>Popover content</div>

Currently, if #show-popover-btn is used to open the popover, its AXPropertyName::IsExpanded will be updated,
but not #hide-popover-btn's. This can cause ATs to output stale information.

This patch resolves this by introducing popover relations into AXRelationType, so that when a popover is shown
or hidden, we can efficiently find the elements that point at it via popovertarget and update them.

This patch also fixes a bug where we did not update AXPropertyName::SupportsExpanded and AXPropertyName::IsExpanded
after the popovertarget attribute is changed dynamically.

New testcases added to accessibility/mac/expanded-notification.html.

* LayoutTests/accessibility/mac/expanded-notification-expected.txt:
* LayoutTests/accessibility/mac/expanded-notification.html:
* Source/WebCore/accessibility/AXLogger.cpp:
(WebCore::operator<<):
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::onPopoverToggle):
(WebCore::AXObjectCache::relationAttributes):
(WebCore::AXObjectCache::symmetricRelation):
(WebCore::AXObjectCache::attributeToRelationType):
(WebCore::AXObjectCache::updateRelations):
(WebCore::AXObjectCache::onPopoverTargetToggle): Deleted.
* Source/WebCore/accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::onPopoverToggle):
(WebCore::AXObjectCache::onPopoverTargetToggle): Deleted.
* Source/WebCore/accessibility/AccessibilityObjectInterface.h:
(WebCore::AXCoreObject::popoverTargetedBy const):
* Source/WebCore/html/HTMLElement.cpp:
(WebCore::HTMLElement::showPopover):
(WebCore::HTMLElement::hidePopoverInternal):
* Source/WebCore/html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::handlePopoverTargetAction const):

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




More information about the webkit-changes mailing list