- Revision
- 288791
- Author
- [email protected]
- Date
- 2022-01-29 08:43:19 -0800 (Sat, 29 Jan 2022)
Log Message
AX: Isolated tree objects don't update their AXPropertyName::ElementRect or AXPropertyName::BoundingBoxRect in response to dynamic page changes
https://bugs.webkit.org/show_bug.cgi?id=235833
Reviewed by Chris Fleizach.
Source/WebCore:
Because isolated tree objects don't update their
AXPropertyName::ElementRect or AXPropertyName::BoundingBoxRect
anytime after AXIsolatedObject::initializeAttributeData,
any dynamic page change that causes the element to move or change
size will result in the isolated AX object holding out-of-date values
for these properties.
This patch remedies this deferring to the live, main-thread AX object
when serving elementRect and boundingBoxRect.
Test: accessibility/dynamic-changes-update-position.html
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
Stop caching the now removed properties AXPropertyName::ElementRect and AXPropertyName::BoundingBoxRect.
(WebCore::AXIsolatedObject::boundingBoxRect const):
(WebCore::AXIsolatedObject::elementRect const):
Retrieve these values from the main-thread instead of the now removed
AXPropertyName::ElementRect and AXPropertyName::BoundingBoxRect.
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/isolatedtree/AXIsolatedTree.h:
Remove AXPropertyName::ElementRect and AXPropertyName::BoundingBoxRect.
LayoutTests:
Add test reproducing this issue.
* accessibility/dynamic-changes-update-position-expected.txt: Added.
* accessibility/dynamic-changes-update-position.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (288790 => 288791)
--- trunk/LayoutTests/ChangeLog 2022-01-29 14:43:57 UTC (rev 288790)
+++ trunk/LayoutTests/ChangeLog 2022-01-29 16:43:19 UTC (rev 288791)
@@ -1,3 +1,15 @@
+2022-01-29 Tyler Wilcock <[email protected]>
+
+ AX: Isolated tree objects don't update their AXPropertyName::ElementRect or AXPropertyName::BoundingBoxRect in response to dynamic page changes
+ https://bugs.webkit.org/show_bug.cgi?id=235833
+
+ Reviewed by Chris Fleizach.
+
+ Add test reproducing this issue.
+
+ * accessibility/dynamic-changes-update-position-expected.txt: Added.
+ * accessibility/dynamic-changes-update-position.html: Added.
+
2022-01-29 Kimmo Kinnunen <[email protected]>
Capturing WebGL canvas through peer connection shows the image flipped
Added: trunk/LayoutTests/accessibility/dynamic-changes-update-position-expected.txt (0 => 288791)
--- trunk/LayoutTests/accessibility/dynamic-changes-update-position-expected.txt (rev 0)
+++ trunk/LayoutTests/accessibility/dynamic-changes-update-position-expected.txt 2022-01-29 16:43:19 UTC (rev 288791)
@@ -0,0 +1,14 @@
+This test ensures that an AX element's position is updated after a dynamic page change.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS: Link moved 90px in response to dynamic page change.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+
+
+
+
Added: trunk/LayoutTests/accessibility/dynamic-changes-update-position.html (0 => 288791)
--- trunk/LayoutTests/accessibility/dynamic-changes-update-position.html (rev 0)
+++ trunk/LayoutTests/accessibility/dynamic-changes-update-position.html 2022-01-29 16:43:19 UTC (rev 288791)
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+
+<div id="content">
+ <div id="div" role="group">
+ </div>
+
+ <a href="" id="link">apple.com</a>
+</div>
+
+<script>
+ description("This test ensures that an AX element's position is updated after a dynamic page change.");
+
+ if (window.accessibilityController) {
+ window.jsTestIsAsync = true;
+
+ var link = accessibilityController.accessibleElementById("link");
+ var startY = link.y;
+ var endY;
+ setTimeout(async function() {
+ document.getElementById("div").innerHTML = `
+ foo bar foo bar foo bar foo bar
+ <br>
+ foo bar foo bar foo bar foo bar
+ <br>
+ foo bar foo bar foo bar foo bar
+ <br>
+ foo bar foo bar foo bar foo bar
+ <br>
+ foo bar foo bar foo bar foo bar
+ `;
+ await waitFor(() => {
+ endY = link.y;
+ return startY !== endY;
+ });
+
+ debug(`PASS: Link moved ${Math.abs(startY - endY)}px in response to dynamic page change.`);
+ document.getElementById("content").style.visibility = "hidden";
+ finishJSTest();
+ }, 0);
+ }
+</script>
+</body>
+</html>
+
Modified: trunk/Source/WebCore/ChangeLog (288790 => 288791)
--- trunk/Source/WebCore/ChangeLog 2022-01-29 14:43:57 UTC (rev 288790)
+++ trunk/Source/WebCore/ChangeLog 2022-01-29 16:43:19 UTC (rev 288791)
@@ -1,3 +1,33 @@
+2022-01-29 Tyler Wilcock <[email protected]>
+
+ AX: Isolated tree objects don't update their AXPropertyName::ElementRect or AXPropertyName::BoundingBoxRect in response to dynamic page changes
+ https://bugs.webkit.org/show_bug.cgi?id=235833
+
+ Reviewed by Chris Fleizach.
+
+ Because isolated tree objects don't update their
+ AXPropertyName::ElementRect or AXPropertyName::BoundingBoxRect
+ anytime after AXIsolatedObject::initializeAttributeData,
+ any dynamic page change that causes the element to move or change
+ size will result in the isolated AX object holding out-of-date values
+ for these properties.
+
+ This patch remedies this deferring to the live, main-thread AX object
+ when serving elementRect and boundingBoxRect.
+
+ Test: accessibility/dynamic-changes-update-position.html
+
+ * accessibility/isolatedtree/AXIsolatedObject.cpp:
+ (WebCore::AXIsolatedObject::initializeAttributeData):
+ Stop caching the now removed properties AXPropertyName::ElementRect and AXPropertyName::BoundingBoxRect.
+ (WebCore::AXIsolatedObject::boundingBoxRect const):
+ (WebCore::AXIsolatedObject::elementRect const):
+ Retrieve these values from the main-thread instead of the now removed
+ AXPropertyName::ElementRect and AXPropertyName::BoundingBoxRect.
+ * accessibility/isolatedtree/AXIsolatedObject.h:
+ * accessibility/isolatedtree/AXIsolatedTree.h:
+ Remove AXPropertyName::ElementRect and AXPropertyName::BoundingBoxRect.
+
2022-01-29 Philippe Normand <[email protected]>
[LibWebRTC] ifdef cleanups
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp (288790 => 288791)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp 2022-01-29 14:43:57 UTC (rev 288790)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp 2022-01-29 16:43:19 UTC (rev 288791)
@@ -80,8 +80,6 @@
else
setProperty(AXPropertyName::AncestorFlags, object.computeAncestorFlagsWithTraversal());
- setProperty(AXPropertyName::BoundingBoxRect, object.boundingBoxRect());
- setProperty(AXPropertyName::ElementRect, object.elementRect());
setProperty(AXPropertyName::HasARIAValueNow, object.hasARIAValueNow());
setProperty(AXPropertyName::IsAccessibilityIgnored, object.accessibilityIsIgnored());
setProperty(AXPropertyName::IsActiveDescendantOfFocusedContainer, object.isActiveDescendantOfFocusedContainer());
@@ -1190,6 +1188,24 @@
return axObject ? axObject->misspellingRange(range, direction) : std::nullopt;
}
+LayoutRect AXIsolatedObject::boundingBoxRect() const
+{
+ return Accessibility::retrieveValueFromMainThread<LayoutRect>([this] () -> LayoutRect {
+ if (auto* axObject = associatedAXObject())
+ return axObject->boundingBoxRect();
+ return { };
+ });
+}
+
+LayoutRect AXIsolatedObject::elementRect() const
+{
+ return Accessibility::retrieveValueFromMainThread<LayoutRect>([this] () -> LayoutRect {
+ if (auto* axObject = associatedAXObject())
+ return axObject->elementRect();
+ return { };
+ });
+}
+
FloatRect AXIsolatedObject::relativeFrame() const
{
// Retrieve this on the main thread because we require the scroll ancestor to convert to the right scroll offset.
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h (288790 => 288791)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h 2022-01-29 14:43:57 UTC (rev 288790)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h 2022-01-29 16:43:19 UTC (rev 288791)
@@ -273,8 +273,8 @@
String subrolePlatformString() const override { return stringAttributeValue(AXPropertyName::SubrolePlatformString); }
String ariaLandmarkRoleDescription() const override { return stringAttributeValue(AXPropertyName::ARIALandmarkRoleDescription); }
bool supportsPressAction() const override { return boolAttributeValue(AXPropertyName::SupportsPressAction); }
- LayoutRect boundingBoxRect() const override { return rectAttributeValue<LayoutRect>(AXPropertyName::BoundingBoxRect); }
- LayoutRect elementRect() const override { return rectAttributeValue<LayoutRect>(AXPropertyName::ElementRect); }
+ LayoutRect boundingBoxRect() const override;
+ LayoutRect elementRect() const override;
IntPoint clickPoint() override { return intPointAttributeValue(AXPropertyName::ClickPoint); }
void accessibilityText(Vector<AccessibilityText>& texts) const override;
String brailleLabel() const override { return stringAttributeValue(AXPropertyName::BrailleLabel); }
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h (288790 => 288791)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h 2022-01-29 14:43:57 UTC (rev 288790)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h 2022-01-29 16:43:19 UTC (rev 288791)
@@ -71,7 +71,6 @@
AncestorFlags,
AutoCompleteValue,
BlockquoteLevel,
- BoundingBoxRect,
BrailleLabel,
BrailleRoleDescription,
CanHaveSelectedChildren,
@@ -109,7 +108,6 @@
DocumentLinks,
DocumentURI,
EditableAncestor,
- ElementRect,
EmbeddedImageDescription,
ExpandedTextValue,
FileUploadButtonReturnsValueInTitle,