AXIsolatedObject support for lists (l, ul, ol, dl).
authorandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jan 2020 22:28:52 +0000 (22:28 +0000)
committerandresg_22@apple.com <andresg_22@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jan 2020 22:28:52 +0000 (22:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=205874

Reviewed by Chris Fleizach.

- AXIsolatedObject implementation of isUnordered/Ordered/descriptionList.
- Client code doesn't downcast to AccessibilityList any longer,
but instead uses these methods that are exposed through AXCoreObject.

* accessibility/AccessibilityList.h:
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
* accessibility/isolatedtree/AXIsolatedTreeNode.h:
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::rolePlatformDescription const):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper subrole]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254158 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityList.h
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityObjectInterface.h
Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp
Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h
Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

index 9d89808..dd67971 100644 (file)
@@ -1,3 +1,25 @@
+2020-01-07  Andres Gonzalez  <andresg_22@apple.com>
+
+        AXIsolatedObject support for lists (l, ul, ol, dl).
+        https://bugs.webkit.org/show_bug.cgi?id=205874
+
+        Reviewed by Chris Fleizach.
+
+        - AXIsolatedObject implementation of isUnordered/Ordered/descriptionList.
+        - Client code doesn't downcast to AccessibilityList any longer,
+        but instead uses these methods that are exposed through AXCoreObject.
+
+        * accessibility/AccessibilityList.h:
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityObjectInterface.h:
+        * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
+        (WebCore::AXIsolatedObject::initializeAttributeData):
+        * accessibility/isolatedtree/AXIsolatedTreeNode.h:
+        * accessibility/mac/AccessibilityObjectMac.mm:
+        (WebCore::AccessibilityObject::rolePlatformDescription const):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper subrole]):
+
 2020-01-07  Sihui Liu  <sihui_liu@apple.com>
 
         Add a move constructor to IDBResultData
