<https://webkit.org/b/98350> [GTK] accessibility/aria-invalid.html times out
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Sep 2013 15:44:30 +0000 (15:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Sep 2013 15:44:30 +0000 (15:44 +0000)
Patch by Anton Obzhirov <a.obzhirov@samsung.com> on 2013-09-02
Reviewed by Mario Sanchez Prada.

Source/WebCore:

The patch exposes aria-invalid attribute to ATK.

* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
Added emitting state-change signal for aria-invalid event.
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
Added aria-invalid attribute.

Tools:

Added few mappings in DumpRenderTree and WebKitTestRunner for aria-invalid in order to get the tests run properly.

* DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp:
(axObjectEventListener):
Added mapping for invalid-entry event parameter.
* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(coreAttributeToAtkAttribute):
Added mapping to aria-invalid.
(AccessibilityUIElement::stringAttributeValue):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::coreAttributeToAtkAttribute):
Added mapping to aria-invalid.

LayoutTests:

Unskipped accessibility/aria-invalid.html which is passing now.

* platform/gtk/TestExpectations: Removed passing test.
* platform/gtk-wk2/TestExpectations: Added test timing out in WK2 only.

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

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

index efdda31bb5ac661334713609cffd15e3c71d4281..904e1d43db50fa92b6eaca5f7f3f4ced33a8f863 100644 (file)
@@ -1,3 +1,14 @@
+2013-09-02  Anton Obzhirov  <a.obzhirov@samsung.com>
+
+        <https://webkit.org/b/98350> [GTK] accessibility/aria-invalid.html times out
+
+        Reviewed by Mario Sanchez Prada.
+
+        Unskipped accessibility/aria-invalid.html which is passing now.
+
+        * platform/gtk/TestExpectations: Removed passing test.
+        * platform/gtk-wk2/TestExpectations: Added test timing out in WK2 only.
+
 2013-09-02  Ádám Kallai  <kadam@inf.u-szeged.hu>
 
         [Qt] Unreviewed gardening. Skip some failing tests.
index 782e077e0aa6d3d2a5dede09da9afe5aa84a366f..529cce7df9429a6e4bd991b8c8a65884d668c88c 100644 (file)
@@ -497,6 +497,9 @@ Bug(GTK) animations/combo-transform-translate+scale.html [ Failure ]
 Bug(GTK) animations/play-state-suspend.html [ Failure ]
 Bug(GTK) animations/suspend-resume-animation.html [ Failure ]
 
+# [GTK] Missing WTR AccessibilityUIElement::addNotificationListener implementation
+webkit.org/b/120421 accessibility/aria-invalid.html [ Timeout ]
+
 #////////////////////////////////////////////////////////////////////////////////////////
 # End of Tests failing
 #////////////////////////////////////////////////////////////////////////////////////////
index 6fa1c744b2d33c812f4bbe3d7253599522497789..e03e5d3157f30f2ac512ddf91a0de8f46738a2cb 100644 (file)
@@ -780,8 +780,6 @@ webkit.org/b/95530 http/tests/security/inactive-document-with-empty-security-ori
 # EventSender::dumpFilenameBeingDragged not implemented.
 webkit.org/b/61826 fast/events/drag-image-filename.html [ Timeout ]
 
-webkit.org/b/98350 accessibility/aria-invalid.html [ Timeout ]
-
 Bug(GTK) media/progress-events-generated-correctly.html [ Failure Timeout ]
 
 webkit.org/b/102257 fast/dom/Window/open-window-min-size.html [ Timeout ]
index de5b7d8b2226fd2b77f6c2e20f9a6aa1deb905c6..9b5239295c201907b2cbe5a93bd8081f048a0f1c 100644 (file)
@@ -1,3 +1,18 @@
+2013-09-02  Anton Obzhirov  <a.obzhirov@samsung.com>
+
+        <https://webkit.org/b/98350> [GTK] accessibility/aria-invalid.html times out
+
+        Reviewed by Mario Sanchez Prada.
+
+        The patch exposes aria-invalid attribute to ATK.
+
+        * accessibility/atk/AXObjectCacheAtk.cpp:
+        (WebCore::AXObjectCache::postPlatformNotification):
+        Added emitting state-change signal for aria-invalid event.
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (webkitAccessibleGetAttributes):
+        Added aria-invalid attribute.
+
 2013-09-02  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r154955.
index 51465416ae1a49f195bff8cc97d1ac1be650c22c..154237de0ec77e8ed128848f8b6213124af83789 100644 (file)
@@ -164,7 +164,8 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* coreObject, AX
         atk_value_get_current_value(ATK_VALUE(axObject), &propertyValues.new_value);
 
         g_signal_emit_by_name(ATK_OBJECT(axObject), "property-change::accessible-value", &propertyValues, NULL);
-    }
+    } else if (notification == AXInvalidStatusChanged)
+        g_signal_emit_by_name(axObject, "state-change", "invalid-entry", coreObject->invalidStatus() != "false");
 }
 
 void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject* object, AXTextChange textChange, unsigned offset, const String& text)
index 839e94ebe431541af5da8515449859844757b860..26d4785095f2ebaf45d24059584d0d8d11d7abf1 100644 (file)
@@ -498,6 +498,10 @@ static AtkAttributeSet* webkitAccessibleGetAttributes(AtkObject* object)
     if (coreObject->ariaHasPopup())
         attributeSet = addToAtkAttributeSet(attributeSet, "aria-haspopup", "true");
 
+    String invalidStatus = coreObject->invalidStatus().string();
+    if (!invalidStatus.isEmpty() && invalidStatus != "false")
+        attributeSet = addToAtkAttributeSet(attributeSet, "aria-invalid", coreObject->invalidStatus().string().utf8().data());
+
     return attributeSet;
 }
 
index c1ab3873b7707fcc43d39aa2692c8c6cba063332..cd6640b4c49263be9f013f768d12c6fac0960857 100644 (file)
@@ -1,3 +1,22 @@
+2013-09-02  Anton Obzhirov  <a.obzhirov@samsung.com>
+
+        <https://webkit.org/b/98350> [GTK] accessibility/aria-invalid.html times out
+
+        Reviewed by Mario Sanchez Prada.
+
+        Added few mappings in DumpRenderTree and WebKitTestRunner for aria-invalid in order to get the tests run properly.
+
+        * DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp:
+        (axObjectEventListener):
+        Added mapping for invalid-entry event parameter.
+        * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
+        (coreAttributeToAtkAttribute):
+        Added mapping to aria-invalid.
+        (AccessibilityUIElement::stringAttributeValue):
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::coreAttributeToAtkAttribute):
+        Added mapping to aria-invalid.
+
 2013-09-02  Nick Diego Yamane  <nick.yamane@openbossa.org>
 
         Save md5 correctly when jhbuildPath doesn't exist yet
index 33625da03d3172e83a785bbd289f0c5cfc85a3eb..39e0bd404a260cbc69fdd3cf77a9c5759c19124c 100644 (file)
@@ -101,6 +101,8 @@ static gboolean axObjectEventListener(GSignalInvocationHint *signalHint, guint n
         signalValue.set(g_strdup_printf("%d", g_value_get_boolean(&paramValues[2])));
         if (!g_strcmp0(g_value_get_string(&paramValues[1]), "checked"))
             notificationName = "CheckedStateChanged";
+        else if (!g_strcmp0(g_value_get_string(&paramValues[1]), "invalid-entry"))
+            notificationName = "AXInvalidStatusChanged";
     } else if (!g_strcmp0(signalQuery.signal_name, "focus-event")) {
         signalName.set(g_strdup("focus-event"));
         signalValue.set(g_strdup_printf("%d", g_value_get_boolean(&paramValues[1])));
index e7ddb393b59883240a3d8af099ac5d9cce412939..c928220f9e9b159d0426949b7a1372d31c376ba3 100644 (file)
@@ -48,10 +48,13 @@ static String coreAttributeToAtkAttribute(JSStringRef attribute)
     JSStringGetUTF8CString(attribute, buffer.get(), bufferSize);
 
     String attributeString = String::fromUTF8(buffer.get());
+    if (attributeString == "AXInvalid")
+        return "aria-invalid";
+
     if (attributeString == "AXPlaceholderValue")
         return "placeholder-text";
 
-    return "";
+    return String();
 }
 
 static String getAttributeSetValueForId(AtkObject* accessible, const char* id)
@@ -887,6 +890,13 @@ JSStringRef AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
         return JSStringCreateWithCharacters(0, 0);
 
     String attributeValue = getAttributeSetValueForId(ATK_OBJECT(m_element), atkAttributeName.utf8().data());
+
+    // In case of 'aria-invalid' when the attribute empty or has "false" for ATK
+    // according to http://www.w3.org/WAI/PF/aria-implementation/#mapping attribute
+    // is not mapped but layout tests will expect 'false'.
+    if (attributeValue.isEmpty() && atkAttributeName == "aria-invalid")
+        return JSStringCreateWithUTF8CString("false");
+
     return JSStringCreateWithUTF8CString(attributeValue.utf8().data());
 }
 
index a44ad463eac547cdde71b85933778816621308fb..0a5972ddc301d0d6317f90566fd48a69c70dd4a7 100644 (file)
@@ -52,7 +52,13 @@ static String coreAttributeToAtkAttribute(JSStringRef attribute)
     JSStringGetUTF8CString(attribute, buffer.get(), bufferSize);
 
     String attributeString = String::fromUTF8(buffer.get());
-    return attributeString == "AXPlaceholderValue" ? "placeholder-text" : String();
+    if (attributeString == "AXInvalid")
+        return "aria-invalid";
+
+    if (attributeString == "AXPlaceholderValue")
+        return "placeholder-text";
+
+    return String();
 }
 
 static String getAttributeSetValueForId(AtkObject* accessible, const char* id)