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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 InspectorTest.completeTest(); | 221 InspectorTest.completeTest(); |
222 return; | 222 return; |
223 } | 223 } |
224 InspectorTest.addResult(""); | 224 InspectorTest.addResult(""); |
225 InspectorTest.addResult("=== After selector set ==="); | 225 InspectorTest.addResult("=== After selector set ==="); |
226 loadAndDumpStyleSheet(rule.styleSheetId, setStyleText.bind(this,
rule)); | 226 loadAndDumpStyleSheet(rule.styleSheetId, setStyleText.bind(this,
rule)); |
227 } | 227 } |
228 | 228 |
229 function setRuleSelector(rule) | 229 function setRuleSelector(rule) |
230 { | 230 { |
231 var orm = WebInspector.CSSRule.parsePayload(WebInspector.cssMode
l, rule); | 231 var orm = WebInspector.CSSRule.parsePayload(InspectorTest.cssMod
el, rule); |
232 InspectorTest.CSSAgent.setRuleSelector(orm.styleSheetId, orm.sel
ectorRange, "html *, body[foo=\"bar\"]", didSetSelector); | 232 InspectorTest.CSSAgent.setRuleSelector(orm.styleSheetId, orm.sel
ectorRange, "html *, body[foo=\"bar\"]", didSetSelector); |
233 } | 233 } |
234 | 234 |
235 function onMatchedStylesForNode(error, matchedStyles) | 235 function onMatchedStylesForNode(error, matchedStyles) |
236 { | 236 { |
237 if (error) { | 237 if (error) { |
238 InspectorTest.addResult("error: " + error); | 238 InspectorTest.addResult("error: " + error); |
239 InspectorTest.completeTest(); | 239 InspectorTest.completeTest(); |
240 return; | 240 return; |
241 } | 241 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 } | 320 } |
321 var range = { | 321 var range = { |
322 startLine: 0, | 322 startLine: 0, |
323 startColumn: 0, | 323 startColumn: 0, |
324 endLine: 0, | 324 endLine: 0, |
325 endColumn: 0 | 325 endColumn: 0 |
326 }; | 326 }; |
327 InspectorTest.CSSAgent.addRule(styleSheetId, "body {}", range, r
uleAdded); | 327 InspectorTest.CSSAgent.addRule(styleSheetId, "body {}", range, r
uleAdded); |
328 } | 328 } |
329 | 329 |
330 var frameId = WebInspector.resourceTreeModel.mainFrame.id; | 330 var frameId = InspectorTest.resourceTreeModel.mainFrame.id; |
331 InspectorTest.CSSAgent.createStyleSheet(frameId, viaInspectorStyleSh
eetCreated.bind(this)); | 331 InspectorTest.CSSAgent.createStyleSheet(frameId, viaInspectorStyleSh
eetCreated.bind(this)); |
332 }, | 332 }, |
333 | 333 |
334 function test_disableProperty(next) | 334 function test_disableProperty(next) |
335 { | 335 { |
336 function didEnableProperty(style) | 336 function didEnableProperty(style) |
337 { | 337 { |
338 InspectorTest.addResult(""); | 338 InspectorTest.addResult(""); |
339 InspectorTest.addResult("=== After property enabled ==="); | 339 InspectorTest.addResult("=== After property enabled ==="); |
340 InspectorTest.dumpCSSStyleDeclaration(style); | 340 InspectorTest.dumpCSSStyleDeclaration(style); |
(...skipping 13 matching lines...) Expand all Loading... |
354 style.propertyAt(6).setDisabled(false, step); | 354 style.propertyAt(6).setDisabled(false, step); |
355 } | 355 } |
356 | 356 |
357 function parseStylePayload(callback, error, payload) | 357 function parseStylePayload(callback, error, payload) |
358 { | 358 { |
359 if (error) { | 359 if (error) { |
360 InspectorTest.addResult(error); | 360 InspectorTest.addResult(error); |
361 InspectorTest.completeTest(); | 361 InspectorTest.completeTest(); |
362 return; | 362 return; |
363 } | 363 } |
364 callback(WebInspector.CSSStyleDeclaration.parsePayload(WebInspec
tor.cssModel, payload)); | 364 callback(WebInspector.CSSStyleDeclaration.parsePayload(Inspector
Test.cssModel, payload)); |
365 } | 365 } |
366 | 366 |
367 function stylesCallback(error, matchedCSSRules) | 367 function stylesCallback(error, matchedCSSRules) |
368 { | 368 { |
369 if (error) { | 369 if (error) { |
370 InspectorTest.addResult("error: " + error); | 370 InspectorTest.addResult("error: " + error); |
371 return; | 371 return; |
372 } | 372 } |
373 // height : 100% ; | 373 // height : 100% ; |
374 // border: 1px solid; | 374 // border: 1px solid; |
375 // border-width: 2px; | 375 // border-width: 2px; |
376 // background-color : #33FF33; | 376 // background-color : #33FF33; |
377 // googles: abra; | 377 // googles: abra; |
378 // foo: .bar; | 378 // foo: .bar; |
379 // -moz-goog: 1***; | 379 // -moz-goog: 1***; |
380 // border-width: 0px; | 380 // border-width: 0px; |
381 // padding-top: 1px; [d] | 381 // padding-top: 1px; [d] |
382 | 382 |
383 var orm = WebInspector.CSSStyleDeclaration.parsePayload(WebInspe
ctor.cssModel, matchedCSSRules[1].rule.style); | 383 var orm = WebInspector.CSSStyleDeclaration.parsePayload(Inspecto
rTest.cssModel, matchedCSSRules[1].rule.style); |
384 orm.propertyAt(0).setDisabled(true, step1); | 384 orm.propertyAt(0).setDisabled(true, step1); |
385 | 385 |
386 function step1(orm) | 386 function step1(orm) |
387 { | 387 { |
388 orm.propertyAt(7).setDisabled(true, step2); | 388 orm.propertyAt(7).setDisabled(true, step2); |
389 } | 389 } |
390 | 390 |
391 function step2(orm) | 391 function step2(orm) |
392 { | 392 { |
393 InspectorTest.CSSAgent.setPropertyText(orm.styleSheetId, orm
.propertyAt(7).range.collapseToStart(), "font-size: 12px;", parseStylePayload.bi
nd(null, step3)); | 393 InspectorTest.CSSAgent.setPropertyText(orm.styleSheetId, orm
.propertyAt(7).range.collapseToStart(), "font-size: 12px;", parseStylePayload.bi
nd(null, step3)); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 490 |
491 <body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font-
weight: normal; width: 85%; background-image: url(bar.png)"> | 491 <body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font-
weight: normal; width: 85%; background-image: url(bar.png)"> |
492 <p> | 492 <p> |
493 Tests that InspectorCSSAgent API methods work as expected. | 493 Tests that InspectorCSSAgent API methods work as expected. |
494 </p> | 494 </p> |
495 <table width="50%" id="thetable"> | 495 <table width="50%" id="thetable"> |
496 </table> | 496 </table> |
497 <h1 id="toggle">H1</h1> | 497 <h1 id="toggle">H1</h1> |
498 </body> | 498 </body> |
499 </html> | 499 </html> |
OLD | NEW |