index 908979f..0a7e0aa 100644 (file)
@@ -36,16 +36,15 @@ class AccessibilityList final : public AccessibilityRenderObject {
 public:
     static Ref<AccessibilityList> create(RenderObject*);
     virtual ~AccessibilityList();
-    
-    bool isUnorderedList() const;
-    bool isOrderedList() const;
-    bool isDescriptionList() const;
 
     AccessibilityRole roleValue() const override;
-
 private:
     explicit AccessibilityList(RenderObject*);
     bool isList() const override { return true; }
+    bool isUnorderedList() const override;
+    bool isOrderedList() const override;
+    bool isDescriptionList() const override;
+
     bool computeAccessibilityIsIgnored() const override;
     AccessibilityRole determineAccessibilityRole() override;
     bool childHasPseudoVisibleListItemMarkers(RenderObject*);
index 06fe312..386bf03 100644 (file)
@@ -148,7 +148,12 @@ public:
     bool isInputSlider() const override { return false; }
     bool isControl() const override { return false; }
     bool isLabel() const override { return false; }
+
     bool isList() const override { return false; }
+    bool isUnorderedList() const override { return false; }
+    bool isOrderedList() const override { return false; }
+    bool isDescriptionList() const override { return false; }
+
     bool isTable() const override { return false; }
     bool isDataTable() const override { return false; }
     bool isTableRow() const override { return false; }
index 420508d..61bb9c9 100644 (file)
@@ -523,7 +523,12 @@ public:
     virtual bool isInputSlider() const = 0;
     virtual bool isControl() const = 0;
     virtual bool isLabel() const = 0;
+    // lists support (l, ul, ol, dl)
     virtual bool isList() const = 0;
+    virtual bool isUnorderedList() const = 0;
+    virtual bool isOrderedList() const = 0;
+    virtual bool isDescriptionList() const = 0;
+
     virtual bool isTable() const = 0;
     virtual bool isDataTable() const = 0;
     virtual bool isTableRow() const = 0;
index cc3da90..f19d831 100644 (file)
@@ -78,6 +78,9 @@ void AXIsolatedObject::initializeAttributeData(AXCoreObject& object, bool isRoot
     setProperty(AXPropertyName::IsSlider, object.isSlider());
     setProperty(AXPropertyName::IsControl, object.isControl());
     setProperty(AXPropertyName::IsList, object.isList());
+    setProperty(AXPropertyName::IsUnorderedList, object.isUnorderedList());
+    setProperty(AXPropertyName::IsOrderedList, object.isOrderedList());
+    setProperty(AXPropertyName::IsDescriptionList, object.isDescriptionList());
     setProperty(AXPropertyName::IsTableRow, object.isTableRow());
     setProperty(AXPropertyName::IsTableColumn, object.isTableColumn());
     setProperty(AXPropertyName::IsTableCell, object.isTableCell());
index 7e689f0..1628787 100644 (file)
@@ -147,6 +147,7 @@ private:
         IsChecked,
         IsCollapsed,
         IsControl,
+        IsDescriptionList,
         IsEnabled,
         IsExpanded,
         IsFieldset,
@@ -200,6 +201,7 @@ private:
         IsMultiSelectable,
         IsOffScreen,
         IsOnScreen,
+        IsOrderedList,
         IsOutput,
         IsPasswordField,
         IsPressed,
@@ -219,6 +221,7 @@ private:
         IsTextControl,
         IsTree,
         IsTreeItem,
+        IsUnorderedList,
         IsUnvisited,
         IsValueAutofilled,
         IsValueAutofillAvailable,
@@ -347,7 +350,12 @@ private:
     bool isProgressIndicator() const override { return boolAttributeValue(AXPropertyName::IsProgressIndicator); }
     bool isSlider() const override { return boolAttributeValue(AXPropertyName::IsSlider); }
     bool isControl() const override { return boolAttributeValue(AXPropertyName::IsControl); }
+
     bool isList() const override { return boolAttributeValue(AXPropertyName::IsList); }
+    bool isUnorderedList() const override { return boolAttributeValue(AXPropertyName::IsUnorderedList); }
+    bool isOrderedList() const override { return boolAttributeValue(AXPropertyName::IsOrderedList); }
+    bool isDescriptionList() const override { return boolAttributeValue(AXPropertyName::IsDescriptionList); }
+
     bool isTable() const override { return false; }
     bool isTableRow() const override { return boolAttributeValue(AXPropertyName::IsTableRow); }
     bool isTableColumn() const override { return boolAttributeValue(AXPropertyName::IsTableColumn); }
index b98f609..7f8d470 100644 (file)
@@ -237,10 +237,8 @@ String AccessibilityObject::rolePlatformDescription() const
 
     // Only returning for DL (not UL or OL) because description changed with HTML5 from 'definition list' to
     // superset 'description list' and does not return the same values in AX API on some OS versions.
-    if (is<AccessibilityList>(*this)) {
-        if (downcast<AccessibilityList>(*this).isDescriptionList())
-            return AXDescriptionListText();
-    }
+    if (isDescriptionList())
+        return AXDescriptionListText();
 
     if (role == AccessibilityRole::HorizontalRule)
         return AXHorizontalRuleDescriptionText();
index b399e67..5dcb450 100644 (file)
@@ -2089,16 +2089,15 @@ ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     
     if (m_object->isFieldset())
         return @"AXFieldset";
-    
-    if (is<AccessibilityList>(*m_object)) {
-        auto& listObject = downcast<AccessibilityList>(*m_object);
-        if (listObject.isUnorderedList() || listObject.isOrderedList())
+
+    if (m_object->isList()) {
+        if (m_object->isUnorderedList() || m_object->isOrderedList())
             return NSAccessibilityContentListSubrole;
-        if (listObject.isDescriptionList()) {
+        if (m_object->isDescriptionList()) {
             return NSAccessibilityDescriptionListSubrole;
         }
     }
-    
+
     // ARIA content subroles.
     switch (role) {
     case AccessibilityRole::LandmarkBanner: