Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / styles / parse-stylesheet-errors.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/elements-test.js"></script>
5 <script>
6
7 function test()
8 {
9     WebInspector.showPanel("elements");
10
11     CSSAgent.getAllStyleSheets(headersCallback);
12
13     function headersCallback(error, headers)
14     {
15         if (error) {
16             InspectorTest.addResult("Error loading stylesheet headers: " + error);
17             InspectorTest.completeTest();
18             return;
19         }
20
21         for (var i = 0; i < headers.length; ++i)
22             CSSAgent.getStyleSheet(headers[i].styleSheetId, styleSheetCallback.bind(null, i === headers.length - 1));
23     }
24
25     function styleSheetCallback(isLast, error, styleSheet)
26     {
27         if (error) {
28             InspectorTest.addResult("Error loading stylesheet body: " + error);
29             InspectorTest.completeTest();
30             return;
31         }
32
33         InspectorTest.dumpRulesArray(styleSheet.rules);
34         if (isLast)
35             InspectorTest.completeTest();
36     }
37 }
38
39 </script>
40
41 <style>
42 body {
43     color: black;
44 }
45
46 font-family: serif;
47 }
48
49 body:hover {
50     color: #CDE;
51 }
52
53 body {
54     background-color: broken-declaration;
55 }
56
57 </style>
58 <style>
59 @import 12;
60 body {
61     color: import-error;
62 }
63 </style>
64 <style>
65 @import 12 {}
66 body {
67     color: import-error-block;
68 }
69 </style>
70 <style>
71 @media ;
72 body {
73     color: media-empty;
74 }
75 </style>
76 <style>
77 @page ;
78 body {
79     color: page-error;
80 }
81 </style>
82 <style>
83 @page {}
84 body {
85     color: page-block;
86 }
87 </style>
88 <style>
89 body {
90     color: before-import;
91 }
92 @import "foo";
93 body {
94     color: after-import;
95 }
96 </style>
97 <style>
98 body {
99     color: before-viewport;
100 }
101 @viewport {
102 }
103 body {
104     color: after-viewport;
105 }
106 </style>
107 <style>
108 @font-face {
109     font-family: initial;
110 }
111 body {
112     color: after-invalid-font-face;
113 }
114 </style>
115 <style>
116 @-webkit-region %^% {
117 }
118 body {
119     color: after-invalid-region;
120 }
121 </style>
122 <style>
123 body {
124   margin-left: 1px;
125   #;
126   margin-left: 2px;
127 }
128 </style>
129 <style>
130 body {
131   margin-right: 1px;
132   {};
133   margin-right: 2px;
134 }
135 </style>
136 <style>
137 body {
138   #;
139   margin-top: 1px;
140 }
141 </style>
142 <style>
143 body {
144   {};
145   margin-bottom: 2px;
146 }
147 </style>
148 </head>
149
150 <body onload="runTest()">
151 <p>
152 Tests that CSSParser produces source data consistent with CSSOM when parsing broken stylesheets. <a href="https://bugs.webkit.org/show_bug.cgi?id=98246">Bug 98246</a>
153 </body>
154 </html>