Title: [261487] trunk/Source/WebCore
Revision
261487
Author
andresg...@apple.com
Date
2020-05-11 12:37:14 -0700 (Mon, 11 May 2020)

Log Message

Add implementation  for AXIsolatedObject::elementPath, hasHighlighting, isBlockquote, isKeyboardFocusable.
https://bugs.webkit.org/show_bug.cgi?id=211732

Reviewed by Chris Fleizach.

Covered by several tests.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isBlockquote const): Moved to base class.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
(WebCore::AXCoreObject::isBlockquote const):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData): Cache the above mentioned properties.
(WebCore::AXIsolatedObject::pathAttributeValue const):
(WebCore::AXIsolatedObject::isBlockquote const): Moved to base class.
(WebCore::AXIsolatedObject::isKeyboardFocusable const): Implemented inline in header.
(WebCore::AXIsolatedObject::hasHighlighting const): Implemented inline in header.
(WebCore::AXIsolatedObject::elementPath const): Implemented inline in header.
* accessibility/isolatedtree/AXIsolatedObject.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (261486 => 261487)


--- trunk/Source/WebCore/ChangeLog	2020-05-11 19:05:00 UTC (rev 261486)
+++ trunk/Source/WebCore/ChangeLog	2020-05-11 19:37:14 UTC (rev 261487)
@@ -1,3 +1,26 @@
+2020-05-11  Andres Gonzalez  <andresg...@apple.com>
+
+        Add implementation  for AXIsolatedObject::elementPath, hasHighlighting, isBlockquote, isKeyboardFocusable.
+        https://bugs.webkit.org/show_bug.cgi?id=211732
+
+        Reviewed by Chris Fleizach.
+
+        Covered by several tests.
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::isBlockquote const): Moved to base class.
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityObjectInterface.h:
+        (WebCore::AXCoreObject::isBlockquote const):
+        * accessibility/isolatedtree/AXIsolatedObject.cpp:
+        (WebCore::AXIsolatedObject::initializeAttributeData): Cache the above mentioned properties.
+        (WebCore::AXIsolatedObject::pathAttributeValue const):
+        (WebCore::AXIsolatedObject::isBlockquote const): Moved to base class.
+        (WebCore::AXIsolatedObject::isKeyboardFocusable const): Implemented inline in header.
+        (WebCore::AXIsolatedObject::hasHighlighting const): Implemented inline in header.
+        (WebCore::AXIsolatedObject::elementPath const): Implemented inline in header.
+        * accessibility/isolatedtree/AXIsolatedObject.h:
+
 2020-05-11  Alex Christensen  <achristen...@webkit.org>
 
         Fix assertion after r261414

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (261486 => 261487)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2020-05-11 19:05:00 UTC (rev 261486)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2020-05-11 19:37:14 UTC (rev 261487)
@@ -200,11 +200,6 @@
     return String();
 }
 
