Source/WebCore: Add UserAgentShadowDOM to FormControlElement just before adding Autho...
[WebKit-https.git] / LayoutTests / fast / dom / shadow / shadow-disable.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <svg xmlns="http://www.w3.org/2000/svg" style="display:none"><tref id="tref" /></svg>
9 <pre id="console"></pre>
10 <script>
11 description("Tests to ensure that shadow element cannot be created in elements having dynamically created shadow root.");
12
13 function testToAddShadowRoot(element, success) {
14     debug(element.nodeName);
15
16     if (success)
17         shouldNotBe("new WebKitShadowRoot(element)", "null");
18     else
19         shouldThrow("new WebKitShadowRoot(element)");
20 }
21
22 var elementsToSuccess = [
23     document.createElement('div'),
24     document.createElement('span'),
25     document.createElement('a'),
26     document.createElement('section'),
27     document.createElement('audio'),
28     document.createElement('video'),
29     document.createElement('input'),
30     document.createElement('textarea'),
31     document.createElement('select')
32 ];
33
34 var elementsToFail = [
35     document.getElementById('tref')
36 ];
37
38 for (var i = 0; i < elementsToSuccess.length; ++i) {
39     var element = elementsToSuccess[i];
40     testToAddShadowRoot(element, true);
41 }
42
43 for (var i = 0; i < elementsToFail.length; ++i) {
44     var element = elementsToFail[i];
45     testToAddShadowRoot(element, false);
46 }
47
48 var successfullyParsed = true;
49 </script>
50 <script src="../../js/resources/js-test-post.js"></script>
51 </body>
52 </html>