Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/aria-owns-ignores-leafs.html

Issue 2072013004: Aria-owns should not work on roles that can't have children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored test Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4
5 <style>
6 .hideAllContainers .container { display: none; }
7
8 button {
9 display: block;
10 }
11 </style>
12
13 <div class="container" id="container1" role="group" aria-label="Container">
14 <div id="heading1" role="heading" aria-owns="menu1">heading</div>
15 <div id="menu1" role="menu">menu</div>
16 </div>
17
18 <script>
19 test(function(t)
20 {
21 // No problem with using aria-owns to put a menu inside a heading.
22 var axHeading1 = accessibilityController.accessibleElementById("heading1");
23 assert_equals(axHeading1.name, "heading menu");
24 var axContainer1 = accessibilityController.accessibleElementById("container1 ");
25 assert_equals(axContainer1.childrenCount, 1);
26 assert_equals(axContainer1.childAtIndex(0).role, "AXRole: AXHeading");
27 }, "Aria-owns should re-parent a target when the source role allows children.");
28 </script>
29
30 <div class="container" id="container2" role="group" aria-label="Container">
31 <div id="button2" role="button" aria-owns="menu2">button</div>
32 <div id="menu2" role="menu">menu</div>
33 </div>
34
35 <script>
36 test(function(t)
37 {
38 // A button can't have children, so we should ignore aria-owns.
39 var axButton2 = accessibilityController.accessibleElementById("button2");
40 assert_equals(axButton2.name, "button");
41 var axContainer2 = accessibilityController.accessibleElementById("container2 ");
42 assert_equals(axContainer2.childrenCount, 2);
43 assert_equals(axContainer2.childAtIndex(0).role, "AXRole: AXButton");
44 assert_equals(axContainer2.childAtIndex(1).role, "AXRole: AXMenu");
45 }, "Aria-owns doesn't move an element if the role doesn't allow children.");
46 </script>
47
48 <script>
49 if (window.testRunner)
50 document.body.className = "hideAllContainers";
51 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698