OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <script src='../resources/testharness.js'></script> | |
3 <script src='../resources/testharnessreport.js'></script> | |
4 <script src='../fast/dom/shadow/resources/shadow-dom.js'></script> | |
5 <script src='resources/shadow-dom.js'></script> | |
6 <div id="log"></div> | |
7 <p> | |
8 document tree: [i0 -> [x-foo]]<br> | |
9 x-foo's shadow tree: [j1 -> [s1] -> [s2] -> j2 ->[x-bar]]<br> | |
10 x-bar's shadow tree: [k1 -> [s3]]<br> | |
11 slot #s1: [i1 -> i2]<br> | |
12 slot #s2: [i3]<br> | |
13 slot #s3: [[s4]]<br> | |
14 slot #s4: [i4 -> i5]<br><br> | |
15 <b>v1 ideal nav forward: [i0 -> j1 -> i1 -> i2 -> i3 -> j2 -> x-bar -> k1 ->
i4 -> i5]</b><br> | |
16 </p> | |
17 | |
18 <input id="i0" tabindex=0 value="i0"> | |
19 <div id="x-foo"> | |
20 <input id="i2" slot="s1" tabindex=2 value="i2"> | |
21 <input id="i1" slot="s1" tabindex=1 value="i1"> | |
22 <input id="i3" slot="s2" tabindex=3 value="i3"> | |
23 <input id="i4" slot="s4" tabindex=4 value="i4"> | |
24 <input id="i5" slot="s4" tabindex=5 value="i5"> | |
25 <template data-mode="open"> | |
26 <div id="x-bar" tabindex=5> | |
27 <slot id="s4" name="s4" slot="s3"></slot> | |
28 <template data-mode="open"> | |
29 <slot id="s3" name="s3" tabindex=2></slot> | |
30 <input id="k1" tabindex=1 value="k1"> | |
31 </template> | |
32 </div> | |
33 <input id="j1" tabindex=1 value="j1"> | |
34 <slot id="s2" name="s2" tabindex=3></slot> | |
35 <slot id="s1" name="s1" tabindex=2></slot> | |
36 <input id="j2" tabindex=4 value="j2"> | |
37 </template> | |
38 </div> | |
39 | |
40 <script> | |
41 | |
42 test(function() { | |
43 var xfoo = document.getElementById('x-foo'); | |
44 convertTemplatesToShadowRootsWithin(xfoo); | |
45 | |
46 var elements = [ | |
47 'i0', | |
48 'x-foo/j1', | |
49 'i1', | |
50 'i2', | |
51 'i3', | |
52 'x-foo/j2', | |
53 'x-foo/x-bar', | |
54 'x-foo/x-bar/k1', | |
55 'i4', | |
56 'i5' | |
57 ]; | |
58 | |
59 for (var i = 0; i + 1 < elements.length; ++i) | |
60 assert_true(shouldNavigateFocus(elements[i], elements[i + 1], 'forward'),
elements[i] + ' to ' + elements[i + 1]); | |
61 elements.reverse(); | |
62 for (var i = 0; i + 1 < elements.length; ++i) | |
63 assert_true(shouldNavigateFocus(elements[i], elements[i + 1], 'backward'),
elements[i] + ' to ' + elements[i + 1]); | |
64 }, 'Focus should cover assigned elements of an assigned slot, as well as element
s that are directly assigned to a slot.'); | |
65 | |
66 </script> | |
OLD | NEW |