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

Side by Side Diff: LayoutTests/http/tests/css/resources/shared-stylesheet-mutation.js

Issue 1153493002: Remove CSSKeyframesRule.insertRule() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tests Created 5 years, 7 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
OLDNEW
1 var testCount = 17; 1 var testCount = 17;
2 var testDocuments = []; 2 var testDocuments = [];
3 var testSheets = []; 3 var testSheets = [];
4 var expectedResults = []; 4 var expectedResults = [];
5 5
6 function buildTestFrame(content) 6 function buildTestFrame(content)
7 { 7 {
8 var iframe = document.createElement("iframe"); 8 var iframe = document.createElement("iframe");
9 iframe.setAttribute("width", "100"); 9 iframe.setAttribute("width", "100");
10 iframe.setAttribute("height", "50"); 10 iframe.setAttribute("height", "50");
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 sheet.deleteRule(3);\ 100 sheet.deleteRule(3);\
101 sheet.deleteRule(1);\ 101 sheet.deleteRule(1);\
102 sheet.deleteRule(1);\ 102 sheet.deleteRule(1);\
103 '; 103 ';
104 mutationTest(11, testString, 'green'); 104 mutationTest(11, testString, 'green');
105 105
106 var importRule = '@import "data:text/css;charset=utf-8,%23testdiv%7Bbackgrou nd-color%3Agreen%20!important%7D";'; 106 var importRule = '@import "data:text/css;charset=utf-8,%23testdiv%7Bbackgrou nd-color%3Agreen%20!important%7D";';
107 mutationTest(12, "sheet.insertRule('"+importRule+"', 0)", 'green'); 107 mutationTest(12, "sheet.insertRule('"+importRule+"', 0)", 'green');
108 108
109 mutationTest(13, 'sheet.cssRules[2].selectorText = "foo"', 'red'); 109 mutationTest(13, 'sheet.cssRules[2].selectorText = "foo"', 'red');
110 mutationTest(14, 'sheet.cssRules[3].insertRule("40% { left: 40px; }")', 'red '); 110 mutationTest(14, 'sheet.cssRules[3].appendRule("40% { left: 40px; }")', 'red ');
111 mutationTest(15, 'sheet.cssRules[3].deleteRule("100%")', 'red'); 111 mutationTest(15, 'sheet.cssRules[3].deleteRule("100%")', 'red');
112 mutationTest(16, 'sheet.cssRules[4].style.setProperty("font-family", "Bar", "")', 'red'); 112 mutationTest(16, 'sheet.cssRules[4].style.setProperty("font-family", "Bar", "")', 'red');
113 113
114 setTimeout(finishedTests, 80); 114 setTimeout(finishedTests, 80);
115 } 115 }
116 116
117 function runTestsAfterLoadComplete(createCSSOMObjectBeforeTest) 117 function runTestsAfterLoadComplete(createCSSOMObjectBeforeTest)
118 { 118 {
119 var complete = true; 119 var complete = true;
120 for (var i = 0; i < testDocuments.length; ++i) { 120 for (var i = 0; i < testDocuments.length; ++i) {
121 var sheet = testDocuments[i].styleSheets.length == 1 ? testDocuments[i]. styleSheets[0] : null; 121 var sheet = testDocuments[i].styleSheets.length == 1 ? testDocuments[i]. styleSheets[0] : null;
122 if (sheet) 122 if (sheet)
123 testSheets[i] = sheet; 123 testSheets[i] = sheet;
124 else 124 else
125 complete = false; 125 complete = false;
126 } 126 }
127 if (!complete) { 127 if (!complete) {
128 setTimeout(runTestsAfterLoadComplete, 10); 128 setTimeout(runTestsAfterLoadComplete, 10);
129 return; 129 return;
130 } 130 }
131 executeTests(createCSSOMObjectBeforeTest); 131 executeTests(createCSSOMObjectBeforeTest);
132 } 132 }
133 133
134 function runTests(createCSSOMObjectBeforeTest) 134 function runTests(createCSSOMObjectBeforeTest)
135 { 135 {
136 buildTestFrames("<link rel=stylesheet href=resources/shared.css><div id=test div>Test</div>"); 136 buildTestFrames("<link rel=stylesheet href=resources/shared.css><div id=test div>Test</div>");
137 137
138 runTestsAfterLoadComplete(createCSSOMObjectBeforeTest); 138 runTestsAfterLoadComplete(createCSSOMObjectBeforeTest);
139 } 139 }
OLDNEW
« no previous file with comments | « LayoutTests/animations/keyframes-rule-expected.txt ('k') | LayoutTests/http/tests/css/shared-stylesheet-mutation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698