Changeset 252182 in webkit
- Timestamp:
- Nov 7, 2019 6:15:45 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r252181 r252182 1 2019-11-07 Andres Gonzalez <andresg_22@apple.com> 2 3 Rename AXIsolatedTreeNode to AXIsolatedObject for consistency with AXCoreObject and AccessibilityObject. 4 https://bugs.webkit.org/show_bug.cgi?id=203913 5 6 Reviewed by Chris Fleizach. 7 8 No new tests needed, no new functionality. 9 10 - Renamed AXIsolatedTreeNode as AXIsolatedObject. 11 - This makes the naming consistent with AXCoreObject and AccessibilityObject. 12 - Some code cleanup in WebAccessibilityObjectWrapperBase.h. 13 14 * accessibility/AXObjectCache.cpp: 15 (WebCore::AXObjectCache::createIsolatedAccessibilityTreeHierarchy): 16 (WebCore::AXObjectCache::generateIsolatedAccessibilityTree): 17 * accessibility/AXObjectCache.h: 18 * accessibility/isolatedtree/AXIsolatedTree.cpp: 19 (WebCore::AXIsolatedTree::nodeInTreeForID): 20 (WebCore::AXIsolatedTree::nodeForID const): 21 (WebCore::AXIsolatedTree::focusedUIElement): 22 (WebCore::AXIsolatedTree::rootNode): 23 (WebCore::AXIsolatedTree::setRoot): 24 (WebCore::AXIsolatedTree::appendNodeChanges): 25 (WebCore::AXIsolatedTree::applyPendingChanges): 26 * accessibility/isolatedtree/AXIsolatedTree.h: 27 * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: 28 (WebCore::AXIsolatedObject::AXIsolatedObject): 29 (WebCore::AXIsolatedObject::create): 30 (WebCore::AXIsolatedObject::initializeAttributeData): 31 (WebCore::AXIsolatedObject::setProperty): 32 (WebCore::AXIsolatedObject::appendChild): 33 (WebCore::AXIsolatedObject::setParent): 34 (WebCore::AXIsolatedObject::setTreeIdentifier): 35 (WebCore::AXIsolatedObject::children): 36 (WebCore::AXIsolatedObject::focusedUIElement const): 37 (WebCore::AXIsolatedObject::parentObjectUnignored const): 38 (WebCore::AXIsolatedObject::accessibilityHitTest const): 39 (WebCore::AXIsolatedObject::tree const): 40 (WebCore::AXIsolatedObject::rectAttributeValue const): 41 (WebCore::AXIsolatedObject::doubleAttributeValue const): 42 (WebCore::AXIsolatedObject::unsignedAttributeValue const): 43 (WebCore::AXIsolatedObject::boolAttributeValue const): 44 (WebCore::AXIsolatedObject::stringAttributeValue const): 45 (WebCore::AXIsolatedObject::intAttributeValue const): 46 (WebCore::AXIsolatedObject::updateBackingStore): 47 (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode): Deleted. 48 (WebCore::AXIsolatedTreeNode::create): Deleted. 49 (WebCore::AXIsolatedTreeNode::initializeAttributeData): Deleted. 50 (WebCore::AXIsolatedTreeNode::setProperty): Deleted. 51 (WebCore::AXIsolatedTreeNode::appendChild): Deleted. 52 (WebCore::AXIsolatedTreeNode::setParent): Deleted. 53 (WebCore::AXIsolatedTreeNode::setTreeIdentifier): Deleted. 54 (WebCore::AXIsolatedTreeNode::children): Deleted. 55 (WebCore::AXIsolatedTreeNode::focusedUIElement const): Deleted. 56 (WebCore::AXIsolatedTreeNode::parentObjectUnignored const): Deleted. 57 (WebCore::AXIsolatedTreeNode::accessibilityHitTest const): Deleted. 58 (WebCore::AXIsolatedTreeNode::tree const): Deleted. 59 (WebCore::AXIsolatedTreeNode::rectAttributeValue const): Deleted. 60 (WebCore::AXIsolatedTreeNode::doubleAttributeValue const): Deleted. 61 (WebCore::AXIsolatedTreeNode::unsignedAttributeValue const): Deleted. 62 (WebCore::AXIsolatedTreeNode::boolAttributeValue const): Deleted. 63 (WebCore::AXIsolatedTreeNode::stringAttributeValue const): Deleted. 64 (WebCore::AXIsolatedTreeNode::intAttributeValue const): Deleted. 65 (WebCore::AXIsolatedTreeNode::updateBackingStore): Deleted. 66 * accessibility/isolatedtree/AXIsolatedTreeNode.h: 67 * accessibility/mac/WebAccessibilityObjectWrapperBase.h: 68 1 69 2019-11-07 Andres Gonzalez <andresg_22@apple.com> 2 70 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r251974 r252182 2944 2944 2945 2945 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) 2946 Ref<AXIsolated TreeNode> AXObjectCache::createIsolatedAccessibilityTreeHierarchy(AXCoreObject& object, AXID parentID, AXIsolatedTree& tree, Vector<Ref<AXIsolatedTreeNode>>& nodeChanges)2947 { 2948 auto isolatedTreeNode = AXIsolated TreeNode::create(object);2946 Ref<AXIsolatedObject> AXObjectCache::createIsolatedAccessibilityTreeHierarchy(AXCoreObject& object, AXID parentID, AXIsolatedTree& tree, Vector<Ref<AXIsolatedObject>>& nodeChanges) 2947 { 2948 auto isolatedTreeNode = AXIsolatedObject::create(object); 2949 2949 nodeChanges.append(isolatedTreeNode.copyRef()); 2950 2950 … … 2969 2969 tree = AXIsolatedTree::createTreeForPageID(*m_document.pageID()); 2970 2970 2971 Vector<Ref<AXIsolated TreeNode>> nodeChanges;2971 Vector<Ref<AXIsolatedObject>> nodeChanges; 2972 2972 auto root = createIsolatedAccessibilityTreeHierarchy(*rootObject(), InvalidAXID, *tree, nodeChanges); 2973 2973 tree->setRoot(root); -
trunk/Source/WebCore/accessibility/AXObjectCache.h
r251974 r252182 48 48 49 49 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) 50 class AXIsolated TreeNode;50 class AXIsolatedObject; 51 51 #endif 52 52 class Document; … … 195 195 WEBCORE_EXPORT Ref<AXIsolatedTree> generateIsolatedAccessibilityTree(); 196 196 197 Ref<AXIsolated TreeNode> createIsolatedAccessibilityTreeHierarchy(AXCoreObject&, AXID, AXIsolatedTree&, Vector<Ref<AXIsolatedTreeNode>>&);197 Ref<AXIsolatedObject> createIsolatedAccessibilityTreeHierarchy(AXCoreObject&, AXID, AXIsolatedTree&, Vector<Ref<AXIsolatedObject>>&); 198 198 #endif 199 199 -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
r251974 r252182 68 68 } 69 69 70 RefPtr<AXIsolated TreeNode> AXIsolatedTree::nodeInTreeForID(AXIsolatedTreeID treeID, AXID axID)70 RefPtr<AXIsolatedObject> AXIsolatedTree::nodeInTreeForID(AXIsolatedTreeID treeID, AXID axID) 71 71 { 72 72 return treeForID(treeID)->nodeForID(axID); … … 98 98 } 99 99 100 RefPtr<AXIsolated TreeNode> AXIsolatedTree::nodeForID(AXID axID) const100 RefPtr<AXIsolatedObject> AXIsolatedTree::nodeForID(AXID axID) const 101 101 { 102 102 if (!axID) … … 105 105 } 106 106 107 RefPtr<AXIsolated TreeNode> AXIsolatedTree::focusedUIElement()107 RefPtr<AXIsolatedObject> AXIsolatedTree::focusedUIElement() 108 108 { 109 109 return nodeForID(m_focusedNodeID); 110 110 } 111 111 112 RefPtr<AXIsolated TreeNode> AXIsolatedTree::rootNode()112 RefPtr<AXIsolatedObject> AXIsolatedTree::rootNode() 113 113 { 114 114 return nodeForID(m_rootNodeID); 115 115 } 116 116 117 void AXIsolatedTree::setRoot(Ref<AXIsolated TreeNode>& root)117 void AXIsolatedTree::setRoot(Ref<AXIsolatedObject>& root) 118 118 { 119 119 LockHolder locker { m_changeLogLock }; … … 134 134 } 135 135 136 void AXIsolatedTree::appendNodeChanges(Vector<Ref<AXIsolated TreeNode>>& log)136 void AXIsolatedTree::appendNodeChanges(Vector<Ref<AXIsolatedObject>>& log) 137 137 { 138 138 LockHolder locker { m_changeLogLock }; … … 145 145 RELEASE_ASSERT(!isMainThread()); 146 146 LockHolder locker { m_changeLogLock }; 147 Vector<Ref<AXIsolated TreeNode>> appendCopy;147 Vector<Ref<AXIsolatedObject>> appendCopy; 148 148 std::swap(appendCopy, m_pendingAppends); 149 149 Vector<AXID> removeCopy({ WTFMove(m_pendingRemovals) }); -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h
r251974 r252182 49 49 WEBCORE_EXPORT static RefPtr<AXIsolatedTree> treeForID(AXIsolatedTreeID); 50 50 51 WEBCORE_EXPORT RefPtr<AXIsolated TreeNode> rootNode();52 WEBCORE_EXPORT RefPtr<AXIsolated TreeNode> focusedUIElement();53 RefPtr<AXIsolated TreeNode> nodeForID(AXID) const;54 static RefPtr<AXIsolated TreeNode> nodeInTreeForID(AXIsolatedTreeID, AXID);51 WEBCORE_EXPORT RefPtr<AXIsolatedObject> rootNode(); 52 WEBCORE_EXPORT RefPtr<AXIsolatedObject> focusedUIElement(); 53 RefPtr<AXIsolatedObject> nodeForID(AXID) const; 54 static RefPtr<AXIsolatedObject> nodeInTreeForID(AXIsolatedTreeID, AXID); 55 55 56 56 // Call on main thread 57 void appendNodeChanges(Vector<Ref<AXIsolated TreeNode>>&);57 void appendNodeChanges(Vector<Ref<AXIsolatedObject>>&); 58 58 void removeNode(AXID); 59 59 60 void setRoot(Ref<AXIsolated TreeNode>&);60 void setRoot(Ref<AXIsolatedObject>&); 61 61 void setFocusedNodeID(AXID); 62 62 … … 73 73 74 74 // Only access on AX thread requesting data. 75 HashMap<AXID, Ref<AXIsolated TreeNode>> m_readerThreadNodeMap;75 HashMap<AXID, Ref<AXIsolatedObject>> m_readerThreadNodeMap; 76 76 77 77 // Written to by main thread under lock, accessed and applied by AX thread. 78 Vector<Ref<AXIsolated TreeNode>> m_pendingAppends;78 Vector<Ref<AXIsolatedObject>> m_pendingAppends; 79 79 Vector<AXID> m_pendingRemovals; 80 80 AXID m_pendingFocusedNodeID; -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp
r252181 r252182 35 35 namespace WebCore { 36 36 37 AXIsolated TreeNode::AXIsolatedTreeNode(const AXCoreObject& object)37 AXIsolatedObject::AXIsolatedObject(const AXCoreObject& object) 38 38 : m_id(object.objectID()) 39 39 { … … 45 45 } 46 46 47 Ref<AXIsolated TreeNode> AXIsolatedTreeNode::create(const AXCoreObject& object)48 { 49 return adoptRef(*new AXIsolated TreeNode(object));50 } 51 52 AXIsolated TreeNode::~AXIsolatedTreeNode() = default;53 54 void AXIsolated TreeNode::initializeAttributeData(const AXCoreObject& object)47 Ref<AXIsolatedObject> AXIsolatedObject::create(const AXCoreObject& object) 48 { 49 return adoptRef(*new AXIsolatedObject(object)); 50 } 51 52 AXIsolatedObject::~AXIsolatedObject() = default; 53 54 void AXIsolatedObject::initializeAttributeData(const AXCoreObject& object) 55 55 { 56 56 setProperty(AXPropertyName::RoleValue, static_cast<int>(object.roleValue())); … … 74 74 } 75 75 76 void AXIsolated TreeNode::setProperty(AXPropertyName propertyName, AttributeValueVariant&& value, bool shouldRemove)76 void AXIsolatedObject::setProperty(AXPropertyName propertyName, AttributeValueVariant&& value, bool shouldRemove) 77 77 { 78 78 ASSERT(!m_initialized); … … 85 85 } 86 86 87 void AXIsolated TreeNode::appendChild(AXID axID)87 void AXIsolatedObject::appendChild(AXID axID) 88 88 { 89 89 ASSERT(isMainThread()); … … 91 91 } 92 92 93 void AXIsolated TreeNode::setParent(AXID parent)93 void AXIsolatedObject::setParent(AXID parent) 94 94 { 95 95 ASSERT(isMainThread()); … … 97 97 } 98 98 99 void AXIsolated TreeNode::setTreeIdentifier(AXIsolatedTreeID treeIdentifier)99 void AXIsolatedObject::setTreeIdentifier(AXIsolatedTreeID treeIdentifier) 100 100 { 101 101 m_treeIdentifier = treeIdentifier; … … 104 104 } 105 105 106 const AXCoreObject::AccessibilityChildrenVector& AXIsolated TreeNode::children(bool)106 const AXCoreObject::AccessibilityChildrenVector& AXIsolatedObject::children(bool) 107 107 { 108 108 if (_AXUIElementRequestServicedBySecondaryAXThread()) { … … 116 116 } 117 117 118 AXCoreObject* AXIsolated TreeNode::focusedUIElement() const118 AXCoreObject* AXIsolatedObject::focusedUIElement() const 119 119 { 120 120 if (auto focusedElement = tree()->focusedUIElement()) … … 123 123 } 124 124 125 AXCoreObject* AXIsolated TreeNode::parentObjectUnignored() const125 AXCoreObject* AXIsolatedObject::parentObjectUnignored() const 126 126 { 127 127 return tree()->nodeForID(parent()).get(); 128 128 } 129 129 130 AXCoreObject* AXIsolated TreeNode::accessibilityHitTest(const IntPoint& point) const130 AXCoreObject* AXIsolatedObject::accessibilityHitTest(const IntPoint& point) const 131 131 { 132 132 if (!relativeFrame().contains(point)) … … 138 138 return child->accessibilityHitTest(point); 139 139 } 140 return const_cast<AXIsolated TreeNode*>(this);141 } 142 143 AXIsolatedTree* AXIsolated TreeNode::tree() const140 return const_cast<AXIsolatedObject*>(this); 141 } 142 143 AXIsolatedTree* AXIsolatedObject::tree() const 144 144 { 145 145 return m_cachedTree.get(); 146 146 } 147 147 148 FloatRect AXIsolated TreeNode::rectAttributeValue(AXPropertyName propertyName) const148 FloatRect AXIsolatedObject::rectAttributeValue(AXPropertyName propertyName) const 149 149 { 150 150 auto value = m_attributeMap.get(propertyName); … … 159 159 } 160 160 161 double AXIsolated TreeNode::doubleAttributeValue(AXPropertyName propertyName) const161 double AXIsolatedObject::doubleAttributeValue(AXPropertyName propertyName) const 162 162 { 163 163 auto value = m_attributeMap.get(propertyName); … … 168 168 } 169 169 170 unsigned AXIsolated TreeNode::unsignedAttributeValue(AXPropertyName propertyName) const170 unsigned AXIsolatedObject::unsignedAttributeValue(AXPropertyName propertyName) const 171 171 { 172 172 auto value = m_attributeMap.get(propertyName); … … 177 177 } 178 178 179 bool AXIsolated TreeNode::boolAttributeValue(AXPropertyName propertyName) const179 bool AXIsolatedObject::boolAttributeValue(AXPropertyName propertyName) const 180 180 { 181 181 auto value = m_attributeMap.get(propertyName); … … 186 186 } 187 187 188 const String AXIsolated TreeNode::stringAttributeValue(AXPropertyName propertyName) const188 const String AXIsolatedObject::stringAttributeValue(AXPropertyName propertyName) const 189 189 { 190 190 auto value = m_attributeMap.get(propertyName); … … 195 195 } 196 196 197 int AXIsolated TreeNode::intAttributeValue(AXPropertyName propertyName) const197 int AXIsolatedObject::intAttributeValue(AXPropertyName propertyName) const 198 198 { 199 199 auto value = m_attributeMap.get(propertyName); … … 204 204 } 205 205 206 void AXIsolated TreeNode::updateBackingStore()206 void AXIsolatedObject::updateBackingStore() 207 207 { 208 208 if (_AXUIElementRequestServicedBySecondaryAXThread()) { -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h
r252181 r252182 46 46 class AXIsolatedTree; 47 47 48 class AXIsolated TreeNodefinal : public AXCoreObject {48 class AXIsolatedObject final : public AXCoreObject { 49 49 public: 50 static Ref<AXIsolated TreeNode> create(const AXCoreObject&);51 ~AXIsolated TreeNode();50 static Ref<AXIsolatedObject> create(const AXCoreObject&); 51 ~AXIsolatedObject(); 52 52 53 53 void setObjectID(AXID id) override { m_id = id; } … … 666 666 AXIsolatedTree* tree() const; 667 667 668 AXIsolated TreeNode() = default;669 AXIsolated TreeNode(const AXCoreObject&);668 AXIsolatedObject() = default; 669 AXIsolatedObject(const AXCoreObject&); 670 670 void initializeAttributeData(const AXCoreObject&); 671 671 -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h
r251974 r252182 30 30 #define WebAccessibilityObjectWrapperBase_h 31 31 32 #include "AXIsolatedTree.h" 33 #include "AXIsolatedTreeNode.h" 34 #include "AccessibilityObject.h" 32 #include "AccessibilityObjectInterface.h" 35 33 #include <CoreGraphics/CoreGraphics.h> 36 34 #include <wtf/RefPtr.h> … … 39 37 40 38 namespace WebCore { 41 class AccessibilityObject;42 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)43 class AXIsolatedTreeNode;44 #endif45 39 struct AccessibilitySearchCriteria; 46 40 class IntRect; … … 58 52 - (id)initWithAccessibilityObject:(WebCore::AXCoreObject*)axObject; 59 53 60 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)61 @property (nonatomic, readonly) RefPtr<WebCore::AXIsolatedTreeNode> isolatedTreeNode;62 @property (nonatomic, assign) WebCore::AXIsolatedTreeID isolatedTreeIdentifier;63 #endif64 65 54 - (void)detach; 66 55 … … 70 59 - (BOOL)updateObjectBackingStore; 71 60 72 // This can be either an AccessibilityObject or an AXIsolated TreeNode61 // This can be either an AccessibilityObject or an AXIsolatedObject 73 62 - (WebCore::AXCoreObject*)axBackingObject; 74 63 … … 97 86 extern WebCore::AccessibilitySearchCriteria accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute(const NSDictionary *); 98 87 99 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) 100 extern NSArray *convertToNSArray(const Vector<RefPtr<WebCore::AXIsolatedTreeNode>>&); 101 #endif 102 extern NSArray *convertToNSArray(const WebCore::AccessibilityObject::AccessibilityChildrenVector&); 88 extern NSArray *convertToNSArray(const WebCore::AXCoreObject::AccessibilityChildrenVector&); 103 89 104 90 #if PLATFORM(IOS_FAMILY)
Note: See TracChangeset
for help on using the changeset viewer.