Title: [157096] trunk
Revision
157096
Author
ma...@webkit.org
Date
2013-10-08 03:55:25 -0700 (Tue, 08 Oct 2013)

Log Message

[ATK] Expose state of aria-invalid as ATK_STATE_INVALID_ENTRY
https://bugs.webkit.org/show_bug.cgi?id=122104

Reviewed by Chris Fleizach.

Source/WebCore:

Map invalid state of an AccessibilityObject to the proper AtkState.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkStateSetFromCoreObject): Add the mapping.

Tools:

Updated stringAttributeValue to double check that the exposure of
aria-invalid as a state is consistent with its exposure as a text
attribute as well, when it applies (implementations of AtkText).

* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(AccessibilityUIElement::stringAttributeValue): Add double check.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::stringAttributeValue): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (157095 => 157096)


--- trunk/Source/WebCore/ChangeLog	2013-10-08 10:45:36 UTC (rev 157095)
+++ trunk/Source/WebCore/ChangeLog	2013-10-08 10:55:25 UTC (rev 157096)
@@ -1,3 +1,15 @@
+2013-10-08  Mario Sanchez Prada  <mario.pr...@samsung.com>
+
+        [ATK] Expose state of aria-invalid as ATK_STATE_INVALID_ENTRY
+        https://bugs.webkit.org/show_bug.cgi?id=122104
+
+        Reviewed by Chris Fleizach.
+
+        Map invalid state of an AccessibilityObject to the proper AtkState.
+
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (setAtkStateSetFromCoreObject): Add the mapping.
+
 2013-10-07  Carlos Garcia Campos  <cgar...@igalia.com>
 
 

Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp (157095 => 157096)


--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2013-10-08 10:45:36 UTC (rev 157095)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2013-10-08 10:55:25 UTC (rev 157096)
@@ -725,6 +725,9 @@
     if (coreObject->isIndeterminate())
         atk_state_set_add_state(stateSet, ATK_STATE_INDETERMINATE);
 
+    if (coreObject->invalidStatus() != "false")
+        atk_state_set_add_state(stateSet, ATK_STATE_INVALID_ENTRY);
+
     if (coreObject->isMultiSelectable())
         atk_state_set_add_state(stateSet, ATK_STATE_MULTISELECTABLE);
 

Modified: trunk/Tools/ChangeLog (157095 => 157096)


--- trunk/Tools/ChangeLog	2013-10-08 10:45:36 UTC (rev 157095)
+++ trunk/Tools/ChangeLog	2013-10-08 10:55:25 UTC (rev 157096)
@@ -1,3 +1,19 @@
+2013-10-08  Mario Sanchez Prada  <mario.pr...@samsung.com>
+
+        [ATK] Expose state of aria-invalid as ATK_STATE_INVALID_ENTRY
+        https://bugs.webkit.org/show_bug.cgi?id=122104
+
+        Reviewed by Chris Fleizach.
+
+        Updated stringAttributeValue to double check that the exposure of
+        aria-invalid as a state is consistent with its exposure as a text
+        attribute as well, when it applies (implementations of AtkText).
+
+        * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
+        (AccessibilityUIElement::stringAttributeValue): Add double check.
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::AccessibilityUIElement::stringAttributeValue): Ditto.
+
 2013-10-07  Filip Pizlo  <fpi...@apple.com>
 
         run-jsc-stress-tests progress meter should update more quickly on older Rubies

Modified: trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp (157095 => 157096)


--- trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp	2013-10-08 10:45:36 UTC (rev 157095)
+++ trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp	2013-10-08 10:55:25 UTC (rev 157096)
@@ -1038,6 +1038,20 @@
     if (attributeValue.isEmpty() && ATK_IS_TEXT(m_element))
         attributeValue = getAttributeSetValueForId(ATK_OBJECT(m_element), TextAttributeType, atkAttributeName);
 
+    // Additional check to make sure that the exposure of the state ATK_STATE_INVALID_ENTRY
+    // is consistent with the exposure of aria-invalid as a text attribute, if present.
+    if (atkAttributeName == attributesMap[InvalidNameIndex][AtkDomain]) {
+        bool isInvalidState = checkElementState(m_element, ATK_STATE_INVALID_ENTRY);
+        if (attributeValue.isEmpty())
+            return JSStringCreateWithUTF8CString(isInvalidState ? "true" : "false");
+
+        // If the text attribute was there, check that it's consistent with
+        // what the state says or force the test to fail otherwise.
+        bool isAriaInvalid = attributeValue != "false";
+        if (isInvalidState != isAriaInvalid)
+            return JSStringCreateWithCharacters(0, 0);
+    }
+
     return JSStringCreateWithUTF8CString(attributeValue.utf8().data());
 }
 

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (157095 => 157096)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp	2013-10-08 10:45:36 UTC (rev 157095)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp	2013-10-08 10:55:25 UTC (rev 157096)
@@ -658,6 +658,20 @@
     if (attributeValue.isEmpty() && ATK_IS_TEXT(m_element.get()))
         attributeValue = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), TextAttributeType, atkAttributeName);
 
+    // Additional check to make sure that the exposure of the state ATK_STATE_INVALID_ENTRY
+    // is consistent with the exposure of aria-invalid as a text attribute, if present.
+    if (atkAttributeName == attributesMap[InvalidNameIndex][AtkDomain]) {
+        bool isInvalidState = checkElementState(m_element.get(), ATK_STATE_INVALID_ENTRY);
+        if (attributeValue.isEmpty())
+            return JSStringCreateWithUTF8CString(isInvalidState ? "true" : "false");
+
+        // If the text attribute was there, check that it's consistent with
+        // what the state says or force the test to fail otherwise.
+        bool isAriaInvalid = attributeValue != "false";
+        if (isInvalidState != isAriaInvalid)
+            return JSStringCreateWithCharacters(0, 0);
+    }
+
     return JSStringCreateWithUTF8CString(attributeValue.utf8().data());
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to