Title: [201270] releases/WebKitGTK/webkit-2.12
Revision
201270
Author
carlo...@webkit.org
Date
2016-05-23 04:03:44 -0700 (Mon, 23 May 2016)

Log Message

Merge r200677 - [GTK] accessibility/aria-readonly.html is failing
https://bugs.webkit.org/show_bug.cgi?id=98357

Reviewed by Chris Fleizach.

Source/WebCore:

Add support for ATK_STATE_READ_ONLY and expose the value of aria-readonly
as an AtkObject attribute. In order to eliminate duplicate checks, remove
isReadOnly() and just use canSetAttributeValue(), moving all the logic into
AccessibilityNodeObject. Add AccessibilityObject::supportsARIAReadOnly() so
that we can explicitly expose the implicit value for aria-readonly on roles
which support this property. Also add support for ATK_STATE_CHECKABLE, both
because this state was missing and because it serves a similar function to
ATK_STATE_EDITABLE for the purpose of verifying exposure of toggle-able
elements that are not read-only.

Test: accessibility/form-control-value-settable.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetValueAttribute):
(WebCore::AccessibilityNodeObject::isRequired): Deleted.
(WebCore::AccessibilityNodeObject::supportsRequiredAttribute): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIAReadOnly):
(WebCore::AccessibilityObject::ariaReadOnlyValue):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isUnvisited): Deleted.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::clickPoint):
(WebCore::AccessibilityRenderObject::isOffScreen): Deleted.
(WebCore::AccessibilityRenderObject::anchorElement): Deleted.
(WebCore::AccessibilityRenderObject::internalLinkElement): Deleted.
(WebCore::AccessibilityRenderObject::textChanged): Deleted.
(WebCore::AccessibilityRenderObject::clearChildren): Deleted.
(WebCore::AccessibilityRenderObject::addImageMapChildren): Deleted.
* accessibility/AccessibilityRenderObject.h:
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getAttributeSetForAccessibilityObject):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(setAtkStateSetFromCoreObject):
(getInterfaceMaskFromObject):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

Source/WebKit/win:

Call AccessibilityNode::canSetValueAttribute() to determine if STATE_SYSTEM_READONLY
should be added and if editable text should be supported.

* AccessibleBase.cpp:
(AccessibleBase::state):
* AccessibleTextImpl.cpp:
(AccessibleText::deleteText):
(AccessibleText::insertText):
(AccessibleText::cutText):
(AccessibleText::pasteText):
(AccessibleText::replaceText):

Tools:

Add checks to isAttributeSettable() for ATK_STATE_READ_ONLY and the 'readonly'
AtkObject attribute along with ATK_STATE_CHECKABLE for toggle-able elements,
ATK_STATE_SELECTABLE for select elements, and ATK_STATE_FOCUSABLE combined
with range verification for inputs which implement AtkValue. The latter two
additions are admittedly a heuristic workaround for platform accessibility
API differences. But they should be sufficient to facilitate cross-platform
testing of isAttributeSettable() for form elements which lack ARIA attributes.

Bump the minimum version of at-spi2-core and at-spi2-atk
to 2.15.4 (earliest version that supports STATE_READ_ONLY).

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::isAttributeSettable):
* gtk/jhbuild.modules:

LayoutTests:

As part of this change, a new AtkObject attribute and state are being exposed.
Update two tests accordingly. Also unskip the previously-failing test. Lastly,
move the Mac form-control-value-settable.html test to the shared test set,
with a minor tweak to check the platform for several elements' expectations.

* accessibility/form-control-value-settable.html: Moved to shared tests.
* accessibility/gtk/xml-roles-exposed-expected.txt: Updated.
* platform/gtk/TestExpectations: Unskipped previously-failing test.
* platform/gtk/accessibility/form-control-value-settable-expected.txt: Added.
* platform/gtk/accessibility/table-detection-expected.txt: Updated.
* platform/mac/accessibility/form-control-value-settable-expected.txt: Moved.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-05-23 11:03:44 UTC (rev 201270)
@@ -1,3 +1,22 @@
+2016-05-11  Joanmarie Diggs  <jdi...@igalia.com>
+
+        [GTK] accessibility/aria-readonly.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=98357
+
+        Reviewed by Chris Fleizach.
+
+        As part of this change, a new AtkObject attribute and state are being exposed.
+        Update two tests accordingly. Also unskip the previously-failing test. Lastly,
+        move the Mac form-control-value-settable.html test to the shared test set,
+        with a minor tweak to check the platform for several elements' expectations.
+
+        * accessibility/form-control-value-settable.html: Moved to shared tests.
+        * accessibility/gtk/xml-roles-exposed-expected.txt: Updated.
+        * platform/gtk/TestExpectations: Unskipped previously-failing test.
+        * platform/gtk/accessibility/form-control-value-settable-expected.txt: Added.
+        * platform/gtk/accessibility/table-detection-expected.txt: Updated.
+        * platform/mac/accessibility/form-control-value-settable-expected.txt: Moved.
+
 2016-05-03  Joanmarie Diggs  <jdi...@igalia.com>
 
         [ATK] accessibility/content-editable-as-textarea.html fails

Copied: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/form-control-value-settable.html (from rev 201269, releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/mac/form-control-value-settable.html) (0 => 201270)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/form-control-value-settable.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/form-control-value-settable.html	2016-05-23 11:03:44 UTC (rev 201270)
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<script src=""
+
+<div>
+  <input id="text1" type="text" value="Value">
+  <input id="checkbox1" type="checkbox" checked>
+  <input id="number1" type="number" value="123">
+  <input id="radio1" type="radio" checked>
+  <input id="slider1" type="range" min="1" max="10" value="5">
+  <input id="submit1" type="submit">
+  <select id="combobox1"><option>1<option selected>2</select>
+  <select multiple id="listbox1"><option>1<option selected>2</select>
+  <textarea id="textarea1">Textarea</textarea>
+</div>
+
+<div contentEditable>
+  <input id="text2" type="text" value="Value">
+  <input id="checkbox2" type="checkbox" checked>
+  <input id="number2" type="number" value="123">
+  <input id="radio2" type="radio" checked>
+  <input id="slider2" type="range" min="1" max="10" value="5">
+  <input id="submit2" type="submit">
+  <select id="combobox2"><option>1<option selected>2</select>
+  <select multiple id="listbox2"><option>1<option selected>2</select>
+  <textarea id="textarea2">Textarea</textarea>
+</div>
+
+<div id="console"></div>
+<script>
+description("This tests whether AXValue is writable for various form controls.");
+
+if (window.testRunner && window.accessibilityController) {
+    window.testRunner.dumpAsText();
+
+    function check(id1, id2, expected1) {
+        debug(id1);
+        window.element1 = document.getElementById(id1);
+        element1.focus();
+        shouldBe("document.activeElement == element1", "true");
+        window.axElement1 = accessibilityController.focusedElement;
+
+        debug(id2);
+        window.element2 = document.getElementById(id2);
+        element2.focus();
+        shouldBe("document.activeElement == element2", "true");
+        window.axElement2 = accessibilityController.focusedElement;
+
+        shouldBe("axElement1.isAttributeSettable('AXValue')", String(expected1));
+        // If contentEditable, AXValue is always writable.
+        shouldBe("axElement2.isAttributeSettable('AXValue')", "true");
+        debug("");
+    }
+
+    // All text-like form controls should have a writable AXValue.
+    check("text1", "text2", true);
+    check("number1", "number2", true);
+    check("textarea1", "textarea2", true);
+
+    // A slider can set AXValue.
+    check("slider1", "slider2", true);
+
+    // Other controls whose contents or state can be user modified should have a read-only
+    // AXValue for non-ATK-based platforms, unless those controls are inside contentEditable,
+    // then everything should have a writable AXValue.
+    isATK = accessibilityController.platformName == "atk";
+    check("checkbox1", "checkbox2", isATK ? true : false);
+    check("radio1", "radio2", isATK ? true : false);
+    check("submit1", "submit2", false);
+    check("combobox1", "combobox2", isATK ? true : false);
+    check("listbox1", "listbox2", isATK ? true : false);
+}
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/xml-roles-exposed-expected.txt (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/xml-roles-exposed-expected.txt	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/gtk/xml-roles-exposed-expected.txt	2016-05-23 11:03:44 UTC (rev 201270)
@@ -135,7 +135,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: computed-role:checkbox, xml-roles:checkbox, tag:div, toolkit:WebKitGtk
+AXPlatformAttributes: computed-role:checkbox, xml-roles:checkbox, readonly:false, tag:div, toolkit:WebKitGtk
 ------------
 AXRole: AXComboBox
 AXParent: AXWebArea
@@ -154,7 +154,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: computed-role:combobox, xml-roles:combobox, tag:div, toolkit:WebKitGtk
+AXPlatformAttributes: computed-role:combobox, xml-roles:combobox, readonly:false, tag:div, toolkit:WebKitGtk
 ------------
 AXRole: AXLandmarkComplementary
 AXParent: AXWebArea
@@ -592,7 +592,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: computed-role:searchbox, xml-roles:searchbox, tag:div, toolkit:WebKitGtk
+AXPlatformAttributes: computed-role:searchbox, xml-roles:searchbox, readonly:false, tag:div, toolkit:WebKitGtk
 ------------
 AXRole: AXSeparator
 AXParent: AXWebArea
@@ -630,7 +630,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: computed-role:slider, xml-roles:slider, tag:div, toolkit:WebKitGtk
+AXPlatformAttributes: computed-role:slider, xml-roles:slider, readonly:false, tag:div, toolkit:WebKitGtk
 ------------
 AXRole: AXSpinButton
 AXParent: AXWebArea
@@ -649,7 +649,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: computed-role:spinbutton, xml-roles:spinbutton, tag:div, toolkit:WebKitGtk
+AXPlatformAttributes: computed-role:spinbutton, xml-roles:spinbutton, readonly:false, tag:div, toolkit:WebKitGtk
 ------------
 AXRole: AXStatusBar
 AXParent: AXWebArea
@@ -687,7 +687,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: computed-role:switch, xml-roles:switch, tag:div, toolkit:WebKitGtk
+AXPlatformAttributes: computed-role:switch, xml-roles:switch, readonly:false, tag:div, toolkit:WebKitGtk
 ------------
 AXRole: AXTextField
 AXParent: AXWebArea
@@ -706,7 +706,7 @@
 AXExpanded: 0
 AXRequired: 0
 AXChecked: 0
-AXPlatformAttributes: tag:div, toolkit:WebKitGtk
+AXPlatformAttributes: readonly:false, tag:div, toolkit:WebKitGtk
 ------------
 AXRole: AXTimer
 AXParent: AXWebArea

Deleted: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/mac/form-control-value-settable-expected.txt (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/mac/form-control-value-settable-expected.txt	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/mac/form-control-value-settable-expected.txt	2016-05-23 11:03:44 UTC (rev 201270)
@@ -1,74 +0,0 @@
-                
-                
-This tests whether AXValue is writable for various form controls.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-text1
-PASS document.activeElement == element1 is true
-text2
-PASS document.activeElement == element2 is true
-PASS axElement1.isAttributeSettable('AXValue') is true
-PASS axElement2.isAttributeSettable('AXValue') is true
-
-number1
-PASS document.activeElement == element1 is true
-number2
-PASS document.activeElement == element2 is true
-PASS axElement1.isAttributeSettable('AXValue') is true
-PASS axElement2.isAttributeSettable('AXValue') is true
-
-textarea1
-PASS document.activeElement == element1 is true
-textarea2
-PASS document.activeElement == element2 is true
-PASS axElement1.isAttributeSettable('AXValue') is true
-PASS axElement2.isAttributeSettable('AXValue') is true
-
-slider1
-PASS document.activeElement == element1 is true
-slider2
-PASS document.activeElement == element2 is true
-PASS axElement1.isAttributeSettable('AXValue') is true
-PASS axElement2.isAttributeSettable('AXValue') is true
-
-checkbox1
-PASS document.activeElement == element1 is true
-checkbox2
-PASS document.activeElement == element2 is true
-PASS axElement1.isAttributeSettable('AXValue') is false
-PASS axElement2.isAttributeSettable('AXValue') is true
-
-radio1
-PASS document.activeElement == element1 is true
-radio2
-PASS document.activeElement == element2 is true
-PASS axElement1.isAttributeSettable('AXValue') is false
-PASS axElement2.isAttributeSettable('AXValue') is true
-
-submit1
-PASS document.activeElement == element1 is true
-submit2
-PASS document.activeElement == element2 is true
-PASS axElement1.isAttributeSettable('AXValue') is false
-PASS axElement2.isAttributeSettable('AXValue') is true
-
-combobox1
-PASS document.activeElement == element1 is true
-combobox2
-PASS document.activeElement == element2 is true
-PASS axElement1.isAttributeSettable('AXValue') is false
-PASS axElement2.isAttributeSettable('AXValue') is true
-
-listbox1
-PASS document.activeElement == element1 is true
-listbox2
-PASS document.activeElement == element2 is true
-PASS axElement1.isAttributeSettable('AXValue') is false
-PASS axElement2.isAttributeSettable('AXValue') is true
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/mac/form-control-value-settable.html (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/mac/form-control-value-settable.html	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/mac/form-control-value-settable.html	2016-05-23 11:03:44 UTC (rev 201270)
@@ -1,77 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body>
-<script src=""
-
-<div>
-  <input id="text1" type="text" value="Value">
-  <input id="checkbox1" type="checkbox" checked>
-  <input id="number1" type="number" value="123">
-  <input id="radio1" type="radio" checked>
-  <input id="slider1" type="range" min="1" max="10" value="5">
-  <input id="submit1" type="submit">
-  <select id="combobox1"><option>1<option selected>2</select>
-  <select multiple id="listbox1"><option>1<option selected>2</select>
-  <textarea id="textarea1">Textarea</textarea>
-</div>
-
-<div contentEditable>
-  <input id="text2" type="text" value="Value">
-  <input id="checkbox2" type="checkbox" checked>
-  <input id="number2" type="number" value="123">
-  <input id="radio2" type="radio" checked>
-  <input id="slider2" type="range" min="1" max="10" value="5">
-  <input id="submit2" type="submit">
-  <select id="combobox2"><option>1<option selected>2</select>
-  <select multiple id="listbox2"><option>1<option selected>2</select>
-  <textarea id="textarea2">Textarea</textarea>
-</div>
-
-<div id="console"></div>
-<script>
-description("This tests whether AXValue is writable for various form controls.");
-
-if (window.testRunner && window.accessibilityController) {
-    window.testRunner.dumpAsText();
-
-    function check(id1, id2, expected1) {
-        debug(id1);
-        window.element1 = document.getElementById(id1);
-        element1.focus();
-        shouldBe("document.activeElement == element1", "true");
-        window.axElement1 = accessibilityController.focusedElement;
-
-        debug(id2);
-        window.element2 = document.getElementById(id2);
-        element2.focus();
-        shouldBe("document.activeElement == element2", "true");
-        window.axElement2 = accessibilityController.focusedElement;
-
-        shouldBe("axElement1.isAttributeSettable('AXValue')", String(expected1));
-        // If contentEditable, AXValue is always writable.
-        shouldBe("axElement2.isAttributeSettable('AXValue')", "true");
-        debug("");
-    }
-
-    // All text-like form controls should have a writable AXValue.
-    check("text1", "text2", true);
-    check("number1", "number2", true);
-    check("textarea1", "textarea2", true);
-
-    // A slider can set AXValue.
-    check("slider1", "slider2", true);
-
-    // Other form controls, even toggleable ones, should have a read-only AXValue -
-    // unless they're inside contentEditable, then everything should have writable AXValue.
-    check("checkbox1", "checkbox2", false);
-    check("radio1", "radio2", false);
-    check("submit1", "submit2", false);
-    check("combobox1", "combobox2", false);
-    check("listbox1", "listbox2", false);
-}
-
-</script>
-
-<script src=""
-</body>
-</html>

Copied: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/form-control-value-settable-expected.txt (from rev 201269, releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/mac/form-control-value-settable-expected.txt) (0 => 201270)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/form-control-value-settable-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/form-control-value-settable-expected.txt	2016-05-23 11:03:44 UTC (rev 201270)
@@ -0,0 +1,74 @@
+               
+               
+This tests whether AXValue is writable for various form controls.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+text1
+PASS document.activeElement == element1 is true
+text2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+number1
+PASS document.activeElement == element1 is true
+number2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+textarea1
+PASS document.activeElement == element1 is true
+textarea2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+slider1
+PASS document.activeElement == element1 is true
+slider2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+checkbox1
+PASS document.activeElement == element1 is true
+checkbox2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+radio1
+PASS document.activeElement == element1 is true
+radio2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+submit1
+PASS document.activeElement == element1 is true
+submit2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is false
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+combobox1
+PASS document.activeElement == element1 is true
+combobox2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+listbox1
+PASS document.activeElement == element1 is true
+listbox2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/table-detection-expected.txt (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/table-detection-expected.txt	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/gtk/accessibility/table-detection-expected.txt	2016-05-23 11:03:44 UTC (rev 201270)
@@ -285,6 +285,7 @@
 AXSize: { 64.000000, 26.000000 }
 AXTitle: 
 AXDescription: 
+AXValue: asdf	asdf<\n>
 AXFocusable: 1
 AXFocused: 0
 AXSelectable: 0

Copied: releases/WebKitGTK/webkit-2.12/LayoutTests/platform/mac/accessibility/form-control-value-settable-expected.txt (from rev 201269, releases/WebKitGTK/webkit-2.12/LayoutTests/accessibility/mac/form-control-value-settable-expected.txt) (0 => 201270)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/platform/mac/accessibility/form-control-value-settable-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/platform/mac/accessibility/form-control-value-settable-expected.txt	2016-05-23 11:03:44 UTC (rev 201270)
@@ -0,0 +1,74 @@
+                
+                
+This tests whether AXValue is writable for various form controls.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+text1
+PASS document.activeElement == element1 is true
+text2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+number1
+PASS document.activeElement == element1 is true
+number2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+textarea1
+PASS document.activeElement == element1 is true
+textarea2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+slider1
+PASS document.activeElement == element1 is true
+slider2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is true
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+checkbox1
+PASS document.activeElement == element1 is true
+checkbox2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is false
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+radio1
+PASS document.activeElement == element1 is true
+radio2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is false
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+submit1
+PASS document.activeElement == element1 is true
+submit2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is false
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+combobox1
+PASS document.activeElement == element1 is true
+combobox2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is false
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+listbox1
+PASS document.activeElement == element1 is true
+listbox2
+PASS document.activeElement == element2 is true
+PASS axElement1.isAttributeSettable('AXValue') is false
+PASS axElement2.isAttributeSettable('AXValue') is true
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-05-23 11:03:44 UTC (rev 201270)
@@ -1,3 +1,50 @@
+2016-05-11  Joanmarie Diggs  <jdi...@igalia.com>
+
+        [GTK] accessibility/aria-readonly.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=98357
+
+        Reviewed by Chris Fleizach.
+
+        Add support for ATK_STATE_READ_ONLY and expose the value of aria-readonly
+        as an AtkObject attribute. In order to eliminate duplicate checks, remove
+        isReadOnly() and just use canSetAttributeValue(), moving all the logic into
+        AccessibilityNodeObject. Add AccessibilityObject::supportsARIAReadOnly() so
+        that we can explicitly expose the implicit value for aria-readonly on roles
+        which support this property. Also add support for ATK_STATE_CHECKABLE, both
+        because this state was missing and because it serves a similar function to
+        ATK_STATE_EDITABLE for the purpose of verifying exposure of toggle-able
+        elements that are not read-only.
+
+        Test: accessibility/form-control-value-settable.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::canSetValueAttribute):
+        (WebCore::AccessibilityNodeObject::isRequired): Deleted.
+        (WebCore::AccessibilityNodeObject::supportsRequiredAttribute): Deleted.
+        * accessibility/AccessibilityNodeObject.h:
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::supportsARIAReadOnly):
+        (WebCore::AccessibilityObject::ariaReadOnlyValue):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::isUnvisited): Deleted.
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::clickPoint):
+        (WebCore::AccessibilityRenderObject::isOffScreen): Deleted.
+        (WebCore::AccessibilityRenderObject::anchorElement): Deleted.
+        (WebCore::AccessibilityRenderObject::internalLinkElement): Deleted.
+        (WebCore::AccessibilityRenderObject::textChanged): Deleted.
+        (WebCore::AccessibilityRenderObject::clearChildren): Deleted.
+        (WebCore::AccessibilityRenderObject::addImageMapChildren): Deleted.
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
+        (getAttributeSetForAccessibilityObject):
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (webkitAccessibleGetAttributes):
+        (setAtkStateSetFromCoreObject):
+        (getInterfaceMaskFromObject):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
+
 2016-05-03  Joanmarie Diggs  <jdi...@igalia.com>
 
         [ATK] accessibility/content-editable-as-textarea.html fails

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2016-05-23 11:03:44 UTC (rev 201270)
@@ -739,24 +739,6 @@
     return node() && node()->hasTagName(selectTag) && downcast<HTMLSelectElement>(*node()).multiple();
 }
 
-bool AccessibilityNodeObject::isReadOnly() const
-{
-    Node* node = this->node();
-    if (!node)
-        return true;
-
-    if (is<HTMLTextAreaElement>(*node))
-        return downcast<HTMLTextAreaElement>(*node).isReadOnly();
-
-    if (is<HTMLInputElement>(*node)) {
-        HTMLInputElement& input = downcast<HTMLInputElement>(*node);
-        if (input.isTextField())
-            return input.isReadOnly();
-    }
-
-    return !node->hasEditableStyle();
-}
-
 bool AccessibilityNodeObject::isRequired() const
 {
     // Explicit aria-required values should trump native required attributes.
@@ -1978,6 +1960,57 @@
     return element.supportsFocus();
 }
 
+bool AccessibilityNodeObject::canSetValueAttribute() const
+{
+    Node* node = this->node();
+    if (!node)
+        return false;
+
+    // The host-language readonly attribute trumps aria-readonly.
+    if (is<HTMLTextAreaElement>(*node))
+        return !downcast<HTMLTextAreaElement>(*node).isReadOnly();
+    if (is<HTMLInputElement>(*node)) {
+        HTMLInputElement& input = downcast<HTMLInputElement>(*node);
+        if (input.isTextField())
+            return !input.isReadOnly();
+    }
+
+    String readOnly = ariaReadOnlyValue();
+    if (!readOnly.isEmpty())
+        return readOnly == "true" ? false : true;
+
+    if (isNonNativeTextControl())
+        return true;
+
+    if (isMeter())
+        return false;
+
+    if (isProgressIndicator() || isSlider())
+        return true;
+
+#if PLATFORM(GTK) || PLATFORM(EFL)
+    // In ATK, input types which support aria-readonly are treated as having a
+    // settable value if the user can modify the widget's value or its state.
+    if (supportsARIAReadOnly() || isRadioButton())
+        return true;
+#endif
+
+    if (isWebArea()) {
+        Document* document = this->document();
+        if (!document)
+            return false;
+
+        if (HTMLElement* body = document->bodyOrFrameset()) {
+            if (body->hasEditableStyle())
+                return true;
+        }
+
+        return document->hasEditableStyle();
+    }
+
+    return node->hasEditableStyle();
+}
+
 AccessibilityRole AccessibilityNodeObject::determineAriaRoleAttribute() const
 {
     const AtomicString& ariaRole = getAttribute(roleAttr);

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.h (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.h	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityNodeObject.h	2016-05-23 11:03:44 UTC (rev 201270)
@@ -97,7 +97,6 @@
     virtual bool isEnabled() const override;
     virtual bool isIndeterminate() const override;
     virtual bool isPressed() const override;
-    virtual bool isReadOnly() const override;
     virtual bool isRequired() const override;
     virtual bool supportsRequiredAttribute() const override;
 
@@ -110,6 +109,8 @@
     virtual bool canSetFocusAttribute() const override;
     virtual int headingLevel() const override;
 
+    bool canSetValueAttribute() const override;
+
     virtual String valueDescription() const override;
     virtual float valueForRange() const override;
     virtual float maxValueForRange() const override;

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.cpp (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.cpp	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.cpp	2016-05-23 11:03:44 UTC (rev 201270)
@@ -1538,6 +1538,37 @@
     return contentEditableAttributeIsEnabled(element());
 }
 
+bool AccessibilityObject::supportsARIAReadOnly() const
+{
+    AccessibilityRole role = roleValue();
+
+    return role == CheckBoxRole
+        || role == ColumnHeaderRole
+        || role == ComboBoxRole
+        || role == GridRole
+        || role == GridCellRole
+        || role == ListBoxRole
+        || role == MenuItemCheckboxRole
+        || role == MenuItemRadioRole
+        || role == RadioGroupRole
+        || role == RowHeaderRole
+        || role == SearchFieldRole
+        || role == SliderRole
+        || role == SpinButtonRole
+        || role == SwitchRole
+        || role == TextFieldRole
+        || role == TreeGridRole
+        || isPasswordField();
+}
+
+String AccessibilityObject::ariaReadOnlyValue() const
+{
+    if (!hasAttribute(aria_readonlyAttr))
+        return ariaRoleAttribute() != UnknownRole && supportsARIAReadOnly() ? "false" : String();
+
+    return String(getAttribute(aria_readonlyAttr)).convertToASCIILowercase();
+}
+
 bool AccessibilityObject::contentEditableAttributeIsEnabled(Element* element)
 {
     if (!element)

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.h (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.h	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityObject.h	2016-05-23 11:03:44 UTC (rev 201270)
@@ -553,7 +553,6 @@
     virtual bool isMultiSelectable() const { return false; }
     virtual bool isOffScreen() const { return false; }
     virtual bool isPressed() const { return false; }
-    virtual bool isReadOnly() const { return false; }
     virtual bool isUnvisited() const { return false; }
     virtual bool isVisited() const { return false; }
     virtual bool isRequired() const { return false; }
@@ -902,6 +901,9 @@
     static bool liveRegionStatusIsEnabled(const AtomicString&);
     static bool contentEditableAttributeIsEnabled(Element*);
     bool hasContentEditableAttributeSet() const;
+
+    bool supportsARIAReadOnly() const;
+    String ariaReadOnlyValue() const;
     
     bool supportsARIAAttributes() const;
     

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2016-05-23 11:03:44 UTC (rev 201270)
@@ -521,23 +521,7 @@
     
     return false;
 }
-    
-bool AccessibilityRenderObject::isReadOnly() const
-{
-    ASSERT(m_renderer);
-    
-    if (isWebArea()) {
-        if (HTMLElement* body = m_renderer->document().bodyOrFrameset()) {
-            if (body->hasEditableStyle())
-                return false;
-        }
 
-        return !m_renderer->document().hasEditableStyle();
-    }
-
-    return AccessibilityNodeObject::isReadOnly();
-}
-
 bool AccessibilityRenderObject::isOffScreen() const
 {
     ASSERT(m_renderer);
@@ -921,7 +905,7 @@
         return children()[0]->clickPoint();
 
     // use the default position unless this is an editable web area, in which case we use the selection bounds.
-    if (!isWebArea() || isReadOnly())
+    if (!isWebArea() || !canSetValueAttribute())
         return AccessibilityObject::clickPoint();
     
     VisibleSelection visSelection = selection();
@@ -2856,34 +2840,6 @@
     return equalLettersIgnoringASCIICase(ariaExpanded, "true") || equalLettersIgnoringASCIICase(ariaExpanded, "false");
 }
 
-bool AccessibilityRenderObject::canSetValueAttribute() const
-{
-
-    // In the event of a (Boolean)@readonly and (True/False/Undefined)@aria-readonly
-    // value mismatch, the host language native attribute value wins.    
-    if (isNativeTextControl())
-        return !isReadOnly();
-
-    if (isMeter())
-        return false;
-
-    auto& readOnly = getAttribute(aria_readonlyAttr);
-    if (equalLettersIgnoringASCIICase(readOnly, "true"))
-        return false;
-    if (equalLettersIgnoringASCIICase(readOnly, "false"))
-        return true;
-
-    if (isProgressIndicator() || isSlider())
-        return true;
-
-    if (isTextControl() && !isNativeTextControl())
-        return true;
-
-    // Any node could be contenteditable, so isReadOnly should be relied upon
-    // for this information for all elements.
-    return !isReadOnly();
-}
-
 bool AccessibilityRenderObject::canSetTextRangeAttributes() const
 {
     return isTextControl();

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.h (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.h	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/AccessibilityRenderObject.h	2016-05-23 11:03:44 UTC (rev 201270)
@@ -70,7 +70,6 @@
     virtual bool isFocused() const override;
     virtual bool isLoaded() const override;
     virtual bool isOffScreen() const override;
-    virtual bool isReadOnly() const override;
     virtual bool isUnvisited() const override;
     virtual bool isVisited() const override;
     virtual bool isLinked() const override;
@@ -83,7 +82,6 @@
     virtual bool hasUnderline() const override;
 
     virtual bool canSetTextRangeAttributes() const override;
-    virtual bool canSetValueAttribute() const override;
     virtual bool canSetExpandedAttribute() const override;
 
     virtual void setAccessibleName(const AtomicString&) override;

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp	2016-05-23 11:03:44 UTC (rev 201270)
@@ -198,7 +198,7 @@
 
     result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_INVISIBLE), (style->visibility() == HIDDEN) ? "true" : "false");
 
-    result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_EDITABLE), object->isReadOnly() ? "false" : "true");
+    result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_EDITABLE), object->canSetValueAttribute() ? "true" : "false");
 
     String language = object->language();
     if (!language.isEmpty())

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp	2016-05-23 11:03:44 UTC (rev 201270)
@@ -454,6 +454,10 @@
     if (coreObject->supportsARIASetSize())
         attributeSet = addToAtkAttributeSet(attributeSet, "setsize", String::number(coreObject->ariaSetSize()).utf8().data());
 
+    String isReadOnly = coreObject->ariaReadOnlyValue();
+    if (!isReadOnly.isEmpty())
+        attributeSet = addToAtkAttributeSet(attributeSet, "readonly", isReadOnly.utf8().data());
+
     // According to the W3C Core Accessibility API Mappings 1.1, section 5.4.1 General Rules:
     // "User agents must expose the WAI-ARIA role string if the API supports a mechanism to do so."
     // In the case of ATK, the mechanism to do so is an object attribute pair (xml-roles:"string").
@@ -762,16 +766,15 @@
     if (isListBoxOption && coreObject->isSelectedOptionActive())
         atk_state_set_add_state(stateSet, ATK_STATE_ACTIVE);
 
+#if ATK_CHECK_VERSION(2,11,2)
+    if (coreObject->supportsChecked() && coreObject->canSetValueAttribute())
+        atk_state_set_add_state(stateSet, ATK_STATE_CHECKABLE);
+#endif
+
     if (coreObject->isChecked())
         atk_state_set_add_state(stateSet, ATK_STATE_CHECKED);
 
-    // FIXME: isReadOnly does not seem to do the right thing for
-    // controls, so check explicitly for them. In addition, because
-    // isReadOnly is false for listBoxOptions, we need to add one
-    // more check so that we do not present them as being "editable".
-    if ((!coreObject->isReadOnly()
-        || (coreObject->isControl() && coreObject->canSetValueAttribute()))
-        && !isListBoxOption)
+    if ((coreObject->isTextControl() || coreObject->isNonNativeTextControl()) && coreObject->canSetValueAttribute())
         atk_state_set_add_state(stateSet, ATK_STATE_EDITABLE);
 
     // FIXME: Put both ENABLED and SENSITIVE together here for now