-bool AccessibilityObject::isBlockquote() const
-{
-    return roleValue() == AccessibilityRole::Blockquote;
-}
-
 bool AccessibilityObject::isTextControl() const
 {
     switch (roleValue()) {

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (261486 => 261487)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.h	2020-05-11 19:05:00 UTC (rev 261486)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h	2020-05-11 19:37:14 UTC (rev 261487)
@@ -195,7 +195,6 @@
     bool isARIATextControl() const override;
     bool isNonNativeTextControl() const override;
     bool isButton() const override;
-    bool isBlockquote() const override;
     bool isLandmark() const override;
     bool isRangeControl() const override;
     bool isMeter() const override;

Modified: trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h (261486 => 261487)


--- trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h	2020-05-11 19:05:00 UTC (rev 261486)
+++ trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h	2020-05-11 19:37:14 UTC (rev 261487)
@@ -621,8 +621,8 @@
     bool isSplitter() const { return roleValue() == AccessibilityRole::Splitter; }
     bool isToolbar() const { return roleValue() == AccessibilityRole::Toolbar; }
     bool isSummary() const { return roleValue() == AccessibilityRole::Summary; }
+    bool isBlockquote() const { return roleValue() == AccessibilityRole::Blockquote; }
 
-    virtual bool isBlockquote() const = 0;
     virtual bool isLandmark() const = 0;
     virtual bool isRangeControl() const = 0;
     virtual bool isMeter() const = 0;

Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp (261486 => 261487)


--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp	2020-05-11 19:05:00 UTC (rev 261486)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp	2020-05-11 19:37:14 UTC (rev 261487)
@@ -216,7 +216,10 @@
     setProperty(AXPropertyName::LiveRegionStatus, object.liveRegionStatus());
     setProperty(AXPropertyName::LiveRegionRelevant, object.liveRegionRelevant());
     setProperty(AXPropertyName::LiveRegionAtomic, object.liveRegionAtomic());
-
+    setProperty(AXPropertyName::Path, object.elementPath());
+    setProperty(AXPropertyName::HasHighlighting, object.hasHighlighting());
+    setProperty(AXPropertyName::IsKeyboardFocusable, object.isKeyboardFocusable());
+    
     if (object.isTable()) {
         setProperty(AXPropertyName::IsTable, true);
         setProperty(AXPropertyName::IsExposable, object.isExposable());
@@ -786,6 +789,15 @@
     );
 }
 
+Path AXIsolatedObject::pathAttributeValue(AXPropertyName propertyName) const
+{
+    auto value = m_attributeMap.get(propertyName);
+    return WTF::switchOn(value,
+        [] (Path& typedValue) { return typedValue; },
+        [] (auto&) { return Path(); }
+    );
+}
+
 Color AXIsolatedObject::colorAttributeValue(AXPropertyName propertyName) const
 {
     auto value = m_attributeMap.get(propertyName);
@@ -1106,12 +1118,6 @@
     return false;
 }
 
-bool AXIsolatedObject::isBlockquote() const
-{
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
 bool AXIsolatedObject::isFigureElement() const
 {
     ASSERT_NOT_REACHED();
@@ -1118,12 +1124,6 @@
     return false;
 }
 
-bool AXIsolatedObject::isKeyboardFocusable() const
-{
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
 bool AXIsolatedObject::isHovered() const
 {
     ASSERT_NOT_REACHED();
@@ -1232,12 +1232,6 @@
     return false;
 }
 
-bool AXIsolatedObject::hasHighlighting() const
-{
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
 Element* AXIsolatedObject::element() const
 {
     ASSERT_NOT_REACHED();
@@ -1544,12 +1538,6 @@
     return nullptr;
 }
 
-Path AXIsolatedObject::elementPath() const
-{
-    ASSERT_NOT_REACHED();
-    return Path();
-}
-
 TextIteratorBehavior AXIsolatedObject::textIteratorBehaviorForTextRange() const
 {
     ASSERT_NOT_REACHED();

Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h (261486 => 261487)


--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h	2020-05-11 19:05:00 UTC (rev 261486)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h	2020-05-11 19:37:14 UTC (rev 261487)
@@ -148,6 +148,7 @@
         HasARIAValueNow,
         HasApplePDFAnnotationAttribute,
         HasChildren,
+        HasHighlighting,
         HasPopup,
         HeaderContainer,
         HeadingLevel,
@@ -187,6 +188,7 @@
         IsInsideLiveRegion,
         IsHeading,
         IsHovered,
+        IsKeyboardFocusable,
         IsLandmark,
         IsLink,
         IsLinked,
@@ -276,6 +278,7 @@
         MaxValueForRange,
         MinValueForRange,
         Orientation,
+        Path,
         PlaceholderValue,
         PressedIsPresent,
         PopupValue,
@@ -338,7 +341,7 @@
         AccessibilityTextSource textSource;
     };
 
-    using AttributeValueVariant = Variant<std::nullptr_t, String, bool, int, unsigned, double, float, uint64_t, Color, URL, LayoutRect, FloatRect, AXID, IntPoint, OptionSet<SpeakAs>, std::pair<unsigned, unsigned>, Vector<AccessibilityIsolatedTreeText>, Vector<AXID>, Vector<AccessibilityIsolatedTreeMathMultiscriptPair>, Vector<String>>;
+    using AttributeValueVariant = Variant<std::nullptr_t, String, bool, int, unsigned, double, float, uint64_t, Color, URL, LayoutRect, FloatRect, AXID, IntPoint, OptionSet<SpeakAs>, std::pair<unsigned, unsigned>, Vector<AccessibilityIsolatedTreeText>, Vector<AXID>, Vector<AccessibilityIsolatedTreeMathMultiscriptPair>, Vector<String>, Path>;
     void setProperty(AXPropertyName, AttributeValueVariant&&, bool shouldRemove = false);
     void setObjectProperty(AXPropertyName, AXCoreObject*);
     void setObjectVectorProperty(AXPropertyName, const AccessibilityChildrenVector&);
@@ -355,6 +358,7 @@
     Color colorAttributeValue(AXPropertyName) const;
     URL urlAttributeValue(AXPropertyName) const;
     uint64_t uint64AttributeValue(AXPropertyName) const;
+    Path pathAttributeValue(AXPropertyName) const;
     template<typename T> T rectAttributeValue(AXPropertyName) const;
     template<typename T> Vector<T> vectorAttributeValue(AXPropertyName) const;
     template<typename T> OptionSet<T> optionSetAttributeValue(AXPropertyName) const;
@@ -390,7 +394,8 @@
     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 isKeyboardFocusable() const override { return boolAttributeValue(AXPropertyName::IsKeyboardFocusable); }
+    
     // Table support.
     bool isTable() const override { return boolAttributeValue(AXPropertyName::IsTable); }
     bool isExposable() const override { return boolAttributeValue(AXPropertyName::IsExposable); }
@@ -741,9 +746,7 @@
     bool isMediaObject() const override;
     bool isARIATextControl() const override;
     bool isNonNativeTextControl() const override;
-    bool isBlockquote() const override;
     bool isFigureElement() const override;
-    bool isKeyboardFocusable() const override;
     bool isHovered() const override;
     bool isIndeterminate() const override;
     bool isLoaded() const override { return boolAttributeValue(AXPropertyName::IsLoaded); }
@@ -763,7 +766,7 @@
     bool hasSameFontColor(RenderObject*) const override;
     bool hasSameStyle(RenderObject*) const override;
     bool hasUnderline() const override;
-    bool hasHighlighting() const override;
+    bool hasHighlighting() const override { return boolAttributeValue(AXPropertyName::HasHighlighting); }
     Element* element() const override;
     Node* node() const override;
     RenderObject* renderer() const override;
@@ -818,7 +821,7 @@
     AXObjectCache* axObjectCache() const override;
     Element* anchorElement() const override;
     Element* actionElement() const override;
-    Path elementPath() const override;
+    Path elementPath() const override { return pathAttributeValue(AXPropertyName::Path); };
     bool supportsPath() const override { return boolAttributeValue(AXPropertyName::SupportsPath); }
     TextIteratorBehavior textIteratorBehaviorForTextRange() const override;
     Widget* widget() const override;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to