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

Side by Side Diff: LayoutTests/accessibility/listitem-presentation-inherited.html

Issue 856473002: Inherit Presentation role only when elements without a explicit role defined. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 | LayoutTests/accessibility/listitem-presentation-inherited-expected.txt » ('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 <script src="../resources/js-test.js"></script>
2 <ul role="presentation">
3 <li role="listitem">Item 1</li>
dmazzoni 2015/01/15 16:05:30 nit: could you indent the <li> elements inside the
4 <li role="listitem">Item 2</li>
5 <li role="listitem">Item 3</li>
6 </ul>
7
8 <ul role="presentation">
9 <li>Plain Text 1</li>
10 <li>Plain Text 2</li>
11 <li>Plain Text 3</li>
12 </ul>
13 <p>End of test</p>
14 <p id="description"></p>
15 <div id="console"></div>
16 <script>
17 description("This tests that the presentation role is inherited.");
18
19 if (window.testRunner)
20 testRunner.dumpAsText();
21
22 function buildAccessibilityTree(accessibilityObject, indent) {
23 var str = "";
24 for (var i = 0; i < indent; i++)
25 str += " ";
26 str += accessibilityObject.role;
27 str += " " + accessibilityObject.stringValue;
28
29 if (accessibilityObject.role == '')
30 str += accessibilityObject.allAttributes();
31
32 str += "\n";
33 document.getElementById("console").innerText += str;
34
35 if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
36 return false;
37
38 var count = accessibilityObject.childrenCount;
39 for (var i = 0; i < count; ++i) {
40 if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
41 return false;
42 }
43
44 return true;
45 }
46
47 if (window.accessibilityController) {
48 var body = accessibilityController.focusedElement;
49 buildAccessibilityTree(body, 0);
50 }
51 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/accessibility/listitem-presentation-inherited-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698