10 <script src="../../../http/tests/inspector/inspector-test.js"></script>
11 <script src="../../../http/tests/inspector/elements-test.js"></script>
15 WebInspector.inspectorView.showPanel("elements");
16 InspectorTest.nodeWithId("styler", onNodeLoaded);
18 function onNodeLoaded(node)
20 CSSAgent.getMatchedStylesForNode(node.id, onMatchedStyles);
23 function onMatchedStyles(error, matchedRules)
26 InspectorTest.addResult(error);
27 InspectorTest.completeTest();
30 for(var i = 0; i < matchedRules.length; ++i) {
31 if (matchedRules[i].rule.origin !== "regular")
33 editRule(matchedRules[i].rule);
36 InspectorTest.addResult("Didn't find regular rule");
37 InspectorTest.completeTest();
40 function editRule(rule)
42 var style = rule.style;
43 InspectorTest.addResult(style.cssProperties[0].text);
45 const outOfBOundsRuleIndex = 10;
46 CSSAgent.setPropertyText(style.styleId, outOfBOundsRuleIndex, "color:blue;", true, dumpErrorMessage);
49 function dumpErrorMessage(error)
51 InspectorTest.addResult(error);
52 InspectorTest.completeTest();
58 <body onload="runTest()">
60 Tests that setting CSS property text out of boundaries does not crash.