3 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
4 <script type=
"text/javascript">
8 var inlineStyleSheetId
;
10 InspectorTest
.sendCommand("CSS.enable", {}, cssWasEnabled
);
12 function cssWasEnabled()
14 InspectorTest
.sendCommandOrDie("DOM.getDocument", {}, onGotDocument
);
17 function onGotDocument(result
)
19 var root
= result
.root
;
20 InspectorTest
.sendCommandOrDie("DOM.querySelector", {
26 function onGotNode(node
)
28 InspectorTest
.sendCommandOrDie("CSS.getInlineStylesForNode", { nodeId
: node
.nodeId
}, onGotInlineStyles
);
31 function onGotInlineStyles(result
)
33 inlineStyleSheetId
= result
.inlineStyle
.styleSheetId
;
34 InspectorTest
.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId
: inlineStyleSheetId
}, onReceiveStyleSheetText
);
37 function onReceiveStyleSheetText(result
)
39 InspectorTest
.log(result
.text
);
40 InspectorTest
.sendCommandOrDie("CSS.setStyleSheetText", {
41 styleSheetId
: inlineStyleSheetId
,
42 text
: "border: 1px solid black;"
43 }, onSetStyleSheetBody
);
46 function onSetStyleSheetBody(result
)
48 InspectorTest
.sendCommandOrDie("CSS.getStyleSheetText", { styleSheetId
: inlineStyleSheetId
}, onCheckStyleSheetBody
);
51 function onCheckStyleSheetBody(result
)
53 InspectorTest
.log(result
.text
);
54 InspectorTest
.completeTest();
60 <body onload=
"runTest()">
62 <div id=
"inliner" style=
"color: red;">