Chromium Code Reviews| 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: [[x-bar]]<br> | |
| 10 x-bar's shadow tree: [j1 -> j2 -> [s1]]<br> | |
| 11 <b>slot #s1: [k1 -> k0 -> [s2]]</b><br> | |
| 12 slot #s2: [i1 -> i2]<br><br> | |
| 13 <b>v1 ideal nav forward: [i0 -> j1 -> j2 -> k1 -> k0 -> i1 -> i2]</b><br> | |
| 14 </p> | |
| 15 | |
| 16 <input id="i0" tabindex=0 value="i0"> | |
| 17 <div id="x-foo"> | |
| 18 <input id="i2" slot="s2" tabindex=2 value="i2"> | |
| 19 <input id="i1" slot="s2" tabindex=1 value="i1"> | |
| 20 <template data-mode="open"> | |
| 21 <div id="x-bar"> | |
| 22 <input id="j1" tabindex=1 value="j1"> | |
| 23 <slot id="s1" name="s1"> <!-- This slot does not have any assigned elemen ts --> | |
| 24 <input id="k0" tabindex=0 value="k0"> | |
| 25 <input id="k1" tabindex=1 value="k1"> | |
| 26 <slot id="s2" name="s2"></slot> | |
| 27 </slot> | |
| 28 <input id="j2" tabindex=2 value="j2"> | |
| 29 </div> | |
| 30 </template> | |
| 31 </div> | |
|
kochi
2016/03/30 06:28:33
Can you add more test cases to be more comprehensi
yuzuchan
2016/03/31 07:03:46
Thanks for the feedback! By adding the testcases s
kochi
2016/04/01 06:10:59
Cool!
| |
| 32 | |
| 33 <script> | |
| 34 | |
| 35 test(function() { | |
| 36 var xfoo = document.getElementById('x-foo'); | |
| 37 convertTemplatesToShadowRootsWithin(xfoo); | |
| 38 var elements = [ | |
| 39 'i0', | |
| 40 'x-foo/j1', | |
| 41 'x-foo/j2', | |
| 42 'x-foo/k1', | |
| 43 'x-foo/k0', | |
| 44 'i1', | |
| 45 'i2' | |
| 46 ]; | |
|
kochi
2016/03/30 06:28:34
Could you also check a case with the same tree str
yuzuchan
2016/03/31 07:03:46
Not with the same tree structure, but I added a fo
| |
| 47 | |
| 48 for (var i = 0; i + 1 < elements.length; ++i) | |
| 49 assert_true(shouldNavigateFocus(elements[i], elements[i + 1], 'forward'), elements[i]+" to "+ elements[i+1]); | |
|
kochi
2016/03/30 06:28:33
nit: use single quote for string literal and space
yuzuchan
2016/03/31 07:03:46
Done.
| |
| 50 elements.reverse(); | |
| 51 for (var i = 0; i + 1 < elements.length; ++i) | |
| 52 assert_true(shouldNavigateFocus(elements[i], elements[i + 1], 'backward'), elements[i]+" to "+ elements[i+1]); | |
|
kochi
2016/03/30 06:28:33
nit: ditto.
yuzuchan
2016/03/31 07:03:46
Done.
| |
| 53 }, 'Focus should jump to fallback elements when a slot does not have any assigne d nodes.'); | |
| 54 | |
| 55 </script> | |
| OLD | NEW |