OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 | 3 |
4 <link rel="stylesheet" href="resources/styles-new-API.css"> | 4 <link rel="stylesheet" href="resources/styles-new-API.css"> |
5 | 5 |
6 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 6 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
7 <script src="../../../http/tests/inspector/elements-test.js"></script> | 7 <script src="../../../http/tests/inspector/elements-test.js"></script> |
8 <script src="styles-test.js"></script> | 8 <script src="styles-test.js"></script> |
9 <script> | 9 <script> |
10 | 10 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 if (rule.selectorList.text !== "body.mainpage") { | 234 if (rule.selectorList.text !== "body.mainpage") { |
235 continue; | 235 continue; |
236 } | 236 } |
237 setRuleSelector(rule); | 237 setRuleSelector(rule); |
238 return; | 238 return; |
239 } | 239 } |
240 InspectorTest.addResult("Error: rule with selector body.mainpage
is not found"); | 240 InspectorTest.addResult("Error: rule with selector body.mainpage
is not found"); |
241 InspectorTest.completeTest(); | 241 InspectorTest.completeTest(); |
242 } | 242 } |
243 | 243 |
244 function didPatchStyleSheet(styleSheedId) | 244 function didPatchStyleSheet(styleSheetId) |
245 { | 245 { |
246 CSSAgent.getMatchedStylesForNode(bodyId, false, false, onMatched
StylesForNode); | 246 CSSAgent.getMatchedStylesForNode(bodyId, false, false, onMatched
StylesForNode); |
247 } | 247 } |
248 | 248 |
249 function patchStyleSheet(styleSheetId) | 249 function patchStyleSheet(styleSheetId) |
250 { | 250 { |
251 InspectorTest.addResult(""); | 251 InspectorTest.addResult(""); |
252 InspectorTest.addResult("=== Last stylesheet patched ==="); | 252 InspectorTest.addResult("=== Last stylesheet patched ==="); |
253 CSSAgent.setStyleSheetText(styleSheetId, newStyleSheetText, | 253 CSSAgent.setStyleSheetText(styleSheetId, newStyleSheetText, |
254 loadAndDumpStyleSheet.bind(null, styleSheetId, didPatchStyle
Sheet)); | 254 loadAndDumpStyleSheet.bind(null, styleSheetId, didPatchStyle
Sheet)); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 289 |
290 function ruleAdded(error, rule) | 290 function ruleAdded(error, rule) |
291 { | 291 { |
292 if (error) { | 292 if (error) { |
293 InspectorTest.addResult("error: " + error); | 293 InspectorTest.addResult("error: " + error); |
294 return; | 294 return; |
295 } | 295 } |
296 CSSAgent.setPropertyText(rule.style.styleId, 0, "font-family: se
rif;", false, didSetStyleText); | 296 CSSAgent.setPropertyText(rule.style.styleId, 0, "font-family: se
rif;", false, didSetStyleText); |
297 } | 297 } |
298 | 298 |
299 CSSAgent.addRule(bodyId, "body", ruleAdded); | 299 function viaInspectorStyleSheetCreated(error, styleSheetId) |
| 300 { |
| 301 if (error) { |
| 302 InspectorTest.addResult("error: " + error); |
| 303 InspectorTest.completeTest(); |
| 304 return; |
| 305 } |
| 306 CSSAgent.addRule(styleSheetId, "body", ruleAdded); |
| 307 } |
| 308 |
| 309 var frameId = WebInspector.resourceTreeModel.mainFrame.id; |
| 310 CSSAgent.createStyleSheet(frameId, viaInspectorStyleSheetCreated.bin
d(this)); |
300 }, | 311 }, |
301 | 312 |
302 function test_disableProperty(next) | 313 function test_disableProperty(next) |
303 { | 314 { |
304 function didEnableProperty(style) | 315 function didEnableProperty(style) |
305 { | 316 { |
306 InspectorTest.addResult(""); | 317 InspectorTest.addResult(""); |
307 InspectorTest.addResult("=== After property enabled ==="); | 318 InspectorTest.addResult("=== After property enabled ==="); |
308 InspectorTest.dumpCSSStyleDeclaration(style); | 319 InspectorTest.dumpCSSStyleDeclaration(style); |
309 next(); | 320 next(); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 470 |
460 <body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font-
weight: normal; width: 85%; background-image: url(bar.png)"> | 471 <body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font-
weight: normal; width: 85%; background-image: url(bar.png)"> |
461 <p> | 472 <p> |
462 Tests that InspectorCSSAgent API methods work as expected. | 473 Tests that InspectorCSSAgent API methods work as expected. |
463 </p> | 474 </p> |
464 <table width="50%" id="thetable"> | 475 <table width="50%" id="thetable"> |
465 </table> | 476 </table> |
466 <h1 id="toggle">H1</h1> | 477 <h1 id="toggle">H1</h1> |
467 </body> | 478 </body> |
468 </html> | 479 </html> |
OLD | NEW |