Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2d9b495ba0234def09ddf3b307d65ccbd57e5825
      
https://github.com/WebKit/WebKit/commit/2d9b495ba0234def09ddf3b307d65ccbd57e5825
  Author: Tyler Wilcock <[email protected]>
  Date:   2023-04-08 (Sat, 08 Apr 2023)

  Changed paths:
    M Source/WebCore/accessibility/AccessibilityMenuListPopup.h
    M Source/WebCore/accessibility/AccessibilityObject.h
    M Source/WebCore/accessibility/AccessibilityObjectInterface.h
    M Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

  Log Message:
  -----------
  AX: Eliminate all ways AXCoreObject::elementRect could be called on an 
AXIsolatedObject
https://bugs.webkit.org/show_bug.cgi?id=255138
rdar://problem/107741185

Reviewed by Chris Fleizach.

In a future patch, we will be caching the AXCoreObject::relativeFrame of each 
isolated object.
The relative frame is the position of an object relative to the current 
viewport (i.e. relative
frame is affected by things like scrolling). This is different than 
`AXCoreObject::elementRect`,
which is the "absolute" rect (relative to the root document origin, not 
effected by scrolling).

To avoid the need to cache both `elementRect` and `relativeFrame`, we must 
eliminate all ways
`elementRect` could be called on an `AXIsolatedObject` in the wrapper and 
elsewhere. This patch
accomplishes this in two ways.

First, AXCoreObject::size() is made virtual. In the future, AXIsolatedObject 
will be able to serve
this entirely off the main-thread (because `relativeFrame` will be cached).

Second, a new AXCoreObject::screenRelativePosition method is added to service
`-[WebAccessibilityObjectWrapperMac position]`. This batches the two 
main-thread trips `position`
currently makes into one single trip, and prevents calling `elementRect` on an 
AXIsolatedObject.

This patch also groups all frame / rect related methods in 
AccessibilityObjectInterface.h together.

* Source/WebCore/accessibility/AccessibilityMenuListPopup.h:
* Source/WebCore/accessibility/AccessibilityObject.h:
* Source/WebCore/accessibility/AccessibilityObjectInterface.h:
(WebCore::AXCoreObject::size const): Deleted.
* Source/WebCore/accessibility/cocoa/AccessibilityObjectCocoa.mm:
(WebCore::AccessibilityObject::screenRelativePosition const):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::screenRelativePosition const):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper position]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to