| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <div></div> | 7 <div></div> |
| 8 <script> | 8 <script> |
| 9 var div = document.querySelector("div"); | 9 var div = document.querySelector("div"); |
| 10 document.body.appendChild(div); | 10 document.body.appendChild(div); |
| 11 var shadowRoot = div.createShadowRoot(); | 11 var shadowRoot = div.createShadowRoot(); |
| 12 | 12 |
| 13 //Window named properties | 13 //Window named properties |
| 14 var namedElements = ['a', 'applet', 'area', 'embed', 'form', 'frame', | 14 var namedElements = ['a', 'area', 'embed', 'form', 'frame', |
| 15 'frameset', 'iframe','img', 'object']; | 15 'frameset', 'iframe','img', 'object']; |
| 16 | 16 |
| 17 var element; | 17 var element; |
| 18 namedElements.forEach(function (tagName) { | 18 namedElements.forEach(function (tagName) { |
| 19 element = document.createElement(tagName); | 19 element = document.createElement(tagName); |
| 20 element.name = 'named_' + tagName; | 20 element.name = 'named_' + tagName; |
| 21 | 21 |
| 22 debug("<" + tagName + ">: Before appendChild, " + element.name + " sho
uld not be in document."); | 22 debug("<" + tagName + ">: Before appendChild, " + element.name + " sho
uld not be in document."); |
| 23 shouldBeFalse("element.name in document"); | 23 shouldBeFalse("element.name in document"); |
| 24 shouldBeFalse("element.name in window"); | 24 shouldBeFalse("element.name in window"); |
| 25 shadowRoot.appendChild(element); | 25 shadowRoot.appendChild(element); |
| 26 debug("<" + tagName + ">: After appendChild, " + element.name + " shou
ld not still be in document, because the element was inserted into a shadow DOM
tree."); | 26 debug("<" + tagName + ">: After appendChild, " + element.name + " shou
ld not still be in document, because the element was inserted into a shadow DOM
tree."); |
| 27 shouldBeFalse("element.name in document"); | 27 shouldBeFalse("element.name in document"); |
| 28 shouldBeFalse("element.name in window"); | 28 shouldBeFalse("element.name in window"); |
| 29 | 29 |
| 30 element.setAttribute('name', 'renamed_' + tagName); | 30 element.setAttribute('name', 'renamed_' + tagName); |
| 31 debug("<" + tagName + ">: After changing its name attribute into " + e
lement.name + " by using setAttribute, the name should not still be in document.
"); | 31 debug("<" + tagName + ">: After changing its name attribute into " + e
lement.name + " by using setAttribute, the name should not still be in document.
"); |
| 32 shouldBeFalse("element.name in document"); | 32 shouldBeFalse("element.name in document"); |
| 33 shouldBeFalse("element.name in window"); | 33 shouldBeFalse("element.name in window"); |
| 34 element.name = 're-renamed_' + tagName; | 34 element.name = 're-renamed_' + tagName; |
| 35 debug("<" + tagName + ">: After changing its name attribute into " + e
lement.name + " by using '.name=', the name should not still be in document."); | 35 debug("<" + tagName + ">: After changing its name attribute into " + e
lement.name + " by using '.name=', the name should not still be in document."); |
| 36 shouldBeFalse("element.name in document"); | 36 shouldBeFalse("element.name in document"); |
| 37 shouldBeFalse("element.name in window"); | 37 shouldBeFalse("element.name in window"); |
| 38 }); | 38 }); |
| 39 </script> | 39 </script> |
| 40 </body> | 40 </body> |
| 41 </html> | 41 </html> |
| OLD | NEW |