OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <body> | |
3 <script> | |
4 if (window.internals) | |
5 internals.settings.setAuthorShadowDOMForAnyElementEnabled(true); | |
6 </script> | |
7 | |
8 <p>1. If an input element has a shadow tree containing a <shadow> element, it
should get the value text of the input element.</p> | |
9 <div id="shadow"> | |
10 <input type="button" value="Foo"><input type="button"> | |
11 <input type="reset" value="Foo"><input type="reset"> | |
12 <input type="submit" value="Foo"><input type="submit"> | |
13 </div> | |
14 | |
15 <p>2. If an author shadow tree contains no <shadow> element, the button value
should not be rendered.</p> | |
16 <div id="no-shadow"> | |
17 <input type="button" value="Foo"><input type="button"> | |
18 <input type="reset" value="Foo"><input type="reset"> | |
19 <input type="submit" value="Foo"><input type="submit"> | |
20 </div> | |
21 | |
22 <p>3. If an author shadow tree contains only <shadow> element, the button sho
uld be rendered as it didn't have shadow trees.</p> | |
23 <div id="only-shadow"> | |
24 <input type="button" value="Foo"><input type="button"> | |
25 <input type="reset" value="Foo"><input type="reset"> | |
26 <input type="submit" value="Foo"><input type="submit"> | |
27 </div> | |
28 | |
29 <p>4. Complex shadow tree.</p> | |
30 <div id="complex-shadow"> | |
31 <input type="button" value="Foo"> <input type="button"> | |
32 <input type="reset" value="Foo"> <input type="reset"> | |
33 <input type="submit" value="Foo"> <input type="submit"> | |
34 </div> | |
35 | |
36 <script> | |
37 var hosts1 = document.querySelectorAll('#shadow input'); | |
38 for (var i = 0; i < hosts1.length; ++i) | |
39 hosts1[i].createShadowRoot().innerHTML = '[<shadow></shadow>]'; | |
40 | |
41 var hosts2 = document.querySelectorAll('#no-shadow input'); | |
42 for (var i = 0; i < hosts2.length; ++i) | |
43 hosts2[i].createShadowRoot().innerHTML = '[]'; | |
44 | |
45 var hosts3 = document.querySelectorAll('#only-shadow input'); | |
46 for (var i = 0; i < hosts3.length; ++i) | |
47 hosts3[i].createShadowRoot().innerHTML = '<shadow />'; | |
48 | |
49 var hosts4 = document.querySelectorAll('#complex-shadow input'); | |
50 for (var i = 0; i < hosts4.length; ++i) | |
51 hosts4[i].createShadowRoot().innerHTML = 'prefix <span style="color:red;">&h
earts;</span><shadow></shadow> suffix'; | |
52 </script> | |
53 | |
54 </body> | |
OLD | NEW |