Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: LayoutTests/fast/dom/StyleSheet/gc-parent-rule.html

Issue 238303004: Remove DOMImplementation.createCSSStyleSheet() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update tests Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/dom/StyleSheet/gc-parent-rule-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../../resources/js-test.js"></script> 3 <script src="../../../resources/js-test.js"></script>
4 </head> 4 </head>
5 <body onload="test()"> 5 <body onload="test()">
6 <script> 6 <script>
7 window.jsTestIsAsync = true; 7 window.jsTestIsAsync = true;
8 description("Test that CSS rules don't lose custom properties on GC when only re achable through child rules."); 8 description("Test that CSS rules don't lose custom properties on GC when only re achable through child rules.");
9 9
10 function createCSSStyleSheet()
11 {
12 style = document.createElement("style");
13 document.head.appendChild(style);
14 shouldBeType("style.sheet", "CSSStyleSheet");
15 var sheet = style.sheet;
16 document.head.removeChild(style);
17 shouldBeNull("style.sheet");
18 return sheet;
19 }
20
10 function test() 21 function test()
11 { 22 {
12 var sheet = document.implementation.createCSSStyleSheet("title", "screen"); 23 var sheet = createCSSStyleSheet();
13 sheet.insertRule("@media all { div { color:black } }", 0); 24 sheet.insertRule("@media all { div { color:black } }", 0);
14 rule = sheet.rules[0].cssRules[0]; 25 rule = sheet.rules[0].cssRules[0];
15 rule.parentRule.foo = "bar"; 26 rule.parentRule.foo = "bar";
16 sheet = null; 27 sheet = null;
17 28
18 gc(); 29 gc();
19 setTimeout(function() { 30 setTimeout(function() {
20 gc(); 31 gc();
21 shouldBe('rule.parentRule.foo', '"bar"'); 32 shouldBe('rule.parentRule.foo', '"bar"');
22 finishJSTest(); 33 finishJSTest();
23 }, 0); 34 }, 0);
24 } 35 }
25 </script> 36 </script>
26 <foo id="mystyle" style="display:none">.div { color: white; }</foo> 37 <foo id="mystyle" style="display:none">.div { color: white; }</foo>
27 </body> 38 </body>
28 </html> 39 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/StyleSheet/gc-parent-rule-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698