AXSelected attribute on RadioButton should not be settable.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Jan 2019 23:31:43 +0000 (23:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Jan 2019 23:31:43 +0000 (23:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193371

Patch by Eric Liang <ericliang@apple.com> on 2019-01-19
Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/set-selected-editable.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):

LayoutTests:

This change make RadioButton AXSelected attribute no-settable. If this attribute is not writable, then the trackpad should work correctly.

* accessibility/set-selected-editable-expected.txt: Added.
* accessibility/set-selected-editable.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/accessibility/set-selected-editable-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/set-selected-editable.html [new file with mode: 0644]
LayoutTests/platform/win/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp

index 78794b4..f8f5759 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-19  Eric Liang  <ericliang@apple.com>
+
+        AXSelected attribute on RadioButton should not be settable.
+        https://bugs.webkit.org/show_bug.cgi?id=193371
+
+        Reviewed by Chris Fleizach.
+
+        This change make RadioButton AXSelected attribute no-settable. If this attribute is not writable, then the trackpad should work correctly.
+
+        * accessibility/set-selected-editable-expected.txt: Added.
+        * accessibility/set-selected-editable.html: Added.
+
 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
 
         iOS: Updating input mode should update the software keyboard
diff --git a/LayoutTests/accessibility/set-selected-editable-expected.txt b/LayoutTests/accessibility/set-selected-editable-expected.txt
new file mode 100644 (file)
index 0000000..5bed2d4
--- /dev/null
@@ -0,0 +1,34 @@
+This tests that the accessibility Selected attribute can be settable only on certain elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS axElement.isAttributeSettable('AXSelected') is false
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is false
+PASS axElement.isAttributeSettable('AXSelected') is false
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is false
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is false
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is false
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is true
+PASS axElement.isAttributeSettable('AXSelected') is false
+PASS axElement.isAttributeSettable('AXSelected') is false
+PASS axElement.isAttributeSettable('AXSelected') is false
+
diff --git a/LayoutTests/accessibility/set-selected-editable.html b/LayoutTests/accessibility/set-selected-editable.html
new file mode 100644 (file)
index 0000000..8538a98
--- /dev/null
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<div id="content">
+
+  <div id="test0" role="table" selected-expected-value="false">
+    <div id="test1" role="row" selected-expected-value="true">
+      <div id="test2" role="columnheader" selected-expected-value="false">X</div>
+      <div id="test3" role="columnheader" selected-expected-value="false">X</div>
+    </div>
+    <div id="test4" role="row" selected-expected-value="true">
+      <div id="test5" role="rowheader" selected-expected-value="true">X</div>
+      <div id="test6" role="cell" selected-expected-value="true">X</div>
+    </div>
+  </div>
+
+  <div id="test7" role="grid" selected-expected-value="false">
+    <div id="test8" role="row" selected-expected-value="true">
+      <div id="test9" role="columnheader" selected-expected-value="false">X</div>
+      <div role="columnheader">X</div>
+    </div>
+    <div id="test10" role="row" selected-expected-value="true">
+      <div id="test11" role="rowheader" selected-expected-value="true">X</div>
+      <div id="test12" role="gridcell" selected-expected-value="true">X</div>
+    </div>
+  </div>
+
+  <div id="test13" role="treegrid" selected-expected-value="true">
+    <div id="test14" role="row" selected-expected-value="true">
+      <div id="test15" role="columnheader" selected-expected-value="false">X</div>
+      <div id="test16" role="gridcell" selected-expected-value="true">X</div>
+      <div id="test17" role="rowheader" selected-expected-value="true">X</div>
+    </div>
+  </div>
+
+  <ul id="test18" role="tree" selected-expected-value="true">
+      <li id="test19" role="treeitem" selected-expected-value="true">tree item</li>
+  </ul>
+
+  <ul id="test20" role="tablist" selected-expected-value="true">
+  <li id="test21" role="tab" tabindex="-1" selected-expected-value="true">Crust</li>
+  </ul>
+
+  <div id="test22" role="menuitemradio" aria-checked="true" selected-expected-value="true">Item one</div>
+  <div id="test23" role="menuitemcheckbox" aria-checked="false" selected-expected-value="true">Item four</div>
+  <div id="test24" role="menuitem" selected-expected-value="true">Item five</div>
+
+  <input id="test25" type="radio" selected-expected-value="false">
+  <input id="test26" type="checkbox" selected-expected-value="false"/>
+  <input id="test27" type="text" role="combobox" selected-expected-value="false">
+
+</div>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+    description("This tests that the accessibility Selected attribute can be settable only on certain elements.");
+    if (window.accessibilityController) {
+          for (var i = 0; i <= 27; i++) {
+              var axElement = accessibilityController.accessibleElementById("test" + i);
+              shouldBe("axElement.isAttributeSettable('AXSelected')", document.getElementById("test" + i).getAttribute("selected-expected-value"));
+          }
+          
+          document.getElementById("content").style.visibility = "hidden";
+    }
+
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
index 268134a..080fbea 100644 (file)
@@ -1455,6 +1455,7 @@ webkit.org/b/140798 [ Release ] accessibility/aria-switch-checked.html [ Skip ]
 webkit.org/b/140798 [ Debug ] accessibility/aria-switch-checked.html [ Skip ]
 webkit.org/b/140798 [ Release ] accessibility/aria-switch-text.html [ Skip ]
 webkit.org/b/140798 [ Debug ] accessibility/aria-switch-text.html [ Skip ]
+webkit.org/b/193371 accessibility/set-selected-editable.html [ Skip ]
 
 # The following timeouts are caused by the same problem: [ Failure ]
 webkit.org/b/126066 accessibility/loading-iframe-updates-axtree.html [ Skip ]
index e0efae6..72a9596 100644 (file)
@@ -1,3 +1,15 @@
+2019-01-19  Eric Liang  <ericliang@apple.com>
+
+        AXSelected attribute on RadioButton should not be settable.
+        https://bugs.webkit.org/show_bug.cgi?id=193371
+
+        Reviewed by Chris Fleizach.
+
+        Test: accessibility/set-selected-editable.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
+
 2019-01-19  Antoine Quint  <graouts@apple.com>
 
         Add a POINTER_EVENTS feature flag
index c2a7ace..8b7d6e6 100644 (file)
@@ -2232,7 +2232,6 @@ bool AccessibilityNodeObject::canSetSelectedAttribute() const
     switch (roleValue()) {
     case AccessibilityRole::Cell:
     case AccessibilityRole::GridCell:
-    case AccessibilityRole::RadioButton:
     case AccessibilityRole::RowHeader:
     case AccessibilityRole::Row:
     case AccessibilityRole::TabList: