Reviewed by Oliver Hunt.
ARIA: support aria-flowto
https://bugs.webkit.org/show_bug.cgi?id=31762
* platform/mac/accessibility/aria-flowto-expected.txt: Added.
* platform/mac/accessibility/aria-flowto.html: Added.
2009-11-22 Chris Fleizach <cfleizach@apple.com>
Reviewed by Oliver Hunt.
ARIA: support aria-flowto
https://bugs.webkit.org/show_bug.cgi?id=31762
Test: platform/mac/accessibility/aria-flowto.html
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::ariaOwnsElements):
(WebCore::AccessibilityObject::supportsARIAFlowTo):
(WebCore::AccessibilityObject::ariaFlowToElements):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::linkedUIElements):
(WebCore::AccessibilityRenderObject::supportsARIAFlowTo):
(WebCore::AccessibilityRenderObject::ariaFlowToElements):
* accessibility/AccessibilityRenderObject.h:
* html/HTMLAttributeNames.in:
2009-11-22 Chris Fleizach <cfleizach@apple.com>
Reviewed by Oliver Hunt.
ARIA: support aria-flowto
https://bugs.webkit.org/show_bug.cgi?id=31762
* DumpRenderTree/AccessibilityUIElement.cpp:
(ariaFlowToElementAtIndexCallback):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
(AccessibilityUIElement::ariaFlowToElementAtIndex):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::ariaFlowToElementAtIndex):
* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(AccessibilityUIElement::ariaFlowToElementAtIndex):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51304
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2009-11-22 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ ARIA: support aria-flowto
+ https://bugs.webkit.org/show_bug.cgi?id=31762
+
+ * platform/mac/accessibility/aria-flowto-expected.txt: Added.
+ * platform/mac/accessibility/aria-flowto.html: Added.
+
2009-11-22 Dirk Schulze <krit@webkit.org>
Reviewed by Nikolas Zimmermann.
--- /dev/null
+Item 1
+Item 2
+Item 3
+BUTTON
+RADIO BUTTON
+This tests that aria-flowto correctly identifies the right elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS item.ariaFlowToElementAtIndex(0).role is 'AXRole: AXButton'
+PASS item.ariaFlowToElementAtIndex(0).title is 'AXTitle: BUTTON'
+PASS item.ariaFlowToElementAtIndex(1).role is 'AXRole: AXRadioButton'
+PASS item.ariaFlowToElementAtIndex(1).title is 'AXTitle: RADIO BUTTON'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<div tabindex=0 id="item1" role="img" aria-flowto="extra extra2">Item 1</div>
+<div>Item 2</div>
+<div>Item 3</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-flowto correctly identifies the right elements.");
+
+ if (window.accessibilityController) {
+
+ var item = document.getElementById("item1");
+ item.focus();
+ item = accessibilityController.focusedElement;
+ shouldBe("item.ariaFlowToElementAtIndex(0).role", "'AXRole: AXButton'");
+ shouldBe("item.ariaFlowToElementAtIndex(0).title", "'AXTitle: BUTTON'");
+ shouldBe("item.ariaFlowToElementAtIndex(1).role", "'AXRole: AXRadioButton'");
+ shouldBe("item.ariaFlowToElementAtIndex(1).title", "'AXTitle: RADIO BUTTON'");
+ }
+
+ successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
+2009-11-22 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ ARIA: support aria-flowto
+ https://bugs.webkit.org/show_bug.cgi?id=31762
+
+ Test: platform/mac/accessibility/aria-flowto.html
+
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::ariaOwnsElements):
+ (WebCore::AccessibilityObject::supportsARIAFlowTo):
+ (WebCore::AccessibilityObject::ariaFlowToElements):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::linkedUIElements):
+ (WebCore::AccessibilityRenderObject::supportsARIAFlowTo):
+ (WebCore::AccessibilityRenderObject::ariaFlowToElements):
+ * accessibility/AccessibilityRenderObject.h:
+ * html/HTMLAttributeNames.in:
+
2009-11-22 Nikolas Zimmermann <nzimmermann@rim.com>
Not reviewed. Build fix for WML enabled builds.
static bool isARIAControl(AccessibilityRole);
static bool isARIAInput(AccessibilityRole);
virtual bool supportsARIAOwns() const { return false; }
- virtual void ariaOwnsElements(AccessibilityChildrenVector&) const { };
+ virtual void ariaOwnsElements(AccessibilityChildrenVector&) const { }
+ virtual bool supportsARIAFlowTo() const { return false; }
+ virtual void ariaFlowToElements(AccessibilityChildrenVector&) const { }
virtual AccessibilityObject* doAccessibilityHitTest(const IntPoint&) const { return 0; }
virtual AccessibilityObject* focusedUIElement() const { return 0; }
// or an internal anchor connection
void AccessibilityRenderObject::linkedUIElements(AccessibilityChildrenVector& linkedUIElements) const
{
+ ariaFlowToElements(linkedUIElements);
+
if (isAnchor()) {
AccessibilityObject* linkedAXElement = internalLinkElement();
if (linkedAXElement)
return false;
}
+bool AccessibilityRenderObject::supportsARIAFlowTo() const
+{
+ return !getAttribute(aria_flowtoAttr).string().isEmpty();
+}
+
+void AccessibilityRenderObject::ariaFlowToElements(AccessibilityChildrenVector& flowTo) const
+{
+ Vector<Element*> elements;
+ elementsFromAttribute(elements, aria_flowtoAttr);
+
+ AXObjectCache* cache = axObjectCache();
+ unsigned count = elements.size();
+ for (unsigned k = 0; k < count; ++k) {
+ Element* element = elements[k];
+ AccessibilityObject* flowToElement = cache->getOrCreate(element->renderer());
+ if (flowToElement)
+ flowTo.append(flowToElement);
+ }
+
+}
+
bool AccessibilityRenderObject::exposesTitleUIElement() const
{
if (!isControl())
virtual VisiblePositionRange visiblePositionRangeForLine(unsigned) const;
virtual IntRect boundsForVisiblePositionRange(const VisiblePositionRange&) const;
virtual void setSelectedVisiblePositionRange(const VisiblePositionRange&) const;
-
+ virtual bool supportsARIAFlowTo() const;
+ virtual void ariaFlowToElements(AccessibilityChildrenVector&) const;
+
virtual VisiblePosition visiblePositionForPoint(const IntPoint&) const;
virtual VisiblePosition visiblePositionForIndex(unsigned indexValue, bool lastIndexOK) const;
virtual int index(const VisiblePosition&) const;
aria-describedby
aria-disabled
aria-expanded
+aria-flowto
aria-hidden
aria-label
aria-labeledby
+2009-11-22 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ ARIA: support aria-flowto
+ https://bugs.webkit.org/show_bug.cgi?id=31762
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (ariaFlowToElementAtIndexCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::ariaFlowToElementAtIndex):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::ariaFlowToElementAtIndex):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::ariaFlowToElementAtIndex):
+
2009-11-22 Antonio Gomes <tonikitoo@webkit.org>
Reviewed by Kenneth Christiansen.
return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->ariaOwnsElementAtIndex(indexNumber));
}
+static JSValueRef ariaFlowToElementAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int indexNumber = 0;
+ if (argumentCount == 1)
+ indexNumber = JSValueToNumber(context, arguments[0], exception);
+
+ return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->ariaFlowToElementAtIndex(indexNumber));
+}
+
static JSValueRef selectedRowAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
int indexNumber = 0;
{ "showMenu", showMenuCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "disclosedRowAtIndex", disclosedRowAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "ariaOwnsElementAtIndex", ariaOwnsElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "ariaFlowToElementAtIndex", ariaFlowToElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "selectedRowAtIndex", selectedRowAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isEqual", isEqualCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0 }
// ARIA specific
AccessibilityUIElement ariaOwnsElementAtIndex(unsigned);
+ AccessibilityUIElement ariaFlowToElementAtIndex(unsigned);
// Parameterized attributes
int lineForIndex(int);
return 0;
}
+AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
+{
+ return 0;
+}
+
AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index)
{
return 0;
return 0;
}
+AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
+{
+ NSArray* objects = [m_element accessibilityAttributeValue:NSAccessibilityLinkedUIElementsAttribute];
+ if (index < [objects count])
+ return [objects objectAtIndex:index];
+
+ return 0;
+}
+
AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
{
NSArray* rows = [m_element accessibilityAttributeValue:NSAccessibilityDisclosedRowsAttribute];
return 0;
}
+AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
+{
+ return 0;
+}
+
AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index)
{
return 0;