@@ -816,6 +819,11 @@
     if (coreObject->isPressed())
         atk_state_set_add_state(stateSet, ATK_STATE_PRESSED);
 
+#if ATK_CHECK_VERSION(2,15,3)
+    if (!coreObject->canSetValueAttribute() && (coreObject->supportsARIAReadOnly()))
+        atk_state_set_add_state(stateSet, ATK_STATE_READ_ONLY);
+#endif
+
     if (coreObject->isRequired())
         atk_state_set_add_state(stateSet, ATK_STATE_REQUIRED);
 
@@ -1105,9 +1113,9 @@
     // Text, Editable Text & Hypertext
     if (role == StaticTextRole || coreObject->isMenuListOption())
         interfaceMask |= 1 << WAIText;
-    else if (coreObject->isTextControl()) {
+    else if (coreObject->isTextControl() || coreObject->isNonNativeTextControl()) {
         interfaceMask |= 1 << WAIText;
-        if (!coreObject->isReadOnly())
+        if (coreObject->canSetValueAttribute())
             interfaceMask |= 1 << WAIEditableText;
     } else if (!coreObject->isWebArea()) {
         if (role != TableRole) {

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/inspector/InspectorDOMAgent.cpp (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/inspector/InspectorDOMAgent.cpp	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/inspector/InspectorDOMAgent.cpp	2016-05-23 11:03:44 UTC (rev 201270)
@@ -1703,7 +1703,7 @@
                 pressed = axObject->isPressed();
             
             if (axObject->isTextControl())
-                readonly = axObject->isReadOnly();
+                readonly = !axObject->canSetValueAttribute();
 
             supportsRequired = axObject->supportsRequiredAttribute();
             if (supportsRequired)

Modified: releases/WebKitGTK/webkit-2.12/Source/WebKit/win/AccessibleBase.cpp (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebKit/win/AccessibleBase.cpp	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebKit/win/AccessibleBase.cpp	2016-05-23 11:03:44 UTC (rev 201270)
@@ -488,7 +488,7 @@
     if (!m_object->isEnabled())
         state |= STATE_SYSTEM_UNAVAILABLE;
 
-    if (m_object->isReadOnly())
+    if (!m_object->canSetValueAttribute())
         state |= STATE_SYSTEM_READONLY;
 
     if (m_object->isOffScreen())

Modified: releases/WebKitGTK/webkit-2.12/Source/WebKit/win/AccessibleTextImpl.cpp (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebKit/win/AccessibleTextImpl.cpp	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebKit/win/AccessibleTextImpl.cpp	2016-05-23 11:03:44 UTC (rev 201270)
@@ -563,7 +563,7 @@
 
 HRESULT AccessibleText::deleteText(long startOffset, long endOffset)
 {
-    if (m_object->isReadOnly())
+    if (!m_object->canSetValueAttribute())
         return S_FALSE;
 
     if (initialCheck() == E_POINTER)
@@ -581,7 +581,7 @@
 
 HRESULT AccessibleText::insertText(long offset, BSTR* text)
 {
-    if (m_object->isReadOnly())
+    if (!m_object->canSetValueAttribute())
         return S_FALSE;
 
     if (initialCheck() == E_POINTER)
@@ -601,7 +601,7 @@
 
 HRESULT AccessibleText::cutText(long startOffset, long endOffset)
 {
-    if (m_object->isReadOnly())
+    if (!m_object->canSetValueAttribute())
         return S_FALSE;
 
     if (initialCheck() == E_POINTER)
@@ -622,7 +622,7 @@
 
 HRESULT AccessibleText::pasteText(long offset)
 {
-    if (m_object->isReadOnly())
+    if (!m_object->canSetValueAttribute())
         return S_FALSE;
 
     if (initialCheck() == E_POINTER)
@@ -642,7 +642,7 @@
 
 HRESULT AccessibleText::replaceText(long startOffset, long endOffset, BSTR* text)
 {
-    if (m_object->isReadOnly())
+    if (!m_object->canSetValueAttribute())
         return S_FALSE;
 
     if (initialCheck() == E_POINTER)

Modified: releases/WebKitGTK/webkit-2.12/Source/WebKit/win/ChangeLog (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Source/WebKit/win/ChangeLog	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Source/WebKit/win/ChangeLog	2016-05-23 11:03:44 UTC (rev 201270)
@@ -1,3 +1,22 @@
+2016-05-11  Joanmarie Diggs  <jdi...@igalia.com>
+
+        [GTK] accessibility/aria-readonly.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=98357
+
+        Reviewed by Chris Fleizach.
+
+        Call AccessibilityNode::canSetValueAttribute() to determine if STATE_SYSTEM_READONLY
+        should be added and if editable text should be supported.
+
+        * AccessibleBase.cpp:
+        (AccessibleBase::state):
+        * AccessibleTextImpl.cpp:
+        (AccessibleText::deleteText):
+        (AccessibleText::insertText):
+        (AccessibleText::cutText):
+        (AccessibleText::pasteText):
+        (AccessibleText::replaceText):
+
 2016-02-16  Andreas Kling  <akl...@apple.com>
 
         Drop StyleResolver and SelectorQueryCache when entering PageCache.

Modified: releases/WebKitGTK/webkit-2.12/Tools/ChangeLog (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Tools/ChangeLog	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Tools/ChangeLog	2016-05-23 11:03:44 UTC (rev 201270)
@@ -1,3 +1,25 @@
+2016-05-11  Joanmarie Diggs  <jdi...@igalia.com>
+
+        [GTK] accessibility/aria-readonly.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=98357
+
+        Reviewed by Chris Fleizach.
+
+        Add checks to isAttributeSettable() for ATK_STATE_READ_ONLY and the 'readonly'
+        AtkObject attribute along with ATK_STATE_CHECKABLE for toggle-able elements,
+        ATK_STATE_SELECTABLE for select elements, and ATK_STATE_FOCUSABLE combined
+        with range verification for inputs which implement AtkValue. The latter two
+        additions are admittedly a heuristic workaround for platform accessibility
+        API differences. But they should be sufficient to facilitate cross-platform
+        testing of isAttributeSettable() for form elements which lack ARIA attributes.
+
+        Bump the minimum version of at-spi2-core and at-spi2-atk
+        to 2.15.4 (earliest version that supports STATE_READ_ONLY).
+
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::AccessibilityUIElement::isAttributeSettable):
+        * gtk/jhbuild.modules:
+
 2016-05-03  Joanmarie Diggs  <jdi...@igalia.com>
 
         [ATK] accessibility/content-editable-as-textarea.html fails

Modified: releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp	2016-05-23 11:03:44 UTC (rev 201270)
@@ -1041,9 +1041,52 @@
         return false;
 
     String attributeString = jsStringToWTFString(attribute);
-    if (attributeString == "AXValue")
-        return checkElementState(m_element.get(), ATK_STATE_EDITABLE);
+    if (attributeString != "AXValue")
+        return false;
 
+    // ATK does not have a single state or property to indicate whether or not the value
+    // of an accessible object can be set. ATs look at several states and properties based
+    // on the type of object. If nothing explicitly indicates the value can or cannot be
+    // set, ATs make role- and interface-based decisions. We'll do something similar here.
+
+    // This state is expected to be present only for text widgets and contenteditable elements.
+    if (checkElementState(m_element.get(), ATK_STATE_EDITABLE))
+        return true;
+
+#if ATK_CHECK_VERSION(2,11,2)
+    // This state is applicable to checkboxes, radiobuttons, switches, etc.
+    if (checkElementState(m_element.get(), ATK_STATE_CHECKABLE))
+        return true;
+#endif
+
+#if ATK_CHECK_VERSION(2,15,3)
+    // This state is expected to be present only for controls and only if explicitly set.
+    if (checkElementState(m_element.get(), ATK_STATE_READ_ONLY))
+        return false;
+#endif
+
+    // We expose an object attribute to ATs when there is an author-provided ARIA property
+    // and also when there is a supported ARIA role but no author-provided value.
+    String isReadOnly = getAttributeSetValueForId(ATK_OBJECT(m_element.get()), ObjectAttributeType, "readonly");
+    if (!isReadOnly.isEmpty())
+        return isReadOnly == "true" ? false : true;
+
+    // If we have a native listbox or combobox and the value can be set, the options should
+    // have ATK_STATE_SELECTABLE.
+    AtkRole role = atk_object_get_role(ATK_OBJECT(m_element.get()));
+    if (role == ATK_ROLE_LIST_BOX || role == ATK_ROLE_COMBO_BOX) {
+        if (GRefPtr<AtkObject> child = adoptGRef(atk_object_ref_accessible_child(ATK_OBJECT(m_element.get()), 0))) {
+            if (atk_object_get_role(ATK_OBJECT(child.get())) == ATK_ROLE_MENU)
+                child = adoptGRef(atk_object_ref_accessible_child(ATK_OBJECT(child.get()), 0));
+            return child && checkElementState(child.get(), ATK_STATE_SELECTABLE);
+        }
+    }
+
+    // If we have a native element which exposes a range whose value can be set, it should
+    // be focusable and have a true range.
+    if (ATK_IS_VALUE(m_element.get()) && checkElementState(m_element.get(), ATK_STATE_FOCUSABLE))
+        return minValue() != maxValue();
+
     return false;
 }
 

Modified: releases/WebKitGTK/webkit-2.12/Tools/gtk/jhbuild.modules (201269 => 201270)


--- releases/WebKitGTK/webkit-2.12/Tools/gtk/jhbuild.modules	2016-05-23 11:02:42 UTC (rev 201269)
+++ releases/WebKitGTK/webkit-2.12/Tools/gtk/jhbuild.modules	2016-05-23 11:03:44 UTC (rev 201270)
@@ -289,9 +289,9 @@
 
   <autotools id="at-spi2-core" 
              autogenargs="--disable-introspection">
-    <branch module="pub/GNOME/sources/at-spi2-core/2.10/at-spi2-core-2.10.0.tar.xz" version="2.10.0"
+    <branch module="pub/GNOME/sources/at-spi2-core/2.15/at-spi2-core-2.15.4.tar.xz" version="2.15.4"
             repo="ftp.gnome.org"
-            hash="sha256:964155c7574220a00e11e1c0d91f2d3017ed603920eb1333ff9cbdb6a22744db">
+            hash="sha256:0e3b01af6ba06d98faf7b85891ece394897fe145b0760b7846e810b57f1b809f">
     </branch>
     <dependencies>
       <dep package="glib"/>
@@ -299,9 +299,9 @@
   </autotools>
 
   <autotools id="at-spi2-atk">
-    <branch module="pub/GNOME/sources/at-spi2-atk/2.10/at-spi2-atk-2.10.0.tar.xz" version="2.10.0"
+    <branch module="pub/GNOME/sources/at-spi2-atk/2.15/at-spi2-atk-2.15.4.tar.xz" version="2.15.4"
             repo="ftp.gnome.org"
-            hash="sha256:dea7ff2f9bc9bbdb0351112616d738de718b55739cd2511afecac51604c31a94">
+            hash="sha256:3283aa5207b81e4c77d24c4e8b1c0abe6c850b11a2e62cd873cc07af0b403501">
     </branch>
     <dependencies>
       <dep package="glib"/>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to