| Index: LayoutTests/inspector-protocol/css/cssom-matching-rules-multiple.html
|
| diff --git a/LayoutTests/inspector-protocol/css/cssom-matching-rules-multiple.html b/LayoutTests/inspector-protocol/css/cssom-matching-rules-multiple.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..80b378b368883779552f5d0952dd1645b5253c52
|
| --- /dev/null
|
| +++ b/LayoutTests/inspector-protocol/css/cssom-matching-rules-multiple.html
|
| @@ -0,0 +1,112 @@
|
| +<html>
|
| +<head>
|
| +
|
| +<style>
|
| +#test {
|
| + color: red;
|
| +}
|
| +
|
| +#test {
|
| + color: green;
|
| +}
|
| +
|
| +#test {
|
| + color: blue;
|
| +}
|
| +
|
| +#test {
|
| + width: 10%;
|
| +}
|
| +
|
| +#test {
|
| + width: 20%;
|
| +}
|
| +
|
| +#test {
|
| + width: 30%;
|
| +}
|
| +
|
| +#test {
|
| + width: 40%;
|
| +}
|
| +
|
| +#test {
|
| + width: 50%;
|
| +}
|
| +
|
| +#test {
|
| + width: 60%;
|
| +}
|
| +</style>
|
| +
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/css-protocol-test.js"></script>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/dom-protocol-test.js"></script>
|
| +<script type="text/javascript">
|
| +
|
| +function test()
|
| +{
|
| + var documentNodeId;
|
| +
|
| + InspectorTest.requestDocumentNodeId(onDocumentNodeId);
|
| +
|
| + function onDocumentNodeId(nodeId)
|
| + {
|
| + documentNodeId = nodeId;
|
| + InspectorTest.sendCommandOrDie("CSS.enable", {}, function() {
|
| + InspectorTest.runTestSuite(testSuite);
|
| + });
|
| + }
|
| +
|
| + var testSuite = [
|
| + function testModifyRule(next)
|
| + {
|
| + InspectorTest.log("--------------");
|
| + InspectorTest.log("Original rule:");
|
| + InspectorTest.loadAndDumpMatchingRules(documentNodeId, "#test", step1, true);
|
| +
|
| + function step1()
|
| + {
|
| + InspectorTest.log("Mutating 3rd:");
|
| + InspectorTest.log("---------------");
|
| + InspectorTest.evaluateInPage("document.styleSheets[0].rules[3].style.setProperty('color', 'red')");
|
| + InspectorTest.evaluateInPage("document.styleSheets[0].rules[3].style.removeProperty('width')");
|
| + InspectorTest.loadAndDumpMatchingRules(documentNodeId, "#test", step2, true);
|
| + }
|
| +
|
| + function step2()
|
| + {
|
| + InspectorTest.log("Mutating 4th:");
|
| + InspectorTest.log("--------------");
|
| + InspectorTest.evaluateInPage("document.styleSheets[0].rules[4].style.setProperty('color', 'green')");
|
| + InspectorTest.evaluateInPage("document.styleSheets[0].rules[4].style.removeProperty('width')");
|
| + InspectorTest.loadAndDumpMatchingRules(documentNodeId, "#test", step3, true);
|
| + }
|
| +
|
| + function step3()
|
| + {
|
| + InspectorTest.log("Mutating 5th:");
|
| + InspectorTest.log("--------------");
|
| + InspectorTest.evaluateInPage("document.styleSheets[0].rules[5].style.setProperty('color', 'blue')");
|
| + InspectorTest.evaluateInPage("document.styleSheets[0].rules[5].style.removeProperty('width')");
|
| + InspectorTest.loadAndDumpMatchingRules(documentNodeId, "#test", step4, true);
|
| + }
|
| +
|
| + function step4()
|
| + {
|
| + InspectorTest.log("Delete first 3:");
|
| + InspectorTest.log("---------------");
|
| + InspectorTest.evaluateInPage("for (var i = 0; i < 3; ++i) document.styleSheets[0].removeRule(0);");
|
| + InspectorTest.loadAndDumpMatchingRules(documentNodeId, "#test", next, true);
|
| + }
|
| + },
|
| + ];
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +<body onload="runTest();">
|
| +<p>The test verifies CSS.getMatchedStylesForNode when used concurrently with multiple CSSOM modifications.</p>
|
| +<article id="test"></article>
|
| +</body>
|
| +</html>
|
|
|