Commit 22545813 authored by k.czech@samsung.com's avatar k.czech@samsung.com
Browse files

[ATK] Expose aria-flowto through ATK_RELATION_FLOWS_TO

https://bugs.webkit.org/show_bug.cgi?id=127291

Reviewed by Mario Sanchez Prada.

Source/WebCore:

Test: accessibility/aria-flowto.html

Expose aria-flowto through ATK_RELATION_FLOWS_TO according to
http://www.w3.org/TR/wai-aria-implementation/#mapping_state-property

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkRelationSetFromCoreObject):

Tools:

Implemented AccessibilityUIElement::ariaFlowToElementAtIndex method.

* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(AccessibilityUIElement::ariaFlowToElementAtIndex):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::ariaFlowToElementAtIndex):

LayoutTests:

Share aria-flowto.html with other ports. It passes on GTK and EFL.

* accessibility/aria-flowto-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/aria-flowto-expected.txt.
* accessibility/aria-flowto.html: Renamed from LayoutTests/platform/mac/accessibility/aria-flowto.html.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 050410ab
2014-01-21 Krzysztof Czech <k.czech@samsung.com>
[ATK] Expose aria-flowto through ATK_RELATION_FLOWS_TO
https://bugs.webkit.org/show_bug.cgi?id=127291
Reviewed by Mario Sanchez Prada.
Share aria-flowto.html with other ports. It passes on GTK and EFL.
* accessibility/aria-flowto-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/aria-flowto-expected.txt.
* accessibility/aria-flowto.html: Renamed from LayoutTests/platform/mac/accessibility/aria-flowto.html.
2014-01-20 Zalan Bujtas <zalan@apple.com>
 
Change image failures from [ Failure ] to [ ImageOnlyFailure ] where needed.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/js-test-pre.js"></script>
</head>
<body id="body">
......@@ -32,6 +32,6 @@
</script>
<script src="../../../resources/js-test-post.js"></script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>
2014-01-21 Krzysztof Czech <k.czech@samsung.com>
[ATK] Expose aria-flowto through ATK_RELATION_FLOWS_TO
https://bugs.webkit.org/show_bug.cgi?id=127291
Reviewed by Mario Sanchez Prada.
Test: accessibility/aria-flowto.html
Expose aria-flowto through ATK_RELATION_FLOWS_TO according to
http://www.w3.org/TR/wai-aria-implementation/#mapping_state-property
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkRelationSetFromCoreObject):
2014-01-20 Ryuan Choi <ryuan.choi@samsung.com>
 
[CMAKE] Remove Nix from CMake scripts
......@@ -236,6 +236,15 @@ static void setAtkRelationSetFromCoreObject(AccessibilityObject* coreObject, Atk
if (control)
atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABEL_FOR, control->wrapper());
}
// Check whether object supports aria-flowto
if (coreObject->supportsARIAFlowTo()) {
removeAtkRelationByType(relationSet, ATK_RELATION_FLOWS_TO);
AccessibilityObject::AccessibilityChildrenVector ariaFlowToElements;
coreObject->ariaFlowToElements(ariaFlowToElements);
for (const auto& accessibilityObject : ariaFlowToElements)
atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_FLOWS_TO, accessibilityObject->wrapper());
}
}
static gpointer webkitAccessibleParentClass = 0;
......
2014-01-21 Krzysztof Czech <k.czech@samsung.com>
[ATK] Expose aria-flowto through ATK_RELATION_FLOWS_TO
https://bugs.webkit.org/show_bug.cgi?id=127291
Reviewed by Mario Sanchez Prada.
Implemented AccessibilityUIElement::ariaFlowToElementAtIndex method.
* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(AccessibilityUIElement::ariaFlowToElementAtIndex):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::ariaFlowToElementAtIndex):
2014-01-20 Zalan Bujtas <zalan@apple.com>
 
Force float division when calculating CSS px value.
......
......@@ -1315,7 +1315,25 @@ AccessibilityUIElement AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned i
AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
{
return nullptr;
if (!ATK_IS_OBJECT(m_element))
return nullptr;
AtkRelationSet* relationSet = atk_object_ref_relation_set(ATK_OBJECT(m_element));
if (!relationSet)
return nullptr;
AtkRelation* relation = atk_relation_set_get_relation_by_type(relationSet, ATK_RELATION_FLOWS_TO);
if (!relation)
return nullptr;
GPtrArray* targetList = atk_relation_get_target(relation);
if (!targetList || !targetList->len || index >= targetList->len)
return nullptr;
g_object_unref(relationSet);
AtkObject* target = static_cast<AtkObject*>(g_ptr_array_index(targetList, index));
return target ? AccessibilityUIElement(target) : nullptr;
}
AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index)
......
......@@ -656,8 +656,25 @@ PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaOwnsElementAtInde
PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
{
// FIXME: implement
return nullptr;
if (!ATK_IS_OBJECT(m_element.get()))
return nullptr;
AtkRelationSet* relationSet = atk_object_ref_relation_set(ATK_OBJECT(m_element.get()));
if (!relationSet)
return nullptr;
AtkRelation* relation = atk_relation_set_get_relation_by_type(relationSet, ATK_RELATION_FLOWS_TO);
if (!relation)
return nullptr;
GPtrArray* targetList = atk_relation_get_target(relation);
if (!targetList || !targetList->len || index >= targetList->len)
return nullptr;
g_object_unref(relationSet);
AtkObject* target = static_cast<AtkObject*>(g_ptr_array_index(targetList, index));
return target ? AccessibilityUIElement::create(target) : nullptr;
}
PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment