Changeset 256631 in webkit
- Timestamp:
- Feb 14, 2020 11:29:34 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r256630 r256631 1 2020-02-14 Andres Gonzalez <andresg_22@apple.com> 2 3 Implementation of AXIsolatedObject::isDescendantOfObject. 4 https://bugs.webkit.org/show_bug.cgi?id=207697 5 6 Reviewed by Chris Fleizach. 7 8 - Moved the implementation of AccessibilityObject::isDescendantOfObject 9 and isAncestorOfObject to the base class AXCoreObject. 10 - Implemented AXIsolatedObject::hasChildren by caching the value from 11 the associated AXObject. It is used in isDescendantOfObject. 12 13 * accessibility/AccessibilityObject.cpp: 14 (WebCore::AccessibilityObject::isDescendantOfObject const): MOved to AXCoreObject. 15 (WebCore::AccessibilityObject::isAncestorOfObject const): Moved to AXCoreObject. 16 * accessibility/AccessibilityObject.h: 17 * accessibility/AccessibilityObjectInterface.h: 18 (WebCore::AXCoreObject::isDescendantOfObject const): 19 (WebCore::AXCoreObject::isAncestorOfObject const): 20 * accessibility/isolatedtree/AXIsolatedObject.cpp: 21 (WebCore::AXIsolatedObject::initializeAttributeData): Sets the HasChildren attribute. 22 (WebCore::AXIsolatedObject::hasChildren const): Deleted. 23 (WebCore::AXIsolatedObject::isDescendantOfObject const): Deleted. 24 (WebCore::AXIsolatedObject::isAncestorOfObject const): Deleted. 25 * accessibility/isolatedtree/AXIsolatedObject.h: 26 1 27 2020-02-14 Andres Gonzalez <andresg_22@apple.com> 2 28 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r255839 r256631 2115 2115 return AccessibilityOrientation::Undefined; 2116 2116 } 2117 2118 bool AccessibilityObject::isDescendantOfObject(const AXCoreObject* axObject) const2119 {2120 if (!axObject || !axObject->hasChildren())2121 return false;2122 2123 return Accessibility::findAncestor<AccessibilityObject>(*this, false, [axObject] (const AccessibilityObject& object) {2124 return &object == axObject;2125 }) != nullptr;2126 }2127 2128 bool AccessibilityObject::isAncestorOfObject(const AXCoreObject* axObject) const2129 {2130 if (!axObject)2131 return false;2132 2133 return this == axObject || axObject->isDescendantOfObject(this);2134 }2135 2117 2136 2118 AccessibilityObject* AccessibilityObject::firstAnonymousBlockChild() const -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r255899 r256631 485 485 void handleActiveDescendantChanged() override { } 486 486 void handleAriaExpandedChanged() override { } 487 bool isDescendantOfObject(const AXCoreObject*) const override;488 bool isAncestorOfObject(const AXCoreObject*) const override;489 487 AccessibilityObject* firstAnonymousBlockChild() const override; 490 488 -
trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h
r256442 r256631 889 889 virtual void handleActiveDescendantChanged() = 0; 890 890 virtual void handleAriaExpandedChanged() = 0; 891 virtual bool isDescendantOfObject(const AXCoreObject*) const = 0;892 virtual bool isAncestorOfObject(const AXCoreObject*) const = 0;891 bool isDescendantOfObject(const AXCoreObject*) const; 892 bool isAncestorOfObject(const AXCoreObject*) const; 893 893 virtual AXCoreObject* firstAnonymousBlockChild() const = 0; 894 894 … … 1223 1223 } // namespace Accessibility 1224 1224 1225 inline bool AXCoreObject::isDescendantOfObject(const AXCoreObject* axObject) const 1226 { 1227 return axObject && axObject->hasChildren() 1228 && Accessibility::findAncestor<AXCoreObject>(*this, false, [axObject] (const AXCoreObject& object) { 1229 return &object == axObject; 1230 }) != nullptr; 1231 } 1232 1233 inline bool AXCoreObject::isAncestorOfObject(const AXCoreObject* axObject) const 1234 { 1235 return axObject && (this == axObject || axObject->isDescendantOfObject(this)); 1236 } 1237 1225 1238 } // namespace WebCore -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
r256630 r256631 156 156 setProperty(AXPropertyName::EstimatedLoadingProgress, object.estimatedLoadingProgress()); 157 157 setProperty(AXPropertyName::SupportsARIAOwns, object.supportsARIAOwns()); 158 setProperty(AXPropertyName::HasChildren, object.hasChildren()); 158 159 setProperty(AXPropertyName::HasPopup, object.hasPopup()); 159 160 setProperty(AXPropertyName::PopupValue, object.popupValue()); … … 1574 1575 } 1575 1576 1576 bool AXIsolatedObject::hasChildren() const1577 {1578 ASSERT_NOT_REACHED();1579 return false;1580 }1581 1582 1577 void AXIsolatedObject::setNeedsToUpdateChildren() 1583 1578 { … … 1623 1618 } 1624 1619 1625 bool AXIsolatedObject::isDescendantOfObject(const AXCoreObject*) const1626 {1627 ASSERT_NOT_REACHED();1628 return false;1629 }1630 1631 bool AXIsolatedObject::isAncestorOfObject(const AXCoreObject*) const1632 {1633 ASSERT_NOT_REACHED();1634 return false;1635 }1636 1637 1620 AXCoreObject* AXIsolatedObject::firstAnonymousBlockChild() const 1638 1621 { -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
r256630 r256631 133 133 FocusableAncestor, 134 134 HasARIAValueNow, 135 HasChildren, 135 136 HasPopup, 136 137 HeadingLevel, … … 772 773 bool shouldIgnoreAttributeRole() const override; 773 774 bool canHaveChildren() const override; 774 bool hasChildren() const override ;775 bool hasChildren() const override { return boolAttributeValue(AXPropertyName::HasChildren); } 775 776 void setNeedsToUpdateChildren() override; 776 777 void setNeedsToUpdateSubtree() override; … … 782 783 void handleActiveDescendantChanged() override; 783 784 void handleAriaExpandedChanged() override; 784 bool isDescendantOfObject(const AXCoreObject*) const override;785 bool isAncestorOfObject(const AXCoreObject*) const override;786 785 AXCoreObject* firstAnonymousBlockChild() const override; 787 786 bool hasAttribute(const QualifiedName&) const override;
Note: See TracChangeset
for help on using the changeset viewer.