Title: [137099] trunk
Revision
137099
Author
[email protected]
Date
2012-12-09 17:09:32 -0800 (Sun, 09 Dec 2012)

Log Message

[GTK] accessibility/placeholder.html is failing
https://bugs.webkit.org/show_bug.cgi?id=98373

Patch by Joanmarie Diggs <[email protected]> on 2012-12-09
Reviewed by Martin Robinson.

The test was failing because the placeholder text was not supported and
AccessibilityUIElement::stringAttributeValue() was not implemented.

Source/WebCore:

No new tests; instead the failing test was unskipped.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes): Add the placeholder text as an AtkAttribute
of the AtkObject, as is done in Gtk+ 3.

Tools:

* DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
(coreAttributeToAtkAttribute): New convenience method to convert WebCore attribute
names into AtkObject attribute names
(AccessibilityUIElement::stringAttributeValue): implemented

LayoutTests:

* platform/gtk/TestExpectations: Unskip the failing test

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (137098 => 137099)


--- trunk/LayoutTests/ChangeLog	2012-12-09 22:56:50 UTC (rev 137098)
+++ trunk/LayoutTests/ChangeLog	2012-12-10 01:09:32 UTC (rev 137099)
@@ -1,3 +1,15 @@
+2012-12-09  Joanmarie Diggs  <[email protected]>
+
+        [GTK] accessibility/placeholder.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=98373
+
+        Reviewed by Martin Robinson.
+
+        The test was failing because the placeholder text was not supported and
+        AccessibilityUIElement::stringAttributeValue() was not implemented.
+
+        * platform/gtk/TestExpectations: Unskip the failing test
+
 2012-12-09  Zan Dobersek  <[email protected]>
 
         Unreviewed GTK gardening.

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (137098 => 137099)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2012-12-09 22:56:50 UTC (rev 137098)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2012-12-10 01:09:32 UTC (rev 137099)
@@ -750,7 +750,6 @@
 webkit.org/b/98370 accessibility/loading-iframe-sends-notification.html [ Failure ]
 webkit.org/b/98371 accessibility/loading-iframe-updates-axtree.html [ Failure ]
 webkit.org/b/98372 accessibility/onclick-handlers.html [ Failure ]
-webkit.org/b/98373 accessibility/placeholder.html [ Failure ]
 webkit.org/b/98375 accessibility/secure-textfield-title-ui.html [ Failure ]
 webkit.org/b/98376 accessibility/selection-states.html [ Failure ]
 webkit.org/b/101185 accessibility/svg-remote-element.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (137098 => 137099)


--- trunk/Source/WebCore/ChangeLog	2012-12-09 22:56:50 UTC (rev 137098)
+++ trunk/Source/WebCore/ChangeLog	2012-12-10 01:09:32 UTC (rev 137099)
@@ -1,3 +1,19 @@
+2012-12-09  Joanmarie Diggs  <[email protected]>
+
+        [GTK] accessibility/placeholder.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=98373
+
+        Reviewed by Martin Robinson.
+
+        The test was failing because the placeholder text was not supported and
+        AccessibilityUIElement::stringAttributeValue() was not implemented.
+
+        No new tests; instead the failing test was unskipped.
+
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (webkitAccessibleGetAttributes): Add the placeholder text as an AtkAttribute
+        of the AtkObject, as is done in Gtk+ 3.
+
 2012-12-09  Kondapally Kalyan  <[email protected]>
 
         [EFL] [WebGL] Path is not resized correctly.

Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp (137098 => 137099)


--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2012-12-09 22:56:50 UTC (rev 137098)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2012-12-10 01:09:32 UTC (rev 137099)
@@ -455,6 +455,10 @@
     if (coreObject->isAccessibilityTable() && !coreObject->isDataTable())
         attributeSet = addToAtkAttributeSet(attributeSet, "layout-guess", "true");
 
+    String placeholder = coreObject->placeholderValue();
+    if (!placeholder.isEmpty())
+        attributeSet = addToAtkAttributeSet(attributeSet, "placeholder-text", placeholder.utf8().data());
+
     return attributeSet;
 }
 

Modified: trunk/Tools/ChangeLog (137098 => 137099)


--- trunk/Tools/ChangeLog	2012-12-09 22:56:50 UTC (rev 137098)
+++ trunk/Tools/ChangeLog	2012-12-10 01:09:32 UTC (rev 137099)
@@ -1,3 +1,18 @@
+2012-12-09  Joanmarie Diggs  <[email protected]>
+
+        [GTK] accessibility/placeholder.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=98373
+
+        Reviewed by Martin Robinson.
+
+        The test was failing because the placeholder text was not supported and
+        AccessibilityUIElement::stringAttributeValue() was not implemented.
+
+        * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+        (coreAttributeToAtkAttribute): New convenience method to convert WebCore attribute
+        names into AtkObject attribute names
+        (AccessibilityUIElement::stringAttributeValue): implemented
+
 2012-12-09  Dan Winship  <[email protected]>
 
         [GTK] Bump libxml2 requirement in jhbuild.modules

Modified: trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp (137098 => 137099)


--- trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp	2012-12-09 22:56:50 UTC (rev 137098)
+++ trunk/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp	2012-12-10 01:09:32 UTC (rev 137099)
@@ -37,6 +37,19 @@
 #include <wtf/text/WTFString.h>
 #include <wtf/unicode/CharacterNames.h>
 
+static String coreAttributeToAtkAttribute(JSStringRef attribute)
+{
+    size_t bufferSize = JSStringGetMaximumUTF8CStringSize(attribute);
+    GOwnPtr<gchar> buffer(static_cast<gchar*>(g_malloc(bufferSize)));
+    JSStringGetUTF8CString(attribute, buffer.get(), bufferSize);
+
+    String attributeString = String::fromUTF8(buffer.get());
+    if (attributeString == "AXPlaceholderValue")
+        return "placeholder-text";
+
+    return "";
+}
+
 static inline String roleToString(AtkRole role)
 {
     switch (role) {
@@ -764,7 +777,19 @@
 
 JSStringRef AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
 {
-    // FIXME: implement
+    if (!m_element)
+        return JSStringCreateWithCharacters(0, 0);
+
+    String atkAttributeName = coreAttributeToAtkAttribute(attribute);
+    if (atkAttributeName.isEmpty())
+        return JSStringCreateWithCharacters(0, 0);
+
+    for (GSList* atkAttributes = atk_object_get_attributes(ATK_OBJECT(m_element)); atkAttributes; atkAttributes = atkAttributes->next) {
+        AtkAttribute* atkAttribute = static_cast<AtkAttribute*>(atkAttributes->data);
+        if (!strcmp(atkAttribute->name, atkAttributeName.utf8().data()))
+            return JSStringCreateWithUTF8CString(atkAttribute->value);
+    }
+
     return JSStringCreateWithCharacters(0, 0);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to