WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-155494-20170601175517.patch (text/plain), 34.37 KB, created by
Joanmarie Diggs
on 2017-06-01 08:55:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Joanmarie Diggs
Created:
2017-06-01 08:55:19 PDT
Size:
34.37 KB
patch
obsolete
>Subversion Revision: 217608 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c05963b4ba8b0afe9e69ee1bed20d9ef8ee4f2dc..16a3239adad21a9812377839bb543f0590940c64 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,34 @@ >+2017-05-31 Joanmarie Diggs <jdiggs@igalia.com> >+ >+ AX: [ATK] Implement missing AtkRelation types >+ https://bugs.webkit.org/show_bug.cgi?id=155494 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add methods for getting the element(s) which reference a particular element >+ via an ARIA attribute. Then use those methods to identify and expose the >+ expected reverse/reciprocal AtkRelationType and targets. Also add ATK support >+ for aria-owns. >+ >+ Use String::simplifyWhiteSpace() in AccessibilityObject::elementsFromAttribute() >+ so that unexpected whitespace characters in an attribute's list of ids does not >+ prevent the desired element from being found. >+ >+ Tests: accessibility/aria-owns.html >+ accessibility/gtk/relation-types.html >+ >+ * accessibility/AccessibilityObject.cpp: >+ (WebCore::AccessibilityObject::elementsFromAttribute): >+ (WebCore::AccessibilityObject::ariaElementsReferencedByAttribute): >+ (WebCore::AccessibilityObject::ariaControlsReferencingElements): >+ (WebCore::AccessibilityObject::ariaDescribedByReferencingElements): >+ (WebCore::AccessibilityObject::ariaFlowToReferencingElements): >+ (WebCore::AccessibilityObject::ariaLabelledByReferencingElements): >+ (WebCore::AccessibilityObject::ariaOwnsReferencingElements): >+ * accessibility/AccessibilityObject.h: >+ * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: >+ (setAtkRelationSetFromCoreObject): >+ > 2017-05-31 Matt Lewis <jlewis3@apple.com> > > Unreviewed, rolling out r217603. >diff --git a/Source/WebCore/accessibility/AccessibilityObject.cpp b/Source/WebCore/accessibility/AccessibilityObject.cpp >index 36a6736d2c4315575b316228b62f34c80475452a..b3ac711ee5231e0bcfce76050a3804652c6756ff 100644 >--- a/Source/WebCore/accessibility/AccessibilityObject.cpp >+++ b/Source/WebCore/accessibility/AccessibilityObject.cpp >@@ -3170,8 +3170,7 @@ void AccessibilityObject::elementsFromAttribute(Vector<Element*>& elements, cons > if (idList.isEmpty()) > return; > >- idList.replace('\n', ' '); >- for (auto idName : StringView(idList).split(' ')) { >+ for (auto idName : StringView(idList.simplifyWhiteSpace(isHTMLSpace)).split(' ')) { > if (auto* idElement = treeScope.getElementById(idName)) > elements.append(idElement); > } >@@ -3286,21 +3285,61 @@ void AccessibilityObject::ariaElementsFromAttribute(AccessibilityChildrenVector& > } > } > >+void AccessibilityObject::ariaElementsReferencedByAttribute(AccessibilityChildrenVector& elements, const QualifiedName& attribute) const >+{ >+ auto id = identifierAttribute(); >+ if (id.isNull() || id.isEmpty()) >+ return; >+ >+ AXObjectCache* cache = axObjectCache(); >+ if (!cache) >+ return; >+ >+ for (auto& element : descendantsOfType<Element>(element()->treeScope().rootNode())) { >+ const AtomicString& idList = element.attributeWithoutSynchronization(attribute); >+ if (idList.isNull() || idList.isEmpty()) >+ continue; >+ >+ Vector<String> ids; >+ String(idList).simplifyWhiteSpace(isHTMLSpace).split(" ", ids); >+ if (!ids.contains(id)) >+ continue; >+ >+ if (AccessibilityObject* axObject = cache->getOrCreate(&element)) >+ elements.append(axObject); >+ } >+} >+ > void AccessibilityObject::ariaControlsElements(AccessibilityChildrenVector& ariaControls) const > { > ariaElementsFromAttribute(ariaControls, aria_controlsAttr); > } > >+void AccessibilityObject::ariaControlsReferencingElements(AccessibilityChildrenVector& controllers) const >+{ >+ ariaElementsReferencedByAttribute(controllers, aria_controlsAttr); >+} >+ > void AccessibilityObject::ariaDescribedByElements(AccessibilityChildrenVector& ariaDescribedBy) const > { > ariaElementsFromAttribute(ariaDescribedBy, aria_describedbyAttr); > } > >+void AccessibilityObject::ariaDescribedByReferencingElements(AccessibilityChildrenVector& describers) const >+{ >+ ariaElementsReferencedByAttribute(describers, aria_describedbyAttr); >+} >+ > void AccessibilityObject::ariaFlowToElements(AccessibilityChildrenVector& flowTo) const > { > ariaElementsFromAttribute(flowTo, aria_flowtoAttr); > } > >+void AccessibilityObject::ariaFlowToReferencingElements(AccessibilityChildrenVector& flowFrom) const >+{ >+ ariaElementsReferencedByAttribute(flowFrom, aria_flowtoAttr); >+} >+ > void AccessibilityObject::ariaLabelledByElements(AccessibilityChildrenVector& ariaLabelledBy) const > { > ariaElementsFromAttribute(ariaLabelledBy, aria_labelledbyAttr); >@@ -3308,11 +3347,23 @@ void AccessibilityObject::ariaLabelledByElements(AccessibilityChildrenVector& ar > ariaElementsFromAttribute(ariaLabelledBy, aria_labeledbyAttr); > } > >+void AccessibilityObject::ariaLabelledByReferencingElements(AccessibilityChildrenVector& labels) const >+{ >+ ariaElementsReferencedByAttribute(labels, aria_labelledbyAttr); >+ if (!labels.size()) >+ ariaElementsReferencedByAttribute(labels, aria_labeledbyAttr); >+} >+ > void AccessibilityObject::ariaOwnsElements(AccessibilityChildrenVector& axObjects) const > { > ariaElementsFromAttribute(axObjects, aria_ownsAttr); > } > >+void AccessibilityObject::ariaOwnsReferencingElements(AccessibilityChildrenVector& owners) const >+{ >+ ariaElementsReferencedByAttribute(owners, aria_ownsAttr); >+} >+ > void AccessibilityObject::setIsIgnoredFromParentDataForChild(AccessibilityObject* child) > { > if (!child) >diff --git a/Source/WebCore/accessibility/AccessibilityObject.h b/Source/WebCore/accessibility/AccessibilityObject.h >index 05ecb541295739422b364c647765d5085ccac6a4..ffe36a031c024ba44c1180a5e12642892791d72a 100644 >--- a/Source/WebCore/accessibility/AccessibilityObject.h >+++ b/Source/WebCore/accessibility/AccessibilityObject.h >@@ -663,10 +663,15 @@ public: > > virtual bool supportsARIAOwns() const { return false; } > void ariaControlsElements(AccessibilityChildrenVector&) const; >+ void ariaControlsReferencingElements(AccessibilityChildrenVector&) const; > void ariaDescribedByElements(AccessibilityChildrenVector&) const; >+ void ariaDescribedByReferencingElements(AccessibilityChildrenVector&) const; > void ariaFlowToElements(AccessibilityChildrenVector&) const; >+ void ariaFlowToReferencingElements(AccessibilityChildrenVector&) const; > void ariaLabelledByElements(AccessibilityChildrenVector&) const; >+ void ariaLabelledByReferencingElements(AccessibilityChildrenVector&) const; > void ariaOwnsElements(AccessibilityChildrenVector&) const; >+ void ariaOwnsReferencingElements(AccessibilityChildrenVector&) const; > > virtual bool ariaHasPopup() const { return false; } > String ariaPopupValue() const; >@@ -1140,6 +1145,7 @@ protected: > bool dispatchTouchEvent(); > > void ariaElementsFromAttribute(AccessibilityChildrenVector&, const QualifiedName&) const; >+ void ariaElementsReferencedByAttribute(AccessibilityChildrenVector&, const QualifiedName&) const; > > #if PLATFORM(GTK) && HAVE(ACCESSIBILITY) > bool allowsTextRanges() const; >diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp >index 1dcd71dce4554af4865bbfe3360fdfdac86ba5a1..141bddab688bc51273087abc9d0cabceeb18def8 100644 >--- a/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp >+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp >@@ -173,13 +173,11 @@ static void removeAtkRelationByType(AtkRelationSet* relationSet, AtkRelationType > > static void setAtkRelationSetFromCoreObject(AccessibilityObject* coreObject, AtkRelationSet* relationSet) > { >- // FIXME: We're not implementing all the relation types, most notably the inverse/reciprocal >- // types. Filed as bug 155494. >- > // Elements with aria-labelledby should have the labelled-by relation as per the ARIA AAM spec. > // Controls with a label element and fieldsets with a legend element should also use this relation > // as per the HTML AAM spec. The reciprocal label-for relation should also be used. > removeAtkRelationByType(relationSet, ATK_RELATION_LABELLED_BY); >+ removeAtkRelationByType(relationSet, ATK_RELATION_LABEL_FOR); > if (coreObject->isControl()) { > if (AccessibilityObject* label = coreObject->correspondingLabelForControlElement()) > atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, label->wrapper()); >@@ -202,6 +200,12 @@ static void setAtkRelationSetFromCoreObject(AccessibilityObject* coreObject, Atk > atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, accessibilityObject->wrapper()); > } > >+ // Elements referenced by aria-labelledby should have the label-for relation as per the ARIA AAM spec. >+ AccessibilityObject::AccessibilityChildrenVector labels; >+ coreObject->ariaLabelledByReferencingElements(labels); >+ for (const auto& accessibilityObject : labels) >+ atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABEL_FOR, accessibilityObject->wrapper()); >+ > // Elements with aria-flowto should have the flows-to relation as per the ARIA AAM spec. > removeAtkRelationByType(relationSet, ATK_RELATION_FLOWS_TO); > AccessibilityObject::AccessibilityChildrenVector ariaFlowToElements; >@@ -209,6 +213,13 @@ static void setAtkRelationSetFromCoreObject(AccessibilityObject* coreObject, Atk > for (const auto& accessibilityObject : ariaFlowToElements) > atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_FLOWS_TO, accessibilityObject->wrapper()); > >+ // Elements referenced by aria-flowto should have the flows-from relation as per the ARIA AAM spec. >+ removeAtkRelationByType(relationSet, ATK_RELATION_FLOWS_FROM); >+ AccessibilityObject::AccessibilityChildrenVector flowFrom; >+ coreObject->ariaFlowToReferencingElements(flowFrom); >+ for (const auto& accessibilityObject : flowFrom) >+ atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_FLOWS_FROM, accessibilityObject->wrapper()); >+ > // Elements with aria-describedby should have the described-by relation as per the ARIA AAM spec. > removeAtkRelationByType(relationSet, ATK_RELATION_DESCRIBED_BY); > AccessibilityObject::AccessibilityChildrenVector ariaDescribedByElements; >@@ -216,12 +227,40 @@ static void setAtkRelationSetFromCoreObject(AccessibilityObject* coreObject, Atk > for (const auto& accessibilityObject : ariaDescribedByElements) > atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DESCRIBED_BY, accessibilityObject->wrapper()); > >+ // Elements referenced by aria-describedby should have the description-for relation as per the ARIA AAM spec. >+ removeAtkRelationByType(relationSet, ATK_RELATION_DESCRIPTION_FOR); >+ AccessibilityObject::AccessibilityChildrenVector describers; >+ coreObject->ariaDescribedByReferencingElements(describers); >+ for (const auto& accessibilityObject : describers) >+ atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DESCRIPTION_FOR, accessibilityObject->wrapper()); >+ > // Elements with aria-controls should have the controller-for relation as per the ARIA AAM spec. > removeAtkRelationByType(relationSet, ATK_RELATION_CONTROLLER_FOR); > AccessibilityObject::AccessibilityChildrenVector ariaControls; > coreObject->ariaControlsElements(ariaControls); > for (const auto& accessibilityObject : ariaControls) > atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_CONTROLLER_FOR, accessibilityObject->wrapper()); >+ >+ // Elements referenced by aria-controls should have the controlled-by relation as per the ARIA AAM spec. >+ removeAtkRelationByType(relationSet, ATK_RELATION_CONTROLLED_BY); >+ AccessibilityObject::AccessibilityChildrenVector controllers; >+ coreObject->ariaControlsReferencingElements(controllers); >+ for (const auto& accessibilityObject : controllers) >+ atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_CONTROLLED_BY, accessibilityObject->wrapper()); >+ >+ // Elements with aria-owns should have the node-parent-of relation as per the ARIA AAM spec. >+ removeAtkRelationByType(relationSet, ATK_RELATION_NODE_PARENT_OF); >+ AccessibilityObject::AccessibilityChildrenVector ariaOwns; >+ coreObject->ariaOwnsElements(ariaOwns); >+ for (const auto& accessibilityObject : ariaOwns) >+ atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_NODE_PARENT_OF, accessibilityObject->wrapper()); >+ >+ // Elements referenced by aria-owns should have the node-child-of relation as per the ARIA AAM spec. >+ removeAtkRelationByType(relationSet, ATK_RELATION_NODE_CHILD_OF); >+ AccessibilityObject::AccessibilityChildrenVector owners; >+ coreObject->ariaOwnsReferencingElements(owners); >+ for (const auto& accessibilityObject : owners) >+ atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_NODE_CHILD_OF, accessibilityObject->wrapper()); > } > > static gpointer webkitAccessibleParentClass = nullptr; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index d99823e04efd8d7ab0681e18bb292588b5631b94..2db659536f0226af36a37613406ec51f4b03e0e7 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,32 @@ >+2017-05-31 Joanmarie Diggs <jdiggs@igalia.com> >+ >+ AX: [ATK] Implement missing AtkRelation types >+ https://bugs.webkit.org/show_bug.cgi?id=155494 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add additional methods to test ARIA properties which are exposed via >+ AtkRelation. Implement ATK support for ariaOwnsElementAtIndex(). >+ >+ * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: >+ (WTR::AccessibilityUIElement::ariaLabelledByElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaDescribedByElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaOwnsReferencingElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaFlowToReferencingElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaControlsReferencingElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaLabelledByReferencingElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaDescribedByReferencingElementAtIndex): >+ * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: >+ * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: >+ (WTR::AccessibilityUIElement::ariaOwnsElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaOwnsReferencingElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaFlowToReferencingElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaControlsReferencingElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaLabelledByElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaLabelledByReferencingElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaDescribedByElementAtIndex): >+ (WTR::AccessibilityUIElement::ariaDescribedByReferencingElementAtIndex): >+ > 2017-05-31 Matt Lewis <jlewis3@apple.com> > > Unreviewed, rolling out r217603. >diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h >index 435dd7db8aa880751bebfe7a8c2073209c0a0e8b..4dfdbdd588db06f66a950982471dc745f005dce5 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h >+++ b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h >@@ -194,6 +194,23 @@ public: > RefPtr<AccessibilityUIElement> ariaOwnsElementAtIndex(unsigned); > RefPtr<AccessibilityUIElement> ariaFlowToElementAtIndex(unsigned); > RefPtr<AccessibilityUIElement> ariaControlsElementAtIndex(unsigned); >+#if PLATFORM(GTK) >+ RefPtr<AccessibilityUIElement> ariaLabelledByElementAtIndex(unsigned); >+ RefPtr<AccessibilityUIElement> ariaDescribedByElementAtIndex(unsigned); >+ RefPtr<AccessibilityUIElement> ariaOwnsReferencingElementAtIndex(unsigned); >+ RefPtr<AccessibilityUIElement> ariaFlowToReferencingElementAtIndex(unsigned); >+ RefPtr<AccessibilityUIElement> ariaControlsReferencingElementAtIndex(unsigned); >+ RefPtr<AccessibilityUIElement> ariaLabelledByReferencingElementAtIndex(unsigned); >+ RefPtr<AccessibilityUIElement> ariaDescribedByReferencingElementAtIndex(unsigned); >+#else >+ RefPtr<AccessibilityUIElement> ariaLabelledByElementAtIndex(unsigned) { return nullptr; } >+ RefPtr<AccessibilityUIElement> ariaDescribedByElementAtIndex(unsigned) { return nullptr; } >+ RefPtr<AccessibilityUIElement> ariaOwnsReferencingElementAtIndex(unsigned) { return nullptr; } >+ RefPtr<AccessibilityUIElement> ariaFlowToReferencingElementAtIndex(unsigned) { return nullptr; } >+ RefPtr<AccessibilityUIElement> ariaControlsReferencingElementAtIndex(unsigned) { return nullptr; } >+ RefPtr<AccessibilityUIElement> ariaLabelledByReferencingElementAtIndex(unsigned) { return nullptr; } >+ RefPtr<AccessibilityUIElement> ariaDescribedByReferencingElementAtIndex(unsigned) { return nullptr; } >+#endif > > // ARIA Drag and Drop > bool ariaIsGrabbed() const; >diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl >index 967cb975d2b36d1da2ca52ac991f9100c4cb6731..c50d68f9dfa267cefcf79cd70edaf6de8a83cca4 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl >+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl >@@ -150,8 +150,15 @@ interface AccessibilityUIElement { > object rowHeaders(); > > AccessibilityUIElement ariaOwnsElementAtIndex(unsigned long index); >+ AccessibilityUIElement ariaOwnsReferencingElementAtIndex(unsigned long index); > AccessibilityUIElement ariaFlowToElementAtIndex(unsigned long index); >+ AccessibilityUIElement ariaFlowToReferencingElementAtIndex(unsigned long index); > AccessibilityUIElement ariaControlsElementAtIndex(unsigned long index); >+ AccessibilityUIElement ariaControlsReferencingElementAtIndex(unsigned long index); >+ AccessibilityUIElement ariaLabelledByElementAtIndex(unsigned long index); >+ AccessibilityUIElement ariaLabelledByReferencingElementAtIndex(unsigned long index); >+ AccessibilityUIElement ariaDescribedByElementAtIndex(unsigned long index); >+ AccessibilityUIElement ariaDescribedByReferencingElementAtIndex(unsigned long index); > > // Paramaterized attributes. > DOMString parameterizedAttributeNames(); >diff --git a/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp b/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp >index defafdfb2ce8082b68290d4b59b73f53e4f0a758..5b910bd4c7878a59213983663423e790d09bdbfe 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp >@@ -862,8 +862,12 @@ RefPtr<AccessibilityUIElement> AccessibilityUIElement::linkedUIElementAtIndex(un > > RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index) > { >- // FIXME: implement >- return nullptr; >+ return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_NODE_PARENT_OF, index); >+} >+ >+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaOwnsReferencingElementAtIndex(unsigned index) >+{ >+ return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_NODE_CHILD_OF, index); > } > > RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index) >@@ -871,11 +875,41 @@ RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaFlowToElementAtIndex( > return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_FLOWS_TO, index); > } > >+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaFlowToReferencingElementAtIndex(unsigned index) >+{ >+ return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_FLOWS_FROM, index); >+} >+ > RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaControlsElementAtIndex(unsigned index) > { > return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_CONTROLLER_FOR, index); > } > >+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaControlsReferencingElementAtIndex(unsigned index) >+{ >+ return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_CONTROLLED_BY, index); >+} >+ >+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaLabelledByElementAtIndex(unsigned index) >+{ >+ return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_LABELLED_BY, index); >+} >+ >+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaLabelledByReferencingElementAtIndex(unsigned index) >+{ >+ return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_LABEL_FOR, index); >+} >+ >+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaDescribedByElementAtIndex(unsigned index) >+{ >+ return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_DESCRIBED_BY, index); >+} >+ >+RefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaDescribedByReferencingElementAtIndex(unsigned index) >+{ >+ return accessibilityElementAtIndex(m_element.get(), ATK_RELATION_DESCRIPTION_FOR, index); >+} >+ > RefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedRowAtIndex(unsigned index) > { > // FIXME: implement >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 9f72f8445286f4bbb0ed821f1ae8502e8c82da41..4ea182a54ee7e99b53233929929c30125a2e1cb1 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2017-05-31 Joanmarie Diggs <jdiggs@igalia.com> >+ >+ AX: [ATK] Implement missing AtkRelation types >+ https://bugs.webkit.org/show_bug.cgi?id=155494 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/aria-owns-expected.txt: Renamed from LayoutTests/accessibility/mac/aria-owns-expected.txt. >+ * accessibility/aria-owns.html: Renamed from LayoutTests/accessibility/mac/aria-owns.html. >+ * accessibility/gtk/relation-types-expected.txt: Added. >+ * accessibility/gtk/relation-types.html: Added. >+ > 2017-05-31 Brent Fulgham <bfulgham@apple.com> > > Make ResourceLoadStatistics testing more reliable >diff --git a/LayoutTests/accessibility/aria-owns-expected.txt b/LayoutTests/accessibility/aria-owns-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..b700df88467b2bdfdb6c5d7822e26b574f0c23ca >--- /dev/null >+++ b/LayoutTests/accessibility/aria-owns-expected.txt >@@ -0,0 +1,18 @@ >+Item 1 >+Item 2 >+Item 3 >+BUTTON >+RADIO BUTTON >+This tests that aria-owns correctly exposes AXOwns and correctly returns the right elements >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS group.ariaOwnsElementAtIndex(0).role is 'AXRole: AXButton' >+PASS group.ariaOwnsElementAtIndex(0).title is 'AXTitle: BUTTON' >+PASS group.ariaOwnsElementAtIndex(1).role is 'AXRole: AXRadioButton' >+PASS group.ariaOwnsElementAtIndex(1).title is 'AXTitle: RADIO BUTTON' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/accessibility/aria-owns.html b/LayoutTests/accessibility/aria-owns.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b41401afa40447d136f6ab57417d95cdedc3aabb >--- /dev/null >+++ b/LayoutTests/accessibility/aria-owns.html >@@ -0,0 +1,39 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../resources/js-test-pre.js"></script> >+</head> >+<body id="body"> >+ >+<div tabindex=0 id="group" role="group" aria-owns="extra extra2"> >+<div>Item 1</div> >+<div>Item 2</div> >+<div>Item 3</div> >+</div> >+ >+<div id="extra" role="button">BUTTON</div> >+<div id="extra2" role="radio">RADIO BUTTON</div> >+ >+<p id="description"></p> >+<div id="console"></div> >+ >+<script> >+ >+ description("This tests that aria-owns correctly exposes AXOwns and correctly returns the right elements"); >+ >+ if (window.accessibilityController) { >+ >+ var group = document.getElementById("group"); >+ group.focus(); >+ group = accessibilityController.focusedElement; >+ shouldBe("group.ariaOwnsElementAtIndex(0).role", "'AXRole: AXButton'"); >+ shouldBe("group.ariaOwnsElementAtIndex(0).title", "'AXTitle: BUTTON'"); >+ shouldBe("group.ariaOwnsElementAtIndex(1).role", "'AXRole: AXRadioButton'"); >+ shouldBe("group.ariaOwnsElementAtIndex(1).title", "'AXTitle: RADIO BUTTON'"); >+ } >+ >+</script> >+ >+<script src="../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/accessibility/gtk/relation-types-expected.txt b/LayoutTests/accessibility/gtk/relation-types-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..907eda9340e5ffb62b8684a4b283539ab5a77a25 >--- /dev/null >+++ b/LayoutTests/accessibility/gtk/relation-types-expected.txt >@@ -0,0 +1,40 @@ >+This verifies the exposure of aria-properties via accessible relations. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+axElement.ariaOwnsElementAtIndex(0): AXButton: 'owned 1' >+owned.ariaOwnsReferencingElementAtIndex(0): AXGroup: 'label 1 label 2' >+ >+axElement.ariaOwnsElementAtIndex(1): AXRadioButton: 'owned 2' >+owned.ariaOwnsReferencingElementAtIndex(0): AXGroup: 'label 1 label 2' >+ >+axElement.ariaControlsElementAtIndex(0): AXGroup: 'controlled 1' >+controlled.ariaControlsReferencingElementAtIndex(0): AXGroup: 'label 1 label 2' >+ >+axElement.ariaControlsElementAtIndex(1): AXGroup: 'controlled 2' >+controlled.ariaControlsReferencingElementAtIndex(0): AXGroup: 'label 1 label 2' >+ >+axElement.ariaLabelledByElementAtIndex(0): AXParagraph: 'label 1' >+labelledBy.ariaLabelledByReferencingElementAtIndex(0): AXGroup: 'label 1 label 2' >+ >+axElement.ariaLabelledByElementAtIndex(1): AXSection: 'label 2' >+labelledBy.ariaLabelledByReferencingElementAtIndex(0): AXGroup: 'label 1 label 2' >+ >+axElement.ariaDescribedByElementAtIndex(0): AXParagraph: 'description 1' >+describedBy.ariaDescribedByReferencingElementAtIndex(0): AXGroup: 'label 1 label 2' >+describedBy.ariaDescribedByReferencingElementAtIndex(1): AXGroup: 'next group (1 of 2)' >+ >+axElement.ariaDescribedByElementAtIndex(1): AXSection: 'description 2' >+describedBy.ariaDescribedByReferencingElementAtIndex(0): AXGroup: 'label 1 label 2' >+describedBy.ariaDescribedByReferencingElementAtIndex(1): AXGroup: 'next group (2 of 2)' >+ >+axElement.ariaFlowToElementAtIndex(0): AXGroup: 'next group (1 of 2)' >+flowTo.ariaFlowToReferencingElementAtIndex(0): AXGroup: 'label 1 label 2' >+ >+axElement.ariaFlowToElementAtIndex(1): AXGroup: 'next group (2 of 2)' >+flowTo.ariaFlowToReferencingElementAtIndex(0): AXGroup: 'label 1 label 2' >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/accessibility/gtk/relation-types.html b/LayoutTests/accessibility/gtk/relation-types.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8e27a9c5f58ccc4df3c5b839450a716ca1dee98b >--- /dev/null >+++ b/LayoutTests/accessibility/gtk/relation-types.html >@@ -0,0 +1,104 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+<script src="../../resources/accessibility-helper.js"></script> >+</head> >+<body id="body"> >+ <div id="content"> >+ <!-- N.B. The variety of whitespace chars separating the ids is deliberate --> >+ <div tabindex="0" id="test" role="group" >+ aria-flowto="flowto1 flowto2" >+ aria-owns="owned1 owned2" >+ aria-controls="controlled1 >+ controlled2" >+ aria-labelledby="label1 label2" >+ aria-describedby="description1 description2"> >+ </div> >+ <div id="owned1" role="button">owned 1</div> >+ <div id="owned2" role="radio">owned 2</div> >+ <div id="controlled1" role="group" aria-label="controlled 1"></div> >+ <div id="controlled2" role="group" aria-label="controlled 2"></div> >+ <p id="label1">label 1</p> >+ <div id="label2">label 2</div> >+ <p id="description1">description 1</p> >+ <div id="description2">description 2</div> >+ <div tabindex="0" id="flowto1" role="group" aria-label="next group (1 of 2)" aria-describedby="description1"></div> >+ <div tabindex="0" id="flowto2" role="group" aria-label="next group (2 of 2)" aria-describedby="description2"></div> >+</div> >+<p id="description"></p> >+<div id="console"></div> >+<script> >+ function info(axElement) { >+ if (!axElement) >+ return "(null)"; >+ >+ string = axElement.title.split("AXTitle: ")[1]; >+ string = string ? string : axElement.stringValue.split("AXValue: ")[1]; >+ return axElement.role.split("AXRole: ")[1] + ": '" + string + "'"; >+ } >+ >+ description("This verifies the exposure of aria-properties via accessible relations."); >+ if (window.accessibilityController) { >+ var axElement = accessibilityController.accessibleElementById("test"); >+ >+ var owned = axElement.ariaOwnsElementAtIndex(0); >+ var owner = owned.ariaOwnsReferencingElementAtIndex(0); >+ debug("axElement.ariaOwnsElementAtIndex(0): " + info(owned)); >+ debug("owned.ariaOwnsReferencingElementAtIndex(0): " + info(owner)); >+ >+ owned = axElement.ariaOwnsElementAtIndex(1); >+ owner = owned.ariaOwnsReferencingElementAtIndex(0); >+ debug("\naxElement.ariaOwnsElementAtIndex(1): " + info(owned)); >+ debug("owned.ariaOwnsReferencingElementAtIndex(0): " + info(owner)); >+ >+ var controlled = axElement.ariaControlsElementAtIndex(0); >+ var controller = controlled.ariaControlsReferencingElementAtIndex(0); >+ debug("\naxElement.ariaControlsElementAtIndex(0): " + info(controlled)); >+ debug("controlled.ariaControlsReferencingElementAtIndex(0): " + info(controller)); >+ >+ controlled = axElement.ariaControlsElementAtIndex(1); >+ controller = controlled.ariaControlsReferencingElementAtIndex(0); >+ debug("\naxElement.ariaControlsElementAtIndex(1): " + info(controlled)); >+ debug("controlled.ariaControlsReferencingElementAtIndex(0): " + info(controller)); >+ >+ var labelledBy = axElement.ariaLabelledByElementAtIndex(0); >+ var label = labelledBy.ariaLabelledByReferencingElementAtIndex(0); >+ debug("\naxElement.ariaLabelledByElementAtIndex(0): " + info(labelledBy)); >+ debug("labelledBy.ariaLabelledByReferencingElementAtIndex(0): " + info(label)); >+ >+ labelledBy = axElement.ariaLabelledByElementAtIndex(1); >+ label = labelledBy.ariaLabelledByReferencingElementAtIndex(0); >+ debug("\naxElement.ariaLabelledByElementAtIndex(1): " + info(labelledBy)); >+ debug("labelledBy.ariaLabelledByReferencingElementAtIndex(0): " + info(label)); >+ >+ var describedBy = axElement.ariaDescribedByElementAtIndex(0); >+ var descriptionFor = describedBy.ariaDescribedByReferencingElementAtIndex(0); >+ var alsoDescriptionFor = describedBy.ariaDescribedByReferencingElementAtIndex(1); >+ debug("\naxElement.ariaDescribedByElementAtIndex(0): " + info(describedBy)); >+ debug("describedBy.ariaDescribedByReferencingElementAtIndex(0): " + info(descriptionFor)); >+ debug("describedBy.ariaDescribedByReferencingElementAtIndex(1): " + info(alsoDescriptionFor)); >+ >+ describedBy = axElement.ariaDescribedByElementAtIndex(1); >+ descriptionFor = describedBy.ariaDescribedByReferencingElementAtIndex(0); >+ alsoDescriptionFor = describedBy.ariaDescribedByReferencingElementAtIndex(1); >+ debug("\naxElement.ariaDescribedByElementAtIndex(1): " + info(describedBy)); >+ debug("describedBy.ariaDescribedByReferencingElementAtIndex(0): " + info(descriptionFor)); >+ debug("describedBy.ariaDescribedByReferencingElementAtIndex(1): " + info(alsoDescriptionFor)); >+ >+ var flowTo = axElement.ariaFlowToElementAtIndex(0); >+ var flowFrom = flowTo.ariaFlowToReferencingElementAtIndex(0); >+ debug("\naxElement.ariaFlowToElementAtIndex(0): " + info(flowTo)); >+ debug("flowTo.ariaFlowToReferencingElementAtIndex(0): " + info(flowFrom)); >+ >+ flowTo = axElement.ariaFlowToElementAtIndex(1); >+ flowFrom = flowTo.ariaFlowToReferencingElementAtIndex(0); >+ debug("\naxElement.ariaFlowToElementAtIndex(1): " + info(flowTo)); >+ debug("flowTo.ariaFlowToReferencingElementAtIndex(0): " + info(flowFrom)); >+ >+ document.getElementById("content").style.visibility = "hidden"; >+ } >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/accessibility/mac/aria-owns-expected.txt b/LayoutTests/accessibility/mac/aria-owns-expected.txt >deleted file mode 100644 >index b700df88467b2bdfdb6c5d7822e26b574f0c23ca..0000000000000000000000000000000000000000 >--- a/LayoutTests/accessibility/mac/aria-owns-expected.txt >+++ /dev/null >@@ -1,18 +0,0 @@ >-Item 1 >-Item 2 >-Item 3 >-BUTTON >-RADIO BUTTON >-This tests that aria-owns correctly exposes AXOwns and correctly returns the right elements >- >-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >- >- >-PASS group.ariaOwnsElementAtIndex(0).role is 'AXRole: AXButton' >-PASS group.ariaOwnsElementAtIndex(0).title is 'AXTitle: BUTTON' >-PASS group.ariaOwnsElementAtIndex(1).role is 'AXRole: AXRadioButton' >-PASS group.ariaOwnsElementAtIndex(1).title is 'AXTitle: RADIO BUTTON' >-PASS successfullyParsed is true >- >-TEST COMPLETE >- >diff --git a/LayoutTests/accessibility/mac/aria-owns.html b/LayoutTests/accessibility/mac/aria-owns.html >deleted file mode 100644 >index 5326a7022060f6323a324f713d7912582885bfa8..0000000000000000000000000000000000000000 >--- a/LayoutTests/accessibility/mac/aria-owns.html >+++ /dev/null >@@ -1,39 +0,0 @@ >-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >-<html> >-<head> >-<script src="../../resources/js-test-pre.js"></script> >-</head> >-<body id="body"> >- >-<div tabindex=0 id="group" role="group" aria-owns="extra extra2"> >-<div>Item 1</div> >-<div>Item 2</div> >-<div>Item 3</div> >-</div> >- >-<div id="extra" role="button">BUTTON</div> >-<div id="extra2" role="radio">RADIO BUTTON</div> >- >-<p id="description"></p> >-<div id="console"></div> >- >-<script> >- >- description("This tests that aria-owns correctly exposes AXOwns and correctly returns the right elements"); >- >- if (window.accessibilityController) { >- >- var group = document.getElementById("group"); >- group.focus(); >- group = accessibilityController.focusedElement; >- shouldBe("group.ariaOwnsElementAtIndex(0).role", "'AXRole: AXButton'"); >- shouldBe("group.ariaOwnsElementAtIndex(0).title", "'AXTitle: BUTTON'"); >- shouldBe("group.ariaOwnsElementAtIndex(1).role", "'AXRole: AXRadioButton'"); >- shouldBe("group.ariaOwnsElementAtIndex(1).title", "'AXTitle: RADIO BUTTON'"); >- } >- >-</script> >- >-<script src="../../resources/js-test-post.js"></script> >-</body> >-</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 155494
:
311627
|
311644
|
311706
|
311718
|
311720
|
311755
|
311815
|
312761