Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / styles / import-pseudoclass-crash.html
1 <html>
2 <head>
3 <link rel="stylesheet" href="resources/import-pseudoclass-crash.css">
4 <script src="../../http/tests/inspector/inspector-test.js"></script>
5 <script src="../../http/tests/inspector/elements-test.js"></script>
6 <script>
7
8 function test()
9 {
10     WebInspector.showPanel("elements");
11     InspectorTest.nodeWithId("lastchild", nodeFound);
12
13     function nodeFound(node)
14     {
15         WebInspector.cssModel.getMatchedStylesAsync(node.id, true, false, matchedStylesCallback);
16     }
17
18     var styleSheetId;
19
20     function matchedStylesCallback(styles)
21     {
22         styleSheetId = styles.matchedCSSRules[1].id.styleSheetId;
23         CSSAgent.setStyleSheetText(styleSheetId,
24             "@import url(\"import-pseudoclass-crash-empty.css\");\n\n:last-child { color: #000001; }\n", modifiedCallback);
25     }
26
27     function modifiedCallback()
28     {
29         CSSAgent.setStyleSheetText(styleSheetId, "@import url(\"import-pseudoclass-crash-empty.css\");\n\n:last-child { color: #002001; }\n", modifiedCallback2);
30     }
31
32     function modifiedCallback2()
33     {
34         InspectorTest.completeTest();
35     }
36 }
37
38 </script>
39 </head>
40
41 <body onload="runTest()">
42 <p>
43 Tests that modifying stylesheet text with @import and :last-child selector does not crash (<a href="https://bugs.webkit.org/show_bug.cgi?id=95324">Bug 95324</a>).
44 </p>
45
46 <div>
47     <p id="lastchild">:last-child</p>
48 </div>
49 </body>
50 </html>