[GTK] accessibility/aria-scrollbar-role.html is failing
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2013 08:12:15 +0000 (08:12 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2013 08:12:15 +0000 (08:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=98358

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-03-20
Reviewed by Martin Robinson.

Source/WebCore:

Adds support for checking an orientation attribute of accessibility object.
AccessibilityObject that represents ScrollBar element should be ATK_VALUE type.
ScrollBar element can be considered as a Range Widget that is able to expose some
range values.

Test: accessibility/aria-scrollbar-role.html

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkStateSetFromCoreObject):
(getInterfaceMaskFromObject):

Tools:

Adds support for checking accessibility object's orientation.
Orientation is checked by retrieving proper state of accessibility object.

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

LayoutTests:

Fixed failing test.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146312 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Tools/ChangeLog
Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp

index ffa7f8e6c5518861a992f429316b901ab14c5eec..a7bd0a856c947b7e452f370181fc47e119ed810c 100644 (file)
@@ -1,3 +1,14 @@
+2013-03-20  Krzysztof Czech  <k.czech@samsung.com>
+
+        [GTK] accessibility/aria-scrollbar-role.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=98358
+
+        Reviewed by Martin Robinson.
+
+        Fixed failing test.
+
+        * platform/gtk/TestExpectations:
+
 2013-03-20  Zan Dobersek  <zdobersek@igalia.com>
 
         Unreviewed GTK gardening. Rebaselining after r146305.
index ef39ed763d40dce7352745ec47f16ce4e0695a72..8c1918bf67e8edac10737534a28907853812de36 100644 (file)
@@ -790,7 +790,6 @@ webkit.org/b/79757 fast/selectors/selection-window-inactive.html [ ImageOnlyFail
 
 webkit.org/b/98355 accessibility/aria-link-supports-press.html [ Failure ]
 webkit.org/b/98357 accessibility/aria-readonly.html [ Failure ]
-webkit.org/b/98358 accessibility/aria-scrollbar-role.html [ Failure ]
 webkit.org/b/98359 accessibility/aria-text-role.html [ Failure ]
 webkit.org/b/98360 accessibility/aria-used-on-image-maps.html [ Failure ]
 webkit.org/b/98361 accessibility/button-press-action.html [ Failure ]
index e6234d5d168052a6340e6dc72cd1a51d8c3d306b..0ff58a094577a8c50b843d03adc8e409bd2e8ce9 100644 (file)
@@ -1,3 +1,21 @@
+2013-03-20  Krzysztof Czech  <k.czech@samsung.com>
+
+        [GTK] accessibility/aria-scrollbar-role.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=98358
+
+        Reviewed by Martin Robinson.
+
+        Adds support for checking an orientation attribute of accessibility object.
+        AccessibilityObject that represents ScrollBar element should be ATK_VALUE type.
+        ScrollBar element can be considered as a Range Widget that is able to expose some
+        range values.
+
+        Test: accessibility/aria-scrollbar-role.html
+
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (setAtkStateSetFromCoreObject):
+        (getInterfaceMaskFromObject):
+
 2013-03-20  Zan Dobersek  <zdobersek@igalia.com>
 
         Unreviewed. Fixing a typo in libLevelDB_la_CFLAGS assignment - cxflags -> cflags.
index 90add83c846e158d7b3936c60a99ccb2337978f6..5103e74e53fc0daff0764ea003029ed2651b3858 100644 (file)
@@ -695,7 +695,10 @@ static void setAtkStateSetFromCoreObject(AccessibilityObject* coreObject, AtkSta
     if (coreObject->isFocused() || isTextWithCaret(coreObject))
         atk_state_set_add_state(stateSet, ATK_STATE_FOCUSED);
 
-    // TODO: ATK_STATE_HORIZONTAL
+    if (coreObject->orientation() == AccessibilityOrientationHorizontal)
+        atk_state_set_add_state(stateSet, ATK_STATE_HORIZONTAL);
+    else if (coreObject->orientation() == AccessibilityOrientationVertical)
+        atk_state_set_add_state(stateSet, ATK_STATE_VERTICAL);
 
     if (coreObject->isIndeterminate())
         atk_state_set_add_state(stateSet, ATK_STATE_INDETERMINATE);
@@ -745,8 +748,6 @@ static void setAtkStateSetFromCoreObject(AccessibilityObject* coreObject, AtkSta
 
     // TODO: ATK_STATE_SENSITIVE
 
-    // TODO: ATK_STATE_VERTICAL
-
     if (coreObject->isVisited())
         atk_state_set_add_state(stateSet, ATK_STATE_VISITED);
 }
@@ -977,7 +978,7 @@ static guint16 getInterfaceMaskFromObject(AccessibilityObject* coreObject)
         interfaceMask |= 1 << WAI_DOCUMENT;
 
     // Value
-    if (role == SliderRole || role == SpinButtonRole)
+    if (role == SliderRole || role == SpinButtonRole || role == ScrollBarRole)
         interfaceMask |= 1 << WAI_VALUE;
 
     return interfaceMask;
index e50f658dbd9ab5ce8eb6a3345ccf686840ec45f0..8d67f7bfe8697d855915dcb435d1527eb4ba7946 100644 (file)
@@ -1,3 +1,19 @@
+2013-03-20  Krzysztof Czech  <k.czech@samsung.com>
+
+        [GTK] accessibility/aria-scrollbar-role.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=98358
+
+        Reviewed by Martin Robinson.
+
+        Adds support for checking accessibility object's orientation.
+        Orientation is checked by retrieving proper state of accessibility object.
+
+        * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
+        (checkElementState):
+        (AccessibilityUIElement::orientation):
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::AccessibilityUIElement::orientation):
+
 2013-03-19  Jochen Eisinger  <jochen@chromium.org>
 
         [chromium] move WebThemeEngine implementations to TestRunner library
index 2047b3e3f6a363b047231ae3aad7d2ffb5468a3a..00157231ea193b1f14c3bf8de6a6981b20a72312 100644 (file)
@@ -175,6 +175,15 @@ static inline gchar* replaceCharactersForResults(gchar* str)
     return g_strdup(uString.utf8().data());
 }
 
+static bool checkElementState(PlatformUIElement element, AtkStateType stateType)
+{
+    if (!ATK_IS_OBJECT(element))
+        return false;
+
+    GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(element)));
+    return atk_state_set_contains_state(stateSet.get(), stateType);
+}
+
 AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
     : m_element(element)
 {
@@ -490,7 +499,19 @@ double AccessibilityUIElement::clickPointY()
 
 JSStringRef AccessibilityUIElement::orientation() const
 {
-    return 0;
+    if (!m_element || !ATK_IS_OBJECT(m_element))
+        return JSStringCreateWithCharacters(0, 0);
+
+    const char* axOrientation = 0;
+    if (checkElementState(m_element, ATK_STATE_HORIZONTAL))
+        axOrientation = "AXOrientation: AXHorizontalOrientation";
+    else if (checkElementState(m_element, ATK_STATE_VERTICAL))
+        axOrientation = "AXOrientation: AXVerticalOrientation";
+
+    if (!axOrientation)
+        return JSStringCreateWithCharacters(0, 0);
+
+    return JSStringCreateWithUTF8CString(axOrientation);
 }
 
 double AccessibilityUIElement::intValue() const
@@ -539,15 +560,6 @@ JSStringRef AccessibilityUIElement::valueDescription()
     return JSStringCreateWithCharacters(0, 0);
 }
 
-static bool checkElementState(PlatformUIElement element, AtkStateType stateType)
-{
-    if (!ATK_IS_OBJECT(element))
-        return false;
-
-    GRefPtr<AtkStateSet> stateSet = adoptGRef(atk_object_ref_state_set(ATK_OBJECT(element)));
-    return atk_state_set_contains_state(stateSet.get(), stateType);
-}
-
 bool AccessibilityUIElement::isEnabled()
 {
     return checkElementState(m_element, ATK_STATE_ENABLED);
index 26d58853af102b7f022eaa64f135736570d66852..361d11b91a7676b0d309fc29e40f32c87bd936f9 100644 (file)
@@ -541,8 +541,19 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::description()
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const
 {
-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
+    if (!m_element || !ATK_IS_OBJECT(m_element))
+        return JSStringCreateWithCharacters(0, 0);
+
+    const gchar* axOrientation = 0;
+    if (checkElementState(m_element, ATK_STATE_HORIZONTAL))
+        axOrientation = "AXOrientation: AXHorizontalOrientation";
+    else if (checkElementState(m_element, ATK_STATE_VERTICAL))
+        axOrientation = "AXOrientation: AXVerticalOrientation";
+
+    if (!axOrientation)
+        return JSStringCreateWithCharacters(0, 0);
+
+    return JSStringCreateWithUTF8CString(axOrientation);
 }
 
 JSRetainPtr<JSStringRef> AccessibilityUIElement::stringValue()