3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script>
4 <script type="text/javascript">
8 var inlineStyleSheetId;
9 function sendCommand(command, properties, callback) {
10 InspectorTest.sendCommand(command, properties || {}, commandCallback);
11 function commandCallback(msg)
14 InspectorTest.log(msg.error.message);
15 InspectorTest.completeTest();
22 InspectorTest.sendCommand("CSS.enable", {}, cssWasEnabled);
24 function cssWasEnabled()
26 sendCommand("DOM.getDocument", {}, onGotDocument);
29 function onGotDocument(result)
31 var root = result.root;
32 sendCommand("DOM.querySelector", {
38 function onGotNode(node)
40 sendCommand("CSS.getInlineStylesForNode", { nodeId: node.nodeId }, onGotInlineStyles);
43 function onGotInlineStyles(result)
45 inlineStyleSheetId = result.inlineStyle.styleId.styleSheetId;
46 sendCommand("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId }, onReceiveStyleSheetText);
49 function onReceiveStyleSheetText(result)
51 InspectorTest.log(result.text);
52 sendCommand("CSS.setStyleSheetText", {
53 styleSheetId: inlineStyleSheetId,
54 text: "border: 1px solid black;"
55 }, onSetStyleSheetBody);
58 function onSetStyleSheetBody(result)
60 sendCommand("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId }, onCheckStyleSheetBody);
63 function onCheckStyleSheetBody(result)
65 InspectorTest.log(result.text);
66 InspectorTest.completeTest();
72 <body onload="runTest()">
74 <div id="inliner" style="color: red;">