f7ae79926dc282dbb0a5a9b7327059217fe69f0c
[WebKit-https.git] / LayoutTests / fast / dom / shadow / shadowdom-for-form-associated-element-useragent.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="resources/polyfill.js"></script>
5 <script src="../../js/resources/js-test-pre.js"></script>
6
7 <p>When a AuthorShadowRoot is added, UserAgentShadowRoot should exists as the oldest Shadow Root.</p>
8 <div id='container'>
9     <form>
10         <button id='button'>72</button>
11         <select id='select'><option>hoge</option></select>
12         <output id='output'></output>
13         <keygen id='keygen'></keygen>
14         <fieldset id='fieldset'>
15             <input type="text">
16             <legend>hogehoge</legend>
17         </fieldset>
18     </form>
19 </div>
20 <pre id='console'></pre>
21
22 <script>
23 var elems = [
24     "button", "select", "keygen", "fieldset"
25 ];
26
27 var shadowRoot;
28 var oldestShadowRoot;
29 var youngerShadowRoot;
30 function test()
31 {
32     if (window.testRunner)
33         testRunner.dumpAsText();
34
35     for (var i = 0; i < elems.length; ++i) {
36         var host = document.getElementById(elems[i]);
37         shadowRoot = new WebKitShadowRoot(host);
38         shadowRoot.innerHTML = "<shadow></shadow>";
39
40         oldestShadowRoot = internals.oldestShadowRoot(host);
41         youngerShadowRoot = internals.youngerShadowRoot(oldestShadowRoot);
42         shouldNotBe('oldestShadowRoot', 'shadowRoot');
43         shouldBe('youngerShadowRoot', 'shadowRoot');
44     }
45
46     container.innerHTML = "";
47 }
48
49 test();
50 var successfullyParsed = true;
51 </script>
52 <script src="../../js/resources/js-test-post.js"></script>
53 </body>
54 </html>