| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <style> | 3 <style> |
| 4 @media all { #test { color: green; } } | 4 @media all { #test { color: green; } } |
| 5 </style> | 5 </style> |
| 6 <script src="../../../resources/js-test.js"></script> | 6 <script src="../../../resources/js-test.js"></script> |
| 7 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 <div id="test"></div> | 9 <div id="test"></div> |
| 10 <script> | 10 <script> |
| 11 description("Test that CSS stylesheets lacking wrappers are pruned from detached
CSSOM subtrees. " + | 11 description("Test that detached CSSOM subtrees keeps a reference to CSS styleshe
ets lacking wrappers."); |
| 12 "This is surprising behavior, but it's a very rare situation, and the behavior a
ctually matches " + | |
| 13 "what both WebKit and Gecko do for DOM nodes in detached subtrees."); | |
| 14 | 12 |
| 15 shouldBe('getMatchedCSSRules(document.getElementById("test")).length', '1'); | 13 shouldBe('getMatchedCSSRules(document.getElementById("test")).length', '1'); |
| 16 rule = getMatchedCSSRules(document.getElementById("test")).item(0); | 14 rule = getMatchedCSSRules(document.getElementById("test")).item(0); |
| 17 debug("Removing <style>..."); | 15 debug("Removing <style>..."); |
| 18 document.head.removeChild(document.getElementsByTagName("style")[0]); | 16 document.head.removeChild(document.getElementsByTagName("style")[0]); |
| 19 shouldBe("rule.parentRule", "null"); | 17 shouldNotBe("rule.parentRule", "null"); |
| 20 shouldBe('getMatchedCSSRules(document.getElementById("test"))', 'null'); | 18 shouldBe('getMatchedCSSRules(document.getElementById("test"))', 'null'); |
| 21 </script> | 19 </script> |
| 22 </body> | 20 </body> |
| 23 </html> | 21 </html> |
| OLD | NEW |