Diff
Modified: trunk/Source/WebCore/ChangeLog (283600 => 283601)
--- trunk/Source/WebCore/ChangeLog 2021-10-06 05:20:07 UTC (rev 283600)
+++ trunk/Source/WebCore/ChangeLog 2021-10-06 05:40:07 UTC (rev 283601)
@@ -1,3 +1,27 @@
+2021-10-05 Tyler Wilcock <[email protected]>
+
+ AX: Move handling of AXContents from platform wrapper to AX core
+ https://bugs.webkit.org/show_bug.cgi?id=231231
+
+ Reviewed by Chris Fleizach.
+
+ No changed functionality.
+
+ Moved handling of the AXContents (NSAccessibilityContentsAttribute) from the
+ Mac wrapper accessibilityAttributeValue handler to AXCoreObject::contents.
+ This makes it possible to share this code across multiple platforms.
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::contents):
+ * accessibility/AccessibilityObject.h:
+ * accessibility/AccessibilityObjectInterface.h:
+ * accessibility/isolatedtree/AXIsolatedObject.cpp:
+ (WebCore::AXIsolatedObject::initializeAttributeData):
+ * accessibility/isolatedtree/AXIsolatedObject.h:
+ * accessibility/isolatedtree/AXIsolatedTree.h:
+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+ (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+
2021-10-05 John Wilander <[email protected]>
PCM: Allow measurement of links in nested, cross-site iframes
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (283600 => 283601)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2021-10-06 05:20:07 UTC (rev 283600)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2021-10-06 05:40:07 UTC (rev 283601)
@@ -3149,6 +3149,20 @@
return IntRect();
}
+
+void AccessibilityObject::contents(AccessibilityChildrenVector& result)
+{
+ if (isTabList())
+ tabChildren(result);
+ else if (isScrollView()) {
+ // A scroll view's contents are everything except the scroll bars.
+ AccessibilityChildrenVector nonScrollbarChildren;
+ for (RefPtr<AccessibilityObject> child = firstChild(); child; child = child->nextSibling()) {
+ if (child && !child->isScrollbar())
+ result.append(child);
+ }
+ }
+}
IntSize AccessibilityObject::scrollContentsSize() const
{
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (283600 => 283601)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.h 2021-10-06 05:20:07 UTC (rev 283600)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h 2021-10-06 05:40:07 UTC (rev 283601)
@@ -640,6 +640,7 @@
bool scrollByPage(ScrollByPageDirection) const override;
IntPoint scrollPosition() const override;
+ void contents(AccessibilityChildrenVector&) override;
IntSize scrollContentsSize() const override;
IntRect scrollVisibleContentRect() const override;
void scrollToMakeVisible(const ScrollRectToVisibleOptions&) const override;
Modified: trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h (283600 => 283601)
--- trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h 2021-10-06 05:20:07 UTC (rev 283600)
+++ trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h 2021-10-06 05:40:07 UTC (rev 283601)
@@ -1374,6 +1374,7 @@
enum class ScrollByPageDirection { Up, Down, Left, Right };
virtual bool scrollByPage(ScrollByPageDirection) const = 0;
virtual IntPoint scrollPosition() const = 0;
+ virtual void contents(AccessibilityChildrenVector&) = 0;
virtual IntSize scrollContentsSize() const = 0;
virtual IntRect scrollVisibleContentRect() const = 0;
virtual void scrollToMakeVisible(const ScrollRectToVisibleOptions&) const = 0;
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp (283600 => 283601)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp 2021-10-06 05:20:07 UTC (rev 283600)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp 2021-10-06 05:40:07 UTC (rev 283601)
@@ -298,6 +298,10 @@
if (object.isImage())
setProperty(AXPropertyName::EmbeddedImageDescription, object.embeddedImageDescription().isolatedCopy());
+ AccessibilityChildrenVector contents;
+ object.contents(contents);
+ setObjectVectorProperty(AXPropertyName::Contents, contents);
+
AccessibilityChildrenVector visibleChildren;
object.visibleChildren(visibleChildren);
setObjectVectorProperty(AXPropertyName::VisibleChildren, visibleChildren);
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h (283600 => 283601)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h 2021-10-06 05:20:07 UTC (rev 283600)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h 2021-10-06 05:40:07 UTC (rev 283601)
@@ -348,6 +348,7 @@
void setSelectedChildren(const AccessibilityChildrenVector&) override;
void visibleChildren(AccessibilityChildrenVector& children) override { fillChildrenVectorForProperty(AXPropertyName::VisibleChildren, children); }
void tabChildren(AccessibilityChildrenVector& children) override { fillChildrenVectorForProperty(AXPropertyName::TabChildren, children); }
+ void contents(AccessibilityChildrenVector& children) override { fillChildrenVectorForProperty(AXPropertyName::Contents, children); }
bool hasARIAValueNow() const override { return boolAttributeValue(AXPropertyName::HasARIAValueNow); }
String tagName() const override { return stringAttributeValue(AXPropertyName::TagName); }
const AccessibilityChildrenVector& children(bool updateChildrenIfNeeded = true) override;
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h (283600 => 283601)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h 2021-10-06 05:20:07 UTC (rev 283600)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h 2021-10-06 05:40:07 UTC (rev 283601)
@@ -96,6 +96,7 @@
ColumnIndexRange,
ComputedLabel,
ComputedRoleString,
+ Contents,
CurrentState,
CurrentValue,
DatetimeAttributeValue,
Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (283600 => 283601)
--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm 2021-10-06 05:20:07 UTC (rev 283600)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm 2021-10-06 05:40:07 UTC (rev 283601)
@@ -2381,34 +2381,9 @@
}
if ([attributeName isEqualToString:NSAccessibilityContentsAttribute]) {
- // The contents of a tab list are all the children except the tabs.
- if (backingObject->isTabList()) {
- auto children = self.childrenVectorArray;
- AccessibilityObject::AccessibilityChildrenVector tabs;
- backingObject->tabChildren(tabs);
- auto tabsChildren = convertToNSArray(tabs);
-
- NSMutableArray *contents = [NSMutableArray array];
- for (id childWrapper in children) {
- if ([tabsChildren containsObject:childWrapper])
- [contents addObject:childWrapper];
- }
- return contents;
- }
-
- if (backingObject->isScrollView()) {
- // A scrollView's contents are everything except the scroll bars.
- auto children = self.childrenVectorArray;
- NSMutableArray *contents = [NSMutableArray array];
-
- for (WebAccessibilityObjectWrapper *childWrapper in children) {
- if (auto backingObject = [childWrapper axBackingObject]) {
- if (!backingObject->isScrollbar())
- [contents addObject:childWrapper];
- }
- }
- return contents;
- }
+ AccessibilityObject::AccessibilityChildrenVector contents;
+ backingObject->contents(contents);
+ return convertToNSArray(contents);
}
if (backingObject->isTable() && backingObject->isExposable()) {