Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / selector-text-escape.html
blobb7967918a19276c3501e828da360afa8a8dcfc9d
1 <!doctype html>
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5 <title>Bug 34529 - [CSSOM] issues with cssText and selectorText</title>
6 <style type="text/css">
7 /* Control characters */
8 .\01_class {
9 color:green;
11 .\1f_class {
12 color:green;
14 .\30_class {
15 color:green;
17 .\39_class {
18 color:green;
20 /* Characters following '-' */
21 .-\30_class {
22 color:green;
24 .-\39_class {
25 color:green;
27 .-\2d_class {
28 color:green;
30 /* non-ASCII characters */
31 .\81_class {
32 color:green;
34 /* unicode characters */
35 .日本語_class {
36 color:green;
38 /* unicode supplementary characters (surrogate pairs) */
39 .𐐀_class {
40 color:green;
42 /* plain characters */
43 .azAZ09_-_class {
44 color:green;
46 .\(\/\:\@\[\~_class {
47 color:green;
49 /* ID */
50 #a\.external\:visited {
51 color:green;
53 /* String */
54 li[myattr="my\"value\\"] {
55 color:green;
58 li {
59 color:red;
61 </style>
62 <script src="../../resources/js-test.js"></script>
63 </head>
64 <body>
65 <p id="description"></p>
67 List items must be green. Otherwise some selectors are invalid.
68 <ul>
69 <li class="&#001;_class">class="&amp;#001;_class"</li>
70 <li class="&#031;_class">class="&amp;#031;_class"</li>
71 <li class="0_class">class="0_class"</li>
72 <li class="9_class">class="9_class"</li>
73 <li class="-0_class">class="-0_class"</li>
74 <li class="-9_class">class="-9_class"</li>
75 <li class="--_class">class="--_class"</li>
76 <li class="&#129;_class">class="&amp;#129;_class"</li>
77 <li class="日本語_class">class="日本語_class"</li>
78 <li class="&#66560;_class">class="&#66560;_class"</li>
79 <li class="azAZ09_-_class">class="azAZ09_-_class"</li>
80 <li class="(/:@[~_class">class="(/:@[~_class"</li>
81 <li id="a.external:visited">id="a.external:visited"</li>
82 <li myattr="my&#034;value&#092;">myattr="my&#034;value&#092;"</li>
83 </ul>
85 <div id="console"></div>
86 <script type="text/javascript">
87 description("Test for Bug 34529 - [CSSOM] issues with cssText and selectorText");
89 var expectedTexts = [
90 ".\\1 _class",
91 ".\\1f _class",
92 ".\\30 _class",
93 ".\\39 _class",
94 ".-\\30 _class",
95 ".-\\39 _class",
96 ".--_class",
97 ".\x81_class",
98 ".日本語_class",
99 ".𐐀_class",
100 ".azAZ09_-_class",
101 ".\\(\\/\\:\\@\\[\\~_class",
102 "#a\\.external\\:visited",
103 'li[myattr="my\\"value\\\\"]'
106 var rules = document.styleSheets[0].cssRules;
107 for (var i = 0; i < expectedTexts.length; i++) {
108 shouldBe("rules[" + i + "].selectorText", "expectedTexts[" + i + "]");
109 shouldBe("rules[" + i + "].cssText", "expectedTexts[" + i + "] + ' { color: green; }'");
111 </script>
112 </body>
113 </html>