Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: LayoutTests/inspector-protocol/css/css-set-inline-styleSheetText.html

Issue 132803013: DevTools: [CSS] setStyleSheetText to work with inline stylesheets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address @apavlov comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/css/css-set-inline-styleSheetText-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource s/protocol-test.js"></script>
4 <script type="text/javascript">
5
6 function test()
7 {
8 var inlineStyleSheetId;
9 function sendCommand(command, properties, callback) {
10 InspectorTest.sendCommand(command, properties || {}, commandCallback);
11 function commandCallback(msg)
12 {
13 if (msg.error) {
14 InspectorTest.log(msg.error.message);
15 InspectorTest.completeTest();
16 return;
17 }
18 callback(msg.result);
19 }
20 }
21
22 InspectorTest.sendCommand("CSS.enable", {}, cssWasEnabled);
23
24 function cssWasEnabled()
25 {
26 sendCommand("DOM.getDocument", {}, onGotDocument);
27 }
28
29 function onGotDocument(result)
30 {
31 var root = result.root;
32 sendCommand("DOM.querySelector", {
33 nodeId: root.nodeId,
34 selector: "#inliner"
35 }, onGotNode);
36 }
37
38 function onGotNode(node)
39 {
40 sendCommand("CSS.getInlineStylesForNode", { nodeId: node.nodeId }, onGot InlineStyles);
41 }
42
43 function onGotInlineStyles(result)
44 {
45 inlineStyleSheetId = result.inlineStyle.styleId.styleSheetId;
46 sendCommand("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId }, onReceiveStyleSheetText);
47 }
48
49 function onReceiveStyleSheetText(result)
50 {
51 InspectorTest.log(result.text);
52 sendCommand("CSS.setStyleSheetText", {
53 styleSheetId: inlineStyleSheetId,
54 text: "border: 1px solid black;"
55 }, onSetStyleSheetBody);
56 }
57
58 function onSetStyleSheetBody(result)
59 {
60 sendCommand("CSS.getStyleSheetText", { styleSheetId: inlineStyleSheetId }, onCheckStyleSheetBody);
61 }
62
63 function onCheckStyleSheetBody(result)
64 {
65 InspectorTest.log(result.text);
66 InspectorTest.completeTest();
67 }
68 };
69
70 </script>
71 </head>
72 <body onload="runTest()">
73
74 <div id="inliner" style="color: red;">
75 </div>
76
77 </body>
78 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/css/css-set-inline-styleSheetText-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698