Diff
Modified: trunk/LayoutTests/ChangeLog (290501 => 290502)
--- trunk/LayoutTests/ChangeLog 2022-02-25 08:51:49 UTC (rev 290501)
+++ trunk/LayoutTests/ChangeLog 2022-02-25 09:17:31 UTC (rev 290502)
@@ -1,3 +1,19 @@
+2022-02-25 Carlos Garcia Campos <[email protected]>
+
+ AX: List item marker not exposed when not a direct child of a list item
+ https://bugs.webkit.org/show_bug.cgi?id=236777
+ <rdar://problem/89082485>
+
+ Reviewed by Adrian Perez de Castro.
+
+ Update test results.
+
+ * accessibility/gtk/list-items-always-exposed-expected.txt:
+ * accessibility/gtk/list-items-always-exposed.html:
+ * accessibility/gtk/spans-expected.txt:
+ * accessibility/gtk/spans.html:
+ * platform/gtk/TestExpectations:
+
2022-02-25 Arcady Goldmints-Orlov <[email protected]>
[GLIB] Update test baselines after various LFC improvements.
Modified: trunk/LayoutTests/accessibility/gtk/list-items-always-exposed-expected.txt (290501 => 290502)
--- trunk/LayoutTests/accessibility/gtk/list-items-always-exposed-expected.txt 2022-02-25 08:51:49 UTC (rev 290501)
+++ trunk/LayoutTests/accessibility/gtk/list-items-always-exposed-expected.txt 2022-02-25 09:17:31 UTC (rev 290502)
@@ -8,7 +8,9 @@
PASS list.role is 'AXRole: AXList'
PASS item1.role is 'AXRole: AXListItem'
+PASS marker1.role is 'AXRole: AXStatic'
PASS item2.role is 'AXRole: AXListItem'
+PASS marker2.role is 'AXRole: AXStatic'
PASS paragraph.role is 'AXRole: AXParagraph'
PASS successfullyParsed is true
Modified: trunk/LayoutTests/accessibility/gtk/list-items-always-exposed.html (290501 => 290502)
--- trunk/LayoutTests/accessibility/gtk/list-items-always-exposed.html 2022-02-25 08:51:49 UTC (rev 290501)
+++ trunk/LayoutTests/accessibility/gtk/list-items-always-exposed.html 2022-02-25 09:17:31 UTC (rev 290502)
@@ -23,12 +23,16 @@
var list = webArea.childAtIndex(0);
var item1 = list.childAtIndex(0);
+ var marker1 = item1.childAtIndex(0);
var item2 = list.childAtIndex(1);
- var paragraph = item2.childAtIndex(0);
+ var marker2 = item2.childAtIndex(0);
+ var paragraph = item2.childAtIndex(1);
shouldBe("list.role", "'AXRole: AXList'");
shouldBe("item1.role", "'AXRole: AXListItem'");
+ shouldBe("marker1.role", "'AXRole: AXStatic'");
shouldBe("item2.role", "'AXRole: AXListItem'");
+ shouldBe("marker2.role", "'AXRole: AXStatic'");
shouldBe("paragraph.role", "'AXRole: AXParagraph'");
}
}
Modified: trunk/LayoutTests/accessibility/gtk/spans-expected.txt (290501 => 290502)
--- trunk/LayoutTests/accessibility/gtk/spans-expected.txt 2022-02-25 08:51:49 UTC (rev 290501)
+++ trunk/LayoutTests/accessibility/gtk/spans-expected.txt 2022-02-25 09:17:31 UTC (rev 290502)
@@ -26,9 +26,13 @@
PASS element.role is 'AXRole: AXList'
PASS element.childrenCount is 2
PASS item.role is 'AXRole: AXListItem'
-PASS item.childrenCount is 0
+PASS item.childrenCount is 1
+PASS marker.role is 'AXRole: AXStatic'
+PASS marker.childrenCount is 0
PASS item.role is 'AXRole: AXListItem'
-PASS item.childrenCount is 1
+PASS item.childrenCount is 2
+PASS marker.role is 'AXRole: AXStatic'
+PASS marker.childrenCount is 0
PASS link.role is 'AXRole: AXLink'
PASS link.childrenCount is 0
PASS successfullyParsed is true
Modified: trunk/LayoutTests/accessibility/gtk/spans.html (290501 => 290502)
--- trunk/LayoutTests/accessibility/gtk/spans.html 2022-02-25 08:51:49 UTC (rev 290501)
+++ trunk/LayoutTests/accessibility/gtk/spans.html 2022-02-25 09:17:31 UTC (rev 290502)
@@ -61,13 +61,21 @@
var item = element.childAtIndex(0);
shouldBe("item.role", "'AXRole: AXListItem'");
- shouldBe("item.childrenCount", "0");
+ shouldBe("item.childrenCount", "1");
+ var marker = item.childAtIndex(0);
+ shouldBe("marker.role", "'AXRole: AXStatic'");
+ shouldBe("marker.childrenCount", "0");
+
item = element.childAtIndex(1);
shouldBe("item.role", "'AXRole: AXListItem'");
- shouldBe("item.childrenCount", "1");
+ shouldBe("item.childrenCount", "2");
- link = item.childAtIndex(0);
+ marker = item.childAtIndex(0);
+ shouldBe("marker.role", "'AXRole: AXStatic'");
+ shouldBe("marker.childrenCount", "0");
+
+ link = item.childAtIndex(1);
shouldBe("link.role", "'AXRole: AXLink'");
shouldBe("link.childrenCount", "0");
}
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (290501 => 290502)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2022-02-25 08:51:49 UTC (rev 290501)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2022-02-25 09:17:31 UTC (rev 290502)
@@ -137,7 +137,6 @@
# Tests failing with ATSPI implementation.
webkit.org/b/235941 accessibility/gtk/nested-block-element-children.html [ Failure ]
webkit.org/b/235941 accessibility/gtk/no-notification-for-unrendered-iframe-children.html [ Failure ]
-webkit.org/b/235941 accessibility/gtk/spans.html [ Failure ]
webkit.org/b/235941 accessibility/gtk/text-at-offset-embedded-objects.html [ Failure ]
webkit.org/b/235941 accessibility/gtk/text-at-offset-special-chars.html [ Failure ]
webkit.org/b/235941 accessibility/gtk/xml-roles-exposed.html [ Failure ]
Modified: trunk/Source/WebCore/ChangeLog (290501 => 290502)
--- trunk/Source/WebCore/ChangeLog 2022-02-25 08:51:49 UTC (rev 290501)
+++ trunk/Source/WebCore/ChangeLog 2022-02-25 09:17:31 UTC (rev 290502)
@@ -1,3 +1,23 @@
+2022-02-25 Carlos Garcia Campos <[email protected]>
+
+ AX: List item marker not exposed when not a direct child of a list item
+ https://bugs.webkit.org/show_bug.cgi?id=236777
+ <rdar://problem/89082485>
+
+ Reviewed by Adrian Perez de Castro.
+
+ It can happen that the marker is not a direct child of a list item, in which case the marker is ignored and not
+ exposed to ATs.
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::parentObjectUnignored const): In case of list marker find the marker list item.
+ (WebCore::AccessibilityRenderObject::markerRenderer const): Helper to return the list item marker renderer.
+ (WebCore::AccessibilityRenderObject::addListItemMarker): Add always the list item marker as the first child of
+ list items.
+ (WebCore::AccessibilityRenderObject::addChildren): Do not add list item marker children, they will be added to
+ the right parent in addListItemMarker().
+ * accessibility/AccessibilityRenderObject.h:
+
2022-02-25 Youenn Fablet <[email protected]>
Optimize black frame sending in MediaRecorderPrivate
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (290501 => 290502)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2022-02-25 08:51:49 UTC (rev 290501)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2022-02-25 09:17:31 UTC (rev 290502)
@@ -528,7 +528,23 @@
return nullptr;
}
-
+
+AXCoreObject* AccessibilityRenderObject::parentObjectUnignored() const
+{
+#if USE(ATSPI)
+ // Expose markers that are not direct children of a list item too.
+ if (m_renderer && m_renderer->isListMarker()) {
+ if (auto* listItem = ancestorsOfType<RenderListItem>(*m_renderer).first()) {
+ AccessibilityObject* parent = axObjectCache()->getOrCreate(listItem);
+ if (downcast<AccessibilityRenderObject>(*parent).markerRenderer() == m_renderer)
+ return parent;
+ }
+ }
+#endif
+
+ return AccessibilityNodeObject::parentObjectUnignored();
+}
+
bool AccessibilityRenderObject::isAttachment() const
{
RenderBoxModelObject* renderer = renderBoxModelObject();
@@ -3239,7 +3255,23 @@
insertionIndex += (m_children.size() - previousSize);
}
}
-
+
+#if USE(ATSPI)
+RenderObject* AccessibilityRenderObject::markerRenderer() const
+{
+ if (accessibilityIsIgnored() || !isListItem() || !m_renderer || !m_renderer->isListItem())
+ return nullptr;
+
+ return downcast<RenderListItem>(*m_renderer).markerRenderer();
+}
+
+void AccessibilityRenderObject::addListItemMarker()
+{
+ if (auto* marker = markerRenderer())
+ insertChild(axObjectCache()->getOrCreate(marker), 0);
+}
+#endif
+
void AccessibilityRenderObject::updateRoleAfterChildrenCreation()
{
AXTRACE("AccessibilityRenderObject::updateRoleAfterChildrenCreation");
@@ -3272,10 +3304,18 @@
if (!canHaveChildren())
return;
-
- for (RefPtr<AccessibilityObject> obj = firstChild(); obj; obj = obj->nextSibling())
- addChild(obj.get());
-
+
+ auto addChildIfNeeded = [this](AccessibilityObject& object) {
+#if USE(ATSPI)
+ if (object.renderer()->isListMarker())
+ return;
+#endif
+ addChild(&object);
+ };
+
+ for (RefPtr<AccessibilityObject> object = firstChild(); object; object = object->nextSibling())
+ addChildIfNeeded(*object);
+
m_subtreeDirty = false;
addHiddenChildren();
@@ -3284,6 +3324,9 @@
addTextFieldChildren();
addCanvasChildren();
addRemoteSVGChildren();
+#if USE(ATSPI)
+ addListItemMarker();
+#endif
#if PLATFORM(COCOA)
updateAttachmentViewParents();
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h (290501 => 290502)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h 2022-02-25 08:51:49 UTC (rev 290501)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h 2022-02-25 09:17:31 UTC (rev 290502)
@@ -91,6 +91,7 @@
AccessibilityObject* nextSibling() const override;
AccessibilityObject* parentObject() const override;
AccessibilityObject* parentObjectIfExists() const override;
+ AXCoreObject* parentObjectUnignored() const override;
AccessibilityObject* observableObject() const override;
void linkedUIElements(AccessibilityChildrenVector&) const override;
AccessibilityObject* titleUIElement() const override;
@@ -237,6 +238,9 @@
bool renderObjectIsObservable(RenderObject&) const;
RenderObject* renderParentObject() const;
+#if USE(ATSPI)
+ RenderObject* markerRenderer() const;
+#endif
bool isSVGImage() const;
void detachRemoteSVGRoot();
@@ -252,6 +256,9 @@
void addCanvasChildren();
void addAttachmentChildren();
void addRemoteSVGChildren();
+#if USE(ATSPI)
+ void addListItemMarker();
+#endif
#if PLATFORM(COCOA)
void updateAttachmentViewParents();
#endif
Modified: trunk/Tools/ChangeLog (290501 => 290502)
--- trunk/Tools/ChangeLog 2022-02-25 08:51:49 UTC (rev 290501)
+++ trunk/Tools/ChangeLog 2022-02-25 09:17:31 UTC (rev 290502)
@@ -1,3 +1,14 @@
+2022-02-25 Carlos Garcia Campos <[email protected]>
+
+ AX: List item marker not exposed when not a direct child of a list item
+ https://bugs.webkit.org/show_bug.cgi?id=236777
+ <rdar://problem/89082485>
+
+ Reviewed by Adrian Perez de Castro.
+
+ * WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp:
+ (WTR::roleValueToString): Return AXStatic for Text role too.
+
2022-02-24 Alex Christensen <[email protected]>
Unreviewed, reverting r290371.
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp (290501 => 290502)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp 2022-02-25 08:51:49 UTC (rev 290501)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp 2022-02-25 09:17:31 UTC (rev 290502)
@@ -772,6 +772,7 @@
case WebCore::Atspi::Role::SpinButton:
return "AXSpinButton"_s;
case WebCore::Atspi::Role::Static:
+ case WebCore::Atspi::Role::Text:
return "AXStatic"_s;
case WebCore::Atspi::Role::StatusBar:
return "AXStatusBar"_s;