wpa_cli_web 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. data/.bowerrc +3 -0
  2. data/lib/wpa_cli_web.rb +19 -31
  3. data/lib/wpa_cli_web/public/bower_components/house-style/.bower.json +14 -0
  4. data/lib/wpa_cli_web/public/bower_components/house-style/.bowerrc +3 -0
  5. data/lib/wpa_cli_web/public/bower_components/house-style/.gitignore +2 -0
  6. data/lib/wpa_cli_web/public/bower_components/house-style/Gemfile +6 -0
  7. data/lib/wpa_cli_web/public/bower_components/house-style/Gruntfile.js +99 -0
  8. data/lib/wpa_cli_web/public/bower_components/house-style/Guardfile +19 -0
  9. data/lib/wpa_cli_web/public/bower_components/house-style/bower.json +7 -0
  10. data/lib/wpa_cli_web/public/bower_components/house-style/bower_components/normalize-css/LICENSE.md +19 -0
  11. data/lib/wpa_cli_web/public/bower_components/house-style/bower_components/normalize-css/README.md +49 -0
  12. data/lib/wpa_cli_web/public/bower_components/house-style/bower_components/normalize-css/bower.json +23 -0
  13. data/lib/wpa_cli_web/public/bower_components/house-style/bower_components/normalize-css/normalize.css +396 -0
  14. data/lib/wpa_cli_web/public/bower_components/house-style/house-style.css +860 -0
  15. data/lib/wpa_cli_web/public/bower_components/house-style/house-style.min.css +1 -0
  16. data/lib/wpa_cli_web/public/bower_components/house-style/modules/base/base.css +37 -0
  17. data/lib/wpa_cli_web/public/bower_components/house-style/modules/button/button.css +26 -0
  18. data/lib/wpa_cli_web/public/bower_components/house-style/modules/grid/grid.css +151 -0
  19. data/lib/wpa_cli_web/public/bower_components/house-style/modules/grid/grid.png +0 -0
  20. data/lib/wpa_cli_web/public/bower_components/house-style/modules/grid/images.html +208 -0
  21. data/lib/wpa_cli_web/public/bower_components/house-style/modules/grid/index.html +141 -0
  22. data/lib/wpa_cli_web/public/bower_components/house-style/modules/loading/index.html +22 -0
  23. data/lib/wpa_cli_web/public/bower_components/house-style/modules/loading/loading.css +41 -0
  24. data/lib/wpa_cli_web/public/bower_components/house-style/modules/loading/spinner.svg +11 -0
  25. data/lib/wpa_cli_web/public/bower_components/house-style/modules/masthead/bbc-blocks-white.png +0 -0
  26. data/lib/wpa_cli_web/public/bower_components/house-style/modules/masthead/index.html +20 -0
  27. data/lib/wpa_cli_web/public/bower_components/house-style/modules/masthead/masthead.css +23 -0
  28. data/lib/wpa_cli_web/public/bower_components/house-style/modules/panel/panel.css +71 -0
  29. data/lib/wpa_cli_web/public/bower_components/house-style/modules/project-header/index.html +22 -0
  30. data/lib/wpa_cli_web/public/bower_components/house-style/modules/project-header/project-header.css +37 -0
  31. data/lib/wpa_cli_web/public/bower_components/house-style/modules/table/index.html +26 -0
  32. data/lib/wpa_cli_web/public/bower_components/house-style/modules/table/table.css +6 -0
  33. data/lib/wpa_cli_web/public/bower_components/house-style/modules/transitions/transitions.css +11 -0
  34. data/lib/wpa_cli_web/public/bower_components/house-style/package.json +21 -0
  35. data/lib/wpa_cli_web/public/bower_components/house-style/vendor/prefixfree.min.js +5 -0
  36. data/lib/wpa_cli_web/public/bower_components/normalize-css/.bower.json +21 -0
  37. data/lib/wpa_cli_web/public/bower_components/normalize-css/LICENSE.md +19 -0
  38. data/lib/wpa_cli_web/public/bower_components/normalize-css/README.md +49 -0
  39. data/lib/wpa_cli_web/public/bower_components/normalize-css/bower.json +12 -0
  40. data/lib/wpa_cli_web/public/bower_components/normalize-css/normalize.css +396 -0
  41. data/lib/wpa_cli_web/public/bower_components/qwery/.bower.json +14 -0
  42. data/lib/wpa_cli_web/public/bower_components/qwery/.gitignore +3 -0
  43. data/lib/wpa_cli_web/public/bower_components/qwery/.travis.yml +10 -0
  44. data/lib/wpa_cli_web/public/bower_components/qwery/LICENSE +7 -0
  45. data/lib/wpa_cli_web/public/bower_components/qwery/Makefile +6 -0
  46. data/lib/wpa_cli_web/public/bower_components/qwery/README.md +167 -0
  47. data/lib/wpa_cli_web/public/bower_components/qwery/config/smoosh.json +35 -0
  48. data/lib/wpa_cli_web/public/bower_components/qwery/integration/ender.js +1033 -0
  49. data/lib/wpa_cli_web/public/bower_components/qwery/integration/integration.html +26 -0
  50. data/lib/wpa_cli_web/public/bower_components/qwery/mobile/ender.js +62 -0
  51. data/lib/wpa_cli_web/public/bower_components/qwery/mobile/package.json +14 -0
  52. data/lib/wpa_cli_web/public/bower_components/qwery/mobile/qwery-mobile.js +79 -0
  53. data/lib/wpa_cli_web/public/bower_components/qwery/mobile/qwery-mobile.min.js +7 -0
  54. data/lib/wpa_cli_web/public/bower_components/qwery/mobile/src/mobile.js +72 -0
  55. data/lib/wpa_cli_web/public/bower_components/qwery/package.json +25 -0
  56. data/lib/wpa_cli_web/public/bower_components/qwery/pseudos/package.json +17 -0
  57. data/lib/wpa_cli_web/public/bower_components/qwery/pseudos/qwery-pseudos.js +106 -0
  58. data/lib/wpa_cli_web/public/bower_components/qwery/pseudos/qwery-pseudos.min.js +7 -0
  59. data/lib/wpa_cli_web/public/bower_components/qwery/pseudos/src/pseudos.js +99 -0
  60. data/lib/wpa_cli_web/public/bower_components/qwery/qwery.js +369 -0
  61. data/lib/wpa_cli_web/public/bower_components/qwery/qwery.min.js +7 -0
  62. data/lib/wpa_cli_web/public/bower_components/qwery/src/copyright.js +6 -0
  63. data/lib/wpa_cli_web/public/bower_components/qwery/src/ender.js +62 -0
  64. data/lib/wpa_cli_web/public/bower_components/qwery/src/qwery.js +362 -0
  65. data/lib/wpa_cli_web/public/bower_components/qwery/tests/W3C-Selector-tests.html +1372 -0
  66. data/lib/wpa_cli_web/public/bower_components/qwery/tests/benchmarks.html +220 -0
  67. data/lib/wpa_cli_web/public/bower_components/qwery/tests/index.html +132 -0
  68. data/lib/wpa_cli_web/public/bower_components/qwery/tests/mobile.html +58 -0
  69. data/lib/wpa_cli_web/public/bower_components/qwery/tests/phantom.js +43 -0
  70. data/lib/wpa_cli_web/public/bower_components/qwery/tests/test-env.js +25 -0
  71. data/lib/wpa_cli_web/public/bower_components/qwery/tests/tests.js +533 -0
  72. data/lib/wpa_cli_web/public/bower_components/qwery/vendor/nw.js +1680 -0
  73. data/lib/wpa_cli_web/public/bower_components/qwery/vendor/sink.css +79 -0
  74. data/lib/wpa_cli_web/public/bower_components/qwery/vendor/sink.js +181 -0
  75. data/lib/wpa_cli_web/public/bower_components/qwery/vendor/sizzle.js +1400 -0
  76. data/lib/wpa_cli_web/public/bower_components/reqwest/.bower.json +14 -0
  77. data/lib/wpa_cli_web/public/bower_components/reqwest/.gitignore +1 -0
  78. data/lib/wpa_cli_web/public/bower_components/reqwest/.jshintrc +61 -0
  79. data/lib/wpa_cli_web/public/bower_components/reqwest/Makefile +8 -0
  80. data/lib/wpa_cli_web/public/bower_components/reqwest/README.md +308 -0
  81. data/lib/wpa_cli_web/public/bower_components/reqwest/build.json +74 -0
  82. data/lib/wpa_cli_web/public/bower_components/reqwest/make/tests.js +89 -0
  83. data/lib/wpa_cli_web/public/bower_components/reqwest/package.json +27 -0
  84. data/lib/wpa_cli_web/public/bower_components/reqwest/reqwest.js +565 -0
  85. data/lib/wpa_cli_web/public/bower_components/reqwest/reqwest.min.js +7 -0
  86. data/lib/wpa_cli_web/public/bower_components/reqwest/src/copyright.js +6 -0
  87. data/lib/wpa_cli_web/public/bower_components/reqwest/src/ender.js +26 -0
  88. data/lib/wpa_cli_web/public/bower_components/reqwest/src/reqwest.js +559 -0
  89. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/ender.js +117 -0
  90. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/badfixtures.xml +1 -0
  91. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures.html +1 -0
  92. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures.js +1 -0
  93. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures.json +1 -0
  94. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures.xml +1 -0
  95. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp.jsonp +1 -0
  96. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp2.jsonp +1 -0
  97. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp3.jsonp +1 -0
  98. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp_multi.jsonp +1 -0
  99. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp_multi_b.jsonp +1 -0
  100. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_jsonp_multi_c.jsonp +1 -0
  101. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/fixtures_with_prefix.json +1 -0
  102. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/fixtures/invalidJSON.json +5 -0
  103. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/tests.html +105 -0
  104. data/lib/wpa_cli_web/public/bower_components/reqwest/tests/tests.js +1723 -0
  105. data/lib/wpa_cli_web/views/access_points.erb +5 -0
  106. data/lib/wpa_cli_web/views/access_points_list.erb +19 -0
  107. data/lib/wpa_cli_web/views/layout.erb +141 -0
  108. data/lib/wpa_cli_web/views/networks_edit.erb +15 -0
  109. data/lib/wpa_cli_web/views/restart.erb +7 -0
  110. data/lib/wpa_cli_web/views/restarting.erb +14 -0
  111. data/wpa_cli_web.gemspec +1 -1
  112. metadata +111 -2
@@ -0,0 +1,1372 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" dir="ltr" id="html" class="unitTest" title=":root selector">
3
+ <head>
4
+ <!--
5
+ Test file passed on from @dperini
6
+ While strict compliance isn't the aim of Qwery, if compliance can be reached without bloat
7
+ then why not? @rvagg
8
+ -->
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <title>selectorTest</title>
11
+ <!-- (c) Disruptive Innovations 2008 -->
12
+ <style type="text/css">
13
+ /* TEST 0 : BASIC TESTS */
14
+ /* element type selector */
15
+ body { background-color: red; margin: 10px; padding: 10px; color: red; font-family: sans-serif }
16
+ div { background-color: red; color: red; }
17
+ div.header { background-color: #e0e0e0; color: black; padding: 10px; margin-bottom: 10px;}
18
+ /* class selector */
19
+ .unitTest { width: 10px; background-color: red; color: red; margin: 0px; margin-right: 2px; float: left; }
20
+ .test { margin-bottom: 2px; background-color: green; color: green; }
21
+ /* group of selectors */
22
+
23
+ .UI > * { float: left }
24
+ .UI { clear: both; height: auto; padding-top: 6px;}
25
+ .tilda { clear: both; height: auto; padding-top: 6px;}
26
+ .plus { clear: both; height: auto; padding-top: 6px;}
27
+
28
+ h1, p { width: 500px; color: #000; }
29
+ a { color: #000; }
30
+ #results { background: #FFF; width: 600px; padding: 10px 40px; color: #000; font-size: 11px; line-height: 1.3em; }
31
+ #root, #root2, #root3 { display: none; }
32
+
33
+ /* init */
34
+ .blox16 { background-color: red; }
35
+ .blox17 { background-color: red; }
36
+ .lastChild > p { background-color: red; }
37
+ .firstOfType > p { background-color: red }
38
+ .lastOfType > p { background-color: red }
39
+ .empty > .isEmpty { color: red; }
40
+ html { background-color: red; }
41
+
42
+ html.nopass .pass { display: none; }
43
+ </style>
44
+ <style type="text/test" id="test">
45
+ /* :target selector */
46
+ .target :target { background-color: lime; }
47
+
48
+ /* test 1 : childhood selector */
49
+ html > body { background-color: green; }
50
+ .test > .blox1 { background-color: lime; }
51
+
52
+ /* test 2 : attribute existence selector */
53
+ /* attribute with a value */
54
+ .blox2[align] { background-color: lime; }
55
+ /* attribute with empty value */
56
+ .blox3[align] { background-color: lime; }
57
+ /* attribute with almost similar name */
58
+ .blox4, .blox5 { background-color: lime }
59
+ .blox4[align], .blox5[align] { background-color: red; }
60
+
61
+ /* test3 : attribute value selector */
62
+ .blox6[align="center"] { background-color: lime; }
63
+ .blox6[align="c"] { background-color: red; }
64
+ .blox6[align="centera"] { background-color: red; }
65
+ .blox6[foo="\e9"] { background-color: lime; }
66
+ .blox6[\_foo="\e9"] { background-color: lime; }
67
+
68
+ /* test 4 : [~=] */
69
+ .blox7[class~="foo"] { background-color: lime; }
70
+ .blox8, .blox9, .blox10 { background-color: lime; }
71
+ .blox8[class~=""] { background-color: red; }
72
+ .blox9[foo~=""] { background-color: red; }
73
+ .blox10[foo~="foo"] { background-color: red; }
74
+
75
+ /* test5 [^=] */
76
+ .attrStart > .t3 { background-color: lime; }
77
+ .attrStart > .t1[class^="unit"] { background-color: lime; }
78
+ .attrStart > .t2 { background-color: lime; }
79
+ .attrStart > .t2[class^="nit"] { background-color: red; }
80
+ .attrStart > .t3[align^=""] { background-color: red; }
81
+ .attrStart > .t4[foo^="\e9"] { background-color: lime; }
82
+
83
+ /* test6 [$=] */
84
+ .attrEnd > .t3 { background-color: lime; }
85
+ .attrEnd > .t1[class$="t1"] { background-color: lime; }
86
+ .attrEnd > .t2 { background-color: lime; }
87
+ .attrEnd > .t2[class$="unit"] { background-color: red; }
88
+ .attrEnd > .t3[align$=""] { background-color: red; }
89
+ .attrEnd > .t4[foo$="\e9"] { background-color: lime; }
90
+
91
+ /* test7 [*=] */
92
+ .attrMiddle > .t3 { background-color: lime; }
93
+ .attrMiddle > .t1[class*="t t"] { background-color: lime; }
94
+ .attrMiddle > .t2 { background-color: lime; }
95
+ .attrMiddle > .t2[class*="a"] { background-color: red; }
96
+ .attrMiddle > .t3[align*=""] { background-color: red; }
97
+ .attrMiddle > .t4[foo*="\e9"] { background-color: lime; }
98
+
99
+ /* :first-child tests */
100
+ .firstChild .unitTest:first-child { background-color: lime; }
101
+ .blox12:first-child { background-color: red; }
102
+ .blox13:first-child { background-color: red; }
103
+ .blox12, .blox13 { background-color: lime }
104
+
105
+ /* :root tests */
106
+ :root { background-color: green; }
107
+
108
+ /* :nth-child(n) tests */
109
+ .nthchild1 > :nth-last-child(odd) { background-color: lime; }
110
+ .nthchild1 > :nth-child(odd) { background-color: lime; }
111
+
112
+ .nthchild2 > :nth-last-child(even) { background-color: lime; }
113
+ .nthchild2 > :nth-child(even) { background-color: lime; }
114
+
115
+ .nthchild3 > :nth-child(3n+2) { background-color: lime; }
116
+ .nthchild3 > :nth-last-child(3n+1) { background-color: lime; }
117
+ .nthchild3 > :nth-last-child(3n+3) { background-color: lime; }
118
+
119
+ .nthoftype1 > div:nth-of-type(odd) { background-color: lime; }
120
+ .nthoftype1 > div:nth-last-of-type(odd) { background-color: lime; }
121
+ .nthoftype1 > p { background-color: green; }
122
+
123
+ .nthoftype2 > div:nth-of-type(even) { background-color: lime; }
124
+ .nthoftype2 > div:nth-last-of-type(even) { background-color: lime; }
125
+ .nthoftype2 > p { background-color: green; }
126
+
127
+ .nthoftype3 > div:nth-of-type(3n+1) { background-color: lime; }
128
+ .nthoftype3 > div:nth-last-of-type(3n+1) { background-color: lime; }
129
+ .nthoftype3 > div:nth-last-of-type(3n+2) { background-color: lime; }
130
+ .nthoftype3 > p { background-color: green; }
131
+
132
+ /* :not() tests */
133
+ .blox14:not(span) { background-color: lime; }
134
+ .blox15:not([foo="blox14"]) { background-color: lime; }
135
+ .blox16:not(.blox15) { background-color: lime; }
136
+
137
+ /* :only-of-type tests */
138
+ .blox17:only-of-type { background-color: lime; }
139
+ .blox18:only-of-type { background-color: red; }
140
+ .blox18:not(:only-of-type) { background-color: lime; }
141
+
142
+ /* :last-child tests */
143
+ .lastChild > :last-child { background-color: lime }
144
+ .lastChild > :not(:last-child) { background-color: lime }
145
+
146
+ /* :first-of-type tests */
147
+ .firstOfType > *:first-of-type { background-color: lime; }
148
+ *.firstOfType > :not(:first-of-type) { background-color: lime; }
149
+
150
+ /* :last-of-type tests */
151
+ .lastOfType > *:last-of-type { background-color: lime; }
152
+ *.lastOfType > :not(:last-of-type) { background-color: lime; }
153
+
154
+ /* :only-child tests */
155
+ .onlyChild > *:not(:only-child) { background-color: lime; }
156
+ .onlyChild > .unitTest > *:only-child { background-color: lime; }
157
+
158
+ /* :only-of-type tests */
159
+ .onlyOfType *:only-of-type { background-color: lime; }
160
+ .onlyOfType *:not(:only-of-type) { background-color: lime; }
161
+
162
+ /* :empty tests */
163
+ .empty > *.isEmpty:empty { background-color: lime; color: lime; }
164
+ .empty > .isNotEmpty { background-color: blue; color: blue; }
165
+ .empty > .isNotEmpty:empty { background-color: red; color: red; }
166
+ .empty > .isNotEmpty:not(:empty) { background-color: lime; color: lime; }
167
+
168
+ /* :lang() tests */
169
+ .lang :lang(en) { background-color: lime; }
170
+ .lang :lang(fr) { background-color: lime; }
171
+ .lang .t1 { background-color: blue; }
172
+ .lang .t1:lang(es) { background-color: lime; }
173
+ .lang :lang(es-AR) { background-color: red; }
174
+
175
+ /* [|=] tests */
176
+ .attrLang .t1 { background-color: lime; }
177
+ .attrLang .t1[lang|="en"] { background-color: red; }
178
+ .attrLang [lang|="fr"] { background-color: lime; }
179
+ .attrLang .t2[lang|="en"] { background-color: lime; }
180
+ .attrLang .t3 { background-color: blue; }
181
+ .attrLang .t3[lang|="es"] { background-color: lime; }
182
+ .attrLang [lang|="es-AR"] { background-color: red; }
183
+
184
+ /* UI tests */
185
+ .UI .t1:enabled > .unitTest { background-color: lime; }
186
+ .UI .t2:disabled > .unitTest { background-color: lime; }
187
+ .UI .t3:checked + div { background-color: lime; }
188
+ .UI .t4:not(:checked) + div { background-color: lime; }
189
+
190
+ /* ~ combinator tests */
191
+ .tilda .t1 { background-color: white; }
192
+ .tilda .t1 ~ .unitTest { background-color: lime; }
193
+ .tilda .t1:hover ~ .unitTest { background-color: red; }
194
+
195
+ /* ~ combinator tests */
196
+ .plus .t1, .plus .t2 { background-color: white; }
197
+ .plus .t1 + .unitTest + .unitTest { background-color: lime; }
198
+ .plus .t1:hover + .unitTest + .unitTest { background-color: red; }
199
+ </style>
200
+ <style type="text/test" id="error">
201
+ .blox16:not(.blox15[foo="blox14"]) { background-color: red; }
202
+
203
+ /* Tests from http://www.w3.org/Style/CSS/Test/CSS3/Selectors/20060307/html/index.html */
204
+ div:not(:not(div)) { background: red; }
205
+
206
+ div, { background: red; }
207
+ .5cm { background: red; }
208
+ foo &amp; address, p { background: red; }
209
+ [*=test] { background: red; }
210
+ [*|*=test] { background: red; }
211
+
212
+ div:subject { background: red; }
213
+ :canvas { background: red; }
214
+ :viewport { background: red; }
215
+ :window { background: red; }
216
+ :menu { background: red; }
217
+ :table { background: red; }
218
+ :select { background: red; }
219
+ ::canvas { background: red; }
220
+ ::viewport { background: red; }
221
+ ::window { background: red; }
222
+ ::menu { background: red; }
223
+ ::table { background: red; }
224
+ ::select { background: red; }
225
+
226
+ ..test { background: red; color: yellow; }
227
+ .foo..quux { background: red; color: yellow; }
228
+ .bar. { background: red; color: yellow; }
229
+ </style>
230
+ <script>
231
+ //document.querySelector = document.querySelectorAll = null;
232
+ </script>
233
+ <script type="text/javascript" src="../src/qwery.js"></script>
234
+ <script type="text/javascript" src="../src/pseudos.js"></script>
235
+ <script>
236
+ window.onload = function(){
237
+
238
+ window.$ = qwery;
239
+ //$.configure({ NATIVE_QSA: false });
240
+ $.nonStandardEngine = true;
241
+
242
+ document.getElementById("toggle").onclick = function(){
243
+ document.documentElement.className = this.checked ? "unitTest nopass" : "unitTest";
244
+ };
245
+
246
+ if ( window.location.hash.indexOf("target") == -1 )
247
+ window.location.hash = "#target";
248
+
249
+ var root = document.getElementById("root");
250
+ var root2 = document.getElementById("root2");
251
+ var root3 = document.getElementById("root3");
252
+ var results = [];
253
+ var tests = 0, passed = 0;
254
+ var cache = {};
255
+
256
+ var cssElem = document.getElementById("test");
257
+ var css = (cssElem.innerHTML || cssElem.textContent || cssElem.innerText).split("\n");
258
+ for ( var i = 0; i < css.length; i++ ) {
259
+ css[i] = css[i].replace(/\/\*.*?\*\//g, "")
260
+ .replace(/^\s*|\s*$/g, "").split(/\s*{/);
261
+ }
262
+
263
+ var ecssElem = document.getElementById("error");
264
+ var ecss = (ecssElem.innerHTML || ecssElem.textContent || ecssElem.innerText).split("\n");
265
+ for ( var i = 0; i < ecss.length; i++ ) {
266
+ ecss[i] = ecss[i].replace(/\/\*.*?\*\//g, "")
267
+ .replace(/^\s*|\s*$/g, "").split(/\s*{/);
268
+ }
269
+
270
+ interfaceCheck(root, "Element");
271
+ runTest( css, "Element", root, true );
272
+ check( "Inside Element", root, true, false );
273
+ cacheCheck( "Element", root );
274
+ check( "Outside Element", root2, passed === 0 ? "autofail" : false, false );
275
+ runTest( ecss, "Syntax Error: Element", root, false );
276
+ jqTests("Element", root3, "querySelectorAll");
277
+
278
+ var root4 = root2.cloneNode(true);
279
+ interfaceCheck(root4, "Disconnected Element");
280
+ runTest( css, "Disconnected Element", root4, true );
281
+ check( "Disconnected Element", root4, true, true );
282
+ cacheCheck( "Disconnected Element", root4 );
283
+ runTest( ecss, "Syntax Error: Disconnected Element", root4, false );
284
+ jqTests("Disconnected Element", root3.cloneNode(true), "querySelectorAll");
285
+
286
+ var fragment = document.createDocumentFragment();
287
+ fragment.appendChild( root2.cloneNode(true) );
288
+
289
+ interfaceCheck(fragment, "Fragment");
290
+ runTest( css, "Fragment", fragment, true );
291
+ check( "Fragment", fragment, true, true );
292
+ runTest( ecss, "Syntax Error: Fragment", fragment, false );
293
+ cacheCheck( "Fragment", fragment );
294
+
295
+ root.parentNode.removeChild( root );
296
+
297
+ interfaceCheck(document, "Document");
298
+ runTest( css, "Document", document, true );
299
+ check( "Document", document, true, false );
300
+ runTest( ecss, "Syntax Error: Document", document, false );
301
+ jqTests("Document", document, "querySelectorAll");
302
+ cacheCheck( "Document", document );
303
+
304
+ done();
305
+
306
+ function interfaceCheck(obj, type){
307
+ var q = typeof obj.querySelector === "function" || typeof obj.querySelector === 'object';
308
+ assert( q, type + " supports querySelector" );
309
+ var qa = typeof obj.querySelectorAll === "function" || typeof obj.querySelectorAll === 'object';
310
+ assert( qa, type + " supports querySelectorAll" );
311
+ return q && qa;
312
+ }
313
+
314
+ function done(){
315
+ var r = document.getElementById("results");
316
+ var li = document.createElement("li");
317
+ var b = document.createElement("b");
318
+ b.appendChild( document.createTextNode( ((passed / tests) * 100).toFixed(1) + "%" ) );
319
+ li.appendChild( b );
320
+ li.appendChild( document.createTextNode( ": " + passed + " passed, " + (tests - passed) + " failed" ) );
321
+ r.appendChild( li );
322
+
323
+ for ( var i = 0; i < results.length; i++ ) {
324
+ var li = document.createElement("li");
325
+ li.className = (results[i][0] === "FAIL" ? "fail" : "pass");
326
+ var span = document.createElement("span");
327
+ span.style.color = (results[i][0] === "FAIL" ? "red" : "green");
328
+ span.appendChild( document.createTextNode( results[i][0] ) );
329
+ li.appendChild( span );
330
+ li.appendChild( document.createTextNode( " " + results[i][1] ) );
331
+ r.appendChild( li );
332
+ }
333
+ }
334
+
335
+ function cacheCheck( type, root ) {
336
+ try {
337
+ var pre = $( "div", root ), preLength = pre.length;
338
+
339
+ var div = document.createElement("div");
340
+ (root.body || root).appendChild( div );
341
+
342
+ var post = $( "div", root ), postLength = post.length;
343
+
344
+ assert( pre.length == preLength, type + ": StaticNodeList" );
345
+ assert( post.length != pre.length, type + ": StaticNodeList" );
346
+ } catch(e) {
347
+ assert( false, type + ": StaticNodeList" );
348
+ assert( false, type + ": StaticNodeList" );
349
+ }
350
+
351
+ if ( div )
352
+ (root.body || root).removeChild( div );
353
+ }
354
+
355
+
356
+ function runTest( css, type, root, expect ) {
357
+ var pass = false;
358
+ try {
359
+ $("", root);
360
+ } catch(e){ pass = typeof DOMException !== "undefined" && e.code == DOMException.SYNTAX_ERR || e.number == 12; }
361
+ assert( pass, type + ".querySelectorAll Empty String" );
362
+
363
+ pass = false;
364
+ try {
365
+ pass = $(null, root).length === 0;
366
+ } catch(e){ pass = false; }
367
+ assert( pass, type + ".querySelectorAll null" );
368
+
369
+ pass = false;
370
+ try {
371
+ pass = $(undefined, root).length === 0;
372
+ } catch(e){ pass = false; }
373
+ assert( pass, type + ".querySelectorAll undefined" );
374
+
375
+ pass = false;
376
+ try {
377
+ if ( $ )
378
+ $();
379
+ } catch(e){ pass = true; }
380
+ assert( pass, type + ".querySelectorAll no value" );
381
+
382
+ var pass = false;
383
+ try {
384
+ $("", root)[0];
385
+ } catch(e){ pass = typeof DOMException !== "undefined" && e.code == DOMException.SYNTAX_ERR || e.number == 12; }
386
+ assert( pass, type + ".querySelector Empty String" );
387
+
388
+ pass = false;
389
+ try {
390
+ pass = !$(null, root)[0];
391
+ } catch(e){ pass = false; }
392
+ assert( pass, type + ".querySelector null" );
393
+
394
+ pass = false;
395
+ try {
396
+ pass = !$(undefined, root)[0];
397
+ } catch(e){ pass = false; }
398
+ assert( pass, type + ".querySelector undefined" );
399
+
400
+ pass = false;
401
+ try {
402
+ if ( $ )
403
+ $()[0];
404
+ } catch(e){ pass = true; }
405
+ assert( pass, type + ".querySelector no value" );
406
+
407
+ for ( var i = 0; i < css.length; i++ ) {
408
+ var test = css[i];
409
+ if ( test.length == 2 ) {
410
+ var query = test[0], color = test[1].match(/: ([^\s;]+)/)[1];
411
+
412
+ try {
413
+ var found = $(query, root );
414
+
415
+ for ( var f = 0; f < found.length; f++ ) {
416
+ found[f].style.backgroundColor = color;
417
+ }
418
+
419
+ var pass = color != "red" || found.length === 0;
420
+
421
+ assert(expect && pass, type + ".querySelectorAll: " + query);
422
+ } catch(e){
423
+ var pass = !expect && typeof DOMException !== "undefined" && e.code == DOMException.SYNTAX_ERR || e.number == 12;
424
+ assert(pass, type + ".querySelectorAll: " + query);
425
+ }
426
+
427
+ if ( expect ) {
428
+ var pass = false;
429
+
430
+ try {
431
+ var found2 = $( " \t\r\n " + query + " \t\r\n ", root );
432
+ pass = found2.length == found.length;
433
+ } catch(e) {}
434
+
435
+ assert(pass, type + ".querySelectorAll Whitespace Trim: " + query);
436
+ }
437
+
438
+ try {
439
+ var single = $(query, root )[0];
440
+
441
+ var pass = found.length == 0 && single === null ||
442
+ found.length && found[0] == single;
443
+
444
+ assert(expect, type + ".querySelector: " + query);
445
+ } catch(e){
446
+ var pass = !expect && typeof DOMException !== "undefined" && e.code == DOMException.SYNTAX_ERR || e.number == 12;
447
+ assert(pass, type + ".querySelector: " + query);
448
+ }
449
+ }
450
+ }
451
+
452
+ }
453
+
454
+
455
+ function check( type, root, expect, fragment ){
456
+ traverse( root, function(div){
457
+ if ( (div.getAttribute("class") || "").toString().indexOf("unitTest") > -1 &&
458
+ (!fragment || div.getAttribute("id") !== "nofragment") ) {
459
+ var bg;
460
+
461
+ if ( document.defaultView ) {
462
+ var view = document.defaultView.getComputedStyle(div, null);
463
+ bg = view.getPropertyValue("background-color") || div.style.backgroundColor;
464
+ } else if ( div.currentStyle ) {
465
+ bg = div.currentStyle.backgroundColor || div.style.backgroundColor;
466
+ }
467
+
468
+ var pass = bg && bg.indexOf("(255, 0, 0") == -1 && bg.indexOf("#ff0000") == -1 && bg.indexOf("red") == -1;
469
+ assert(pass === expect, type + ": " + (div.title || div.parentNode.title));
470
+ }
471
+ });
472
+ }
473
+
474
+ function traverse( elem, fn ) {
475
+ if ( elem.nodeType === 1 ) {
476
+ fn( elem );
477
+
478
+ elem = elem.firstChild;
479
+ while ( elem ) {
480
+ traverse( elem, fn );
481
+ elem = elem.nextSibling;
482
+ }
483
+ }
484
+ }
485
+
486
+ function assert(pass, title) {
487
+ results.push([ (!pass ? "FAIL" : "PASS"), title ]);
488
+
489
+ tests++;
490
+ passed += (pass ? 1 : 0);
491
+ }
492
+
493
+ function jqTests(type, root, select) {
494
+
495
+ function query(q, resolver){
496
+ try {
497
+ return $(q, root);
498
+ } catch(e) {
499
+ if (typeof DOMException !== "undefined" && (e.code == DOMException.NAMESPACE_ERR || e.code == DOMException.SYNTAX_ERR) || e.number == 12)
500
+ throw e;
501
+ }
502
+ }
503
+
504
+ function t( name, q, ids, restrict, ids2 ) {
505
+ var pass = true;
506
+
507
+ if ( restrict === false && root != document )
508
+ return;
509
+
510
+ var prepend = "#root3 ";
511
+ q = (restrict === false || restrict === ":root" ? "" : prepend) + q.replace(/,/g, ", " + prepend);
512
+ var nq = q.replace(/>/g, "&gt;").replace(/</g, "&lt;");
513
+
514
+ var pass = false;
515
+
516
+ try {
517
+ var results = query(q);
518
+ pass = hasPassed( results, ids );
519
+ } catch(e) {
520
+ pass = typeof DOMException !== "undefined" && e.code == DOMException.SYNTAX_ERR || e.number == 12;
521
+ }
522
+
523
+ assert( pass, type + ": " + name + " (" + nq + ")" +
524
+ (pass ? "" : " Expected: " + extra(ids) + " Received: " + extra(results)) );
525
+
526
+ function hasPassed(results, ids){
527
+ var pass = (results && results.length == ids.length) || (!results && !ids);
528
+
529
+ if ( ids && results ) {
530
+ for ( var i = 0; ids && i < ids.length; i++ ) {
531
+ if ( ids[i] !== results[i].getAttribute("id") ) {
532
+ pass = false;
533
+ }
534
+ }
535
+ } else {
536
+ pass = false;
537
+ }
538
+
539
+ return pass;
540
+ }
541
+
542
+ function extra(results){
543
+ var extra = " [";
544
+ if ( results ) {
545
+ for ( var i = 0; i < results.length; i++ ) {
546
+ extra += (extra.length > 2 ? "," : "") + "'" + (results[i].id || results[i]) + "'";
547
+ }
548
+ }
549
+
550
+ extra += "]";
551
+ return extra;
552
+ }
553
+ }
554
+
555
+ var all = query("*");
556
+ assert( all && all.length > 30, type + ": Select all" );
557
+ var good = all && all.length;
558
+ for ( var i = 0; all && i < all.length; i++ )
559
+ if ( all[i].nodeType != 1 )
560
+ good = false;
561
+ assert( good, type + ": Select all elements, no comment nodes" );
562
+
563
+ if ( root == document ) {
564
+ t( ":root Selector", ":root", ["html"], false );
565
+ } else {
566
+ t( ":root Selector", ":root", [], ":root" );
567
+
568
+ if ( !root.parentNode ) {
569
+ t( ":root All Selector", ":root *", [], ":root" );
570
+ }
571
+ }
572
+
573
+ if ( root.parentNode || root == document ) {
574
+ var rootQuery = $(":root *", root);
575
+ assert( rootQuery && rootQuery.length == $("*", root).length - (root == document ? 1 : 0), type + ": :root All Selector" );
576
+ }
577
+
578
+ t( "Element Selector", "p", ["firstp","ap","sndp","en","sap","first"] );
579
+ t( "Element Selector", "body", ["body"], false );
580
+ t( "Element Selector", "html", ["html"], false );
581
+ t( "Parent Element", "div p", ["firstp","ap","sndp","en","sap","first"] );
582
+ var param = query("#object1 param");
583
+ assert( param && param.length == 2, type + ": Object/param as context" );
584
+
585
+ var l = query("#length");
586
+ assert( l && l.length, type + ': &lt;input name="length"&gt; cannot be found under IE' );
587
+ var lin = query("#lengthtest input");
588
+ assert( lin && lin.length, type + ': &lt;input name="length"&gt; cannot be found under IE' );
589
+
590
+ t( "Broken Selector", "[" );
591
+ t( "Broken Selector", "(" );
592
+ t( "Broken Selector", "{" );
593
+ t( "Broken Selector", "<" );
594
+ t( "Broken Selector", "()" );
595
+ t( "Broken Selector", "<>" );
596
+ t( "Broken Selector", "{}" );
597
+
598
+ t( "ID Selector", "#body", ["body"], false );
599
+ t( "ID Selector w/ Element", "body#body", ["body"], false );
600
+ t( "ID Selector w/ Element", "ul#first", [] );
601
+ t( "ID selector with existing ID descendant", "#firstp #simon1", ["simon1"] );
602
+ t( "ID selector with non-existant descendant", "#firstp #foobar", [] );
603
+
604
+ t( "ID selector using UTF8", "#台北Táiběi", ["台北Táiběi"] );
605
+ t( "Multiple ID selectors using UTF8", "#台北Táiběi, #台北", ["台北Táiběi","台北"] );
606
+ t( "Descendant ID selector using UTF8", "div #台北", ["台北"] );
607
+ t( "Child ID selector using UTF8", "form > #台北", ["台北"] );
608
+
609
+ t( "Escaped ID", "#foo\\:bar", ["foo:bar"] );
610
+ t( "Escaped ID", "#test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
611
+ t( "Descendant escaped ID", "div #foo\\:bar", ["foo:bar"] );
612
+ t( "Descendant escaped ID", "div #test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
613
+ t( "Child escaped ID", "form > #foo\\:bar", ["foo:bar"] );
614
+ t( "Child escaped ID", "form > #test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
615
+
616
+ t( "ID Selector, child ID present", "#form > #radio1", ["radio1"] ); // bug #267
617
+ t( "ID Selector, not an ancestor ID", "#form #first", [] );
618
+ t( "ID Selector, not a child ID", "#form > #option1a", [] );
619
+
620
+ t( "All Children of ID", "#foo > *", ["sndp", "en", "sap"] );
621
+ t( "All Children of ID with no children", "#firstUL > *", [] );
622
+
623
+ t( "ID selector with non-existant ancestor", "#asdfasdf #foobar", [] ); // bug #986
624
+
625
+ //t( "body div#form", [], "ID selector within the context of another element" );
626
+
627
+ t( "Class Selector", ".blog", ["mark","simon"] );
628
+ t( "Class Selector", ".blog.link", ["simon"] );
629
+ t( "Class Selector w/ Element", "a.blog", ["mark","simon"] );
630
+ t( "Parent Class Selector", "p .blog", ["mark","simon"] );
631
+
632
+ t( "Class selector using UTF8", ".台北Táiběi", ["utf8class1"] );
633
+ t( "Class selector using UTF8", ".台北", ["utf8class1","utf8class2"] );
634
+ t( "Class selector using UTF8", ".台北Táiběi.台北", ["utf8class1"] );
635
+ t( "Class selector using UTF8", ".台北Táiběi, .台北", ["utf8class1","utf8class2"] );
636
+ t( "Descendant class selector using UTF8", "div .台北Táiběi", ["utf8class1"] );
637
+ t( "Child class selector using UTF8", "form > .台北Táiběi", ["utf8class1"] );
638
+
639
+ t( "Escaped Class", ".foo\\:bar", ["foo:bar"] );
640
+ t( "Escaped Class", ".test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
641
+ t( "Descendant escaped Class", "div .foo\\:bar", ["foo:bar"] );
642
+ t( "Descendant escaped Class", "div .test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
643
+ t( "Child escaped Class", "form > .foo\\:bar", ["foo:bar"] );
644
+ t( "Child escaped Class", "form > .test\\.foo\\[5\\]bar", ["test.foo[5]bar"] );
645
+
646
+ t( "Comma Support", "a.blog, p", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
647
+ t( "Comma Support", "a.blog , p", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
648
+ t( "Comma Support", "a.blog ,p", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
649
+ t( "Comma Support", "a.blog,p", ['firstp','ap','mark','sndp','en','sap','simon','first'] );
650
+
651
+ t( "Child", "p > a", ["simon1","google","groups","mark","yahoo","simon"] );
652
+ t( "Child", "p> a", ["simon1","google","groups","mark","yahoo","simon"] );
653
+ t( "Child", "p >a", ["simon1","google","groups","mark","yahoo","simon"] );
654
+ t( "Child", "p>a", ["simon1","google","groups","mark","yahoo","simon"] );
655
+ t( "Child w/ Class", "p > a.blog", ["mark","simon"] );
656
+ t( "All Children", "code > *", ["anchor1","anchor2"] );
657
+ t( "All Grandchildren", "p > * > *", ["anchor1","anchor2"] );
658
+ t( "Adjacent", "a + a", ["groups"] );
659
+ t( "Adjacent", "a +a", ["groups"] );
660
+ t( "Adjacent", "a+ a", ["groups"] );
661
+ t( "Adjacent", "a+a", ["groups"] );
662
+ t( "Adjacent", "p + p", ["ap","en","sap"] );
663
+ t( "Comma, Child, and Adjacent", "a + a, code > a", ["groups","anchor1","anchor2"] );
664
+
665
+ t( "First Child", "p:first-child", ["firstp","sndp"] );
666
+ t( "Nth Child", "p:nth-child(1)", ["firstp","sndp"] );
667
+
668
+ t( "Last Child", "p:last-child", ["sap"] );
669
+ t( "Last Child", "a:last-child", ["simon1","anchor1","mark","yahoo","anchor2","simon"] );
670
+
671
+ t( "Nth-child", "#main form#form > *:nth-child(2)", ["text2"] );
672
+ t( "Nth-child", "#main form#form > :nth-child(2)", ["text2"] );
673
+
674
+ t( "Nth-child", "#form #select1 option:nth-child(3)", ["option1c"] );
675
+ t( "Nth-child", "#form #select1 option:nth-child(0n+3)", ["option1c"] );
676
+ t( "Nth-child", "#form #select1 option:nth-child(1n+0)", ["option1a", "option1b", "option1c", "option1d"] );
677
+ t( "Nth-child", "#form #select1 option:nth-child(1n)", ["option1a", "option1b", "option1c", "option1d"] );
678
+ t( "Nth-child", "#form #select1 option:nth-child(n)", ["option1a", "option1b", "option1c", "option1d"] );
679
+ t( "Nth-child", "#form #select1 option:nth-child(even)", ["option1b", "option1d"] );
680
+ t( "Nth-child", "#form #select1 option:nth-child(odd)", ["option1a", "option1c"] );
681
+ t( "Nth-child", "#form #select1 option:nth-child(2n)", ["option1b", "option1d"] );
682
+ t( "Nth-child", "#form #select1 option:nth-child(2n+1)", ["option1a", "option1c"] );
683
+ t( "Nth-child", "#form #select1 option:nth-child(3n)", ["option1c"] );
684
+ t( "Nth-child", "#form #select1 option:nth-child(3n+1)", ["option1a", "option1d"] );
685
+ t( "Nth-child", "#form #select1 option:nth-child(3n+2)", ["option1b"] );
686
+ t( "Nth-child", "#form #select1 option:nth-child(3n+3)", ["option1c"] );
687
+ t( "Nth-child", "#form #select1 option:nth-child(3n-1)", ["option1b"] );
688
+ t( "Nth-child", "#form #select1 option:nth-child(3n-2)", ["option1a", "option1d"] );
689
+ t( "Nth-child", "#form #select1 option:nth-child(3n-3)", ["option1c"] );
690
+ t( "Nth-child", "#form #select1 option:nth-child(3n+0)", ["option1c"] );
691
+ t( "Nth-child", "#form #select1 option:nth-child(-n+3)", ["option1a", "option1b", "option1c"] );
692
+
693
+ t( "Attribute Exists", "a[title]", ["google"] );
694
+ t( "Attribute Exists", "*[title]", ["google"] );
695
+ t( "Attribute Exists", "[title]", ["google"] );
696
+
697
+ t( "Attribute Equals", "a[rel='bookmark']", ["simon1"] );
698
+ t( "Attribute Equals", 'a[rel="bookmark"]', ["simon1"] );
699
+ t( "Attribute Equals", "a[rel=bookmark]", ["simon1"] );
700
+ t( "Multiple Attribute Equals", "#form input[type='hidden'],#form input[type='radio']", ['radio1','radio2','hidden1'] );
701
+ t( "Multiple Attribute Equals", "#form input[type=\"hidden\"],#form input[type='radio']", ['radio1','radio2','hidden1'] );
702
+ t( "Multiple Attribute Equals", "#form input[type=hidden],#form input[type=radio]", ['radio1','radio2','hidden1'] );
703
+
704
+ t( "Attribute selector using UTF8", "span[lang=中文]", ["台北"] );
705
+
706
+ t( "Attribute Begins With", "a[href ^= 'http://www']", ["google","yahoo"] );
707
+ t( "Attribute Ends With", "a[href $= 'org/']", ["mark"] );
708
+ t( "Attribute Contains", "a[href *= 'google']", ["google","groups"] );
709
+
710
+ // t("Select options via [selected]", "#select1 option[selected]", ["option1a"] );
711
+ t("Select options via [selected]", "#select1 option[selected]", [] );
712
+ t("Select options via [selected]", "#select2 option[selected]", ["option2d"] );
713
+ t("Select options via [selected]", "#select3 option[selected]", ["option3b", "option3c"] );
714
+
715
+ t( "Grouped Form Elements", "input[name='foo[bar]']", ["hidden2"] );
716
+
717
+ t( ":not() Existing attribute", "#form select:not([multiple])", ["select1", "select2"]);
718
+ t( ":not() Equals attribute", "#form select:not([name=select1])", ["select2", "select3"]);
719
+ t( ":not() Equals quoted attribute", "#form select:not([name='select1'])", ["select2", "select3"]);
720
+
721
+ t( "First Child", "p:first-child", ["firstp","sndp"] );
722
+ t( "Last Child", "p:last-child", ["sap"] );
723
+ t( "Only Child", "a:only-child", ["simon1","anchor1","yahoo","anchor2"] );
724
+ t( "Empty", "ul:empty", ["firstUL"] );
725
+ //t( "Enabled UI Element", "#form input:enabled", ["text1","radio1","radio2","check1","check2","hidden2","name"] );
726
+ t( "Disabled UI Element", "#form input:disabled", ["text2"] );
727
+ t( "Checked UI Element", "#form input:checked", ["radio2","check1"] );
728
+ t( "Element Preceded By", "p ~ div", ["foo","fx-queue","fx-tests", "moretests"] );
729
+ t( "Not", "a.blog:not(.link)", ["mark"] );
730
+ }
731
+ };
732
+ </script>
733
+ </head>
734
+ <body id="body" class="unitTest" title="childhood and element type selectors">
735
+ <h1><a href="http://www.w3.org/TR/selectors-api/">Selectors API</a> Test Suite</h1>
736
+ <p>Testrunner by <a href="http://ejohn.org/">John Resig</a>, tests by <a href="http://ejohn.org/">John Resig</a>, <a href="http://disruptive-innovations.com/zoo/css3tests/selectorTest.html">Disruptive Innovations</a>, <a href="http://www.w3.org/Style/CSS/Test/CSS3/Selectors/20060307/html/index.html">W3C CSS Working Group</a>, <a href="http://jquery.com/test/">jQuery JavaScript Library</a>.</p>
737
+ <p><label><input type="checkbox" id="toggle"/> Show only failing tests.</label></p>
738
+ <div id="root">
739
+ <div class="header">
740
+ <h3>CSS 3 Selectors tests</h3>
741
+ <p>(c) <a href="http://www.disruptive-innovations.com">Disruptive Innovations</a> 2008<br/>
742
+ Last update: 2008-06-06</p>
743
+ </div>
744
+
745
+ <div class="test target">
746
+ <div class="unitTest" id="target" title=":target selector"></div>
747
+ </div>
748
+
749
+ <div class="test">
750
+ <div class="blox1 unitTest" title="childhood selector"></div>
751
+ </div>
752
+
753
+ <div class="test attributeExistence">
754
+ <div class="blox2 unitTest" align="center" title="attribute existence selector"></div>
755
+ <div class="blox3 unitTest" align="" title="attribute existence selector with empty string value"></div>
756
+ <div class="blox4 unitTest" valign="center" title="attribute existence selector with almost identical attribute"></div>
757
+ <div class="blox5 unitTest" alignv="center" title="attribute existence selector with almost identical attribute"></div>
758
+ </div>
759
+
760
+ <div class="test attributeValue">
761
+ <div class="blox6 unitTest" align="center" title="attribute value selector"></div>
762
+ <div class="blox6 unitTest" foo="&eacute;" title="attribute value selector with an entity in the attribute and an escaped value in the selector"></div>
763
+ <div class="blox6 unitTest" _foo="&eacute;" title="attribute value selector with an entity in the attribute, an escaped value in the selector, and a leading underscore in the attribute name"></div>
764
+ </div>
765
+
766
+ <div class="test attributeSpaceSeparatedValues">
767
+ <div class="blox7 foo unitTest" title="[~=] attribute selector"></div>
768
+ <div class="blox8 unitTest" title="[~=] attribute selector looking for empty string"></div>
769
+ <div class="blox9 unitTest" foo="" title="[~=] attribute selector looking for empty string in empty attribute"></div>
770
+ <div class="blox10 unitTest" foo="foobar" title="[~=] attribute selector looking for 'foo' in 'foobar'"></div>
771
+ </div>
772
+
773
+ <div class="test attrStart">
774
+ <div class="unitTest t1" title="[^=] attribute selector"></div>
775
+ <div class="unitTest t2" title="[^=] attribute selector"></div>
776
+ <div class="unitTest t3" align="center" title="[^=] attribute selector looking for empty string"></div>
777
+ <div class="unitTest t4" foo="&eacute;tagada" title="[^=] attribute selector looking for &eacute;"></div>
778
+ </div>
779
+
780
+ <div class="test attrEnd">
781
+ <div class="unitTest t1" title="[$=] attribute selector"></div>
782
+ <div class="unitTest t2" title="[$=] attribute selector"></div>
783
+ <div class="unitTest t3" align="center" title="[$=] attribute selector looking for empty string"></div>
784
+ <div class="unitTest t4" foo="tagada&eacute;" title="[$=] attribute selector looking for &eacute;"></div>
785
+ </div>
786
+
787
+ <div class="test attrMiddle">
788
+ <div class="unitTest t1" title="[*=] attribute selector"></div>
789
+ <div class="unitTest t2" title="[*=] attribute selector"></div>
790
+ <div class="unitTest t3" align="center" title="[*=] attribute selector looking for empty string"></div>
791
+ <div class="unitTest t4" foo="tagada&eacute;foo" title="[*=] attribute selector looking for &eacute;"></div>
792
+ </div>
793
+
794
+ <div class="test firstChild">
795
+ <div class="unitTest" title=":first-child selector"></div>
796
+ <div class="blox12 unitTest" title=":first-child selector should not match non first child"></div>
797
+ <div class="blox13 unitTest" title=":first-child selector should not match non first child"></div>
798
+ </div>
799
+
800
+ <div class="test not">
801
+ <div class="blox14 unitTest" title="negation pseudo-class with argument being an element type selector"></div>
802
+ <div class="blox15 unitTest" foo="blox15" title="negation pseudo-class with argument being an attribute selector"></div>
803
+ <div class="blox16 unitTest" foo="blox15" title="negation pseudo-class accepts only simple selectors for argument"></div>
804
+ </div>
805
+
806
+ <div class="test onlyOfType">
807
+ <div class="blox17 unitTest" title=":only-of-type selector"></div>
808
+ <p class="blox18 unitTest" title="negated :only-of-type selector"></p>
809
+ <p class="blox18 unitTest" title="negated :only-of-type selector"></p>
810
+ </div>
811
+
812
+ <div class="test nthchild1">
813
+ <div class="unitTest" title=":nth-child(odd) selector"></div>
814
+ <div class="unitTest" title=":nth-last-child(odd) selector"></div>
815
+ <div class="unitTest" title=":nth-child(odd) selector"></div>
816
+ <div class="unitTest" title=":nth-last-child(odd) selector"></div>
817
+ <div class="unitTest" title=":nth-child(odd) selector"></div>
818
+ <div class="unitTest" title=":nth-last-child(odd) selector"></div>
819
+ </div>
820
+ <div class="test nthchild2">
821
+ <div class="unitTest" title=":nth-last-child(even) selector"></div>
822
+ <div class="unitTest" title=":nth-child(even) selector"></div>
823
+ <div class="unitTest" title=":nth-last-child(even) selector"></div>
824
+ <div class="unitTest" title=":nth-child(even) selector"></div>
825
+ <div class="unitTest" title=":nth-last-child(even) selector"></div>
826
+ <div class="unitTest" title=":nth-child(even) selector"></div>
827
+ </div>
828
+ <div class="test nthchild3">
829
+ <div class="unitTest no" title=":nth-last-child(3n+3) selector"></div>
830
+ <div class="unitTest" title=":nth-child(3n+2) selector"></div>
831
+ <div class="unitTest no" title=":nth-last-child(3n+1) selector"></div>
832
+ <div class="unitTest no" title=":nth-last-child(3n+3) selector"></div>
833
+ <div class="unitTest" title=":nth-child(3n+2) selector"></div>
834
+ <div class="unitTest no" title=":nth-last-child(3n+1) selector"></div>
835
+ </div>
836
+
837
+ <div class="test nthoftype1">
838
+ <div class="unitTest" title=":nth-of-type(odd) selector"></div>
839
+ <p class="unitTest" title=":nth-* selector"></p>
840
+ <p class="unitTest" title=":nth-* selector"></p>
841
+ <div class="unitTest" title=":nth-last-of-type(odd) selector"></div>
842
+ <p class="unitTest" title=":nth-* selector"></p>
843
+ <div class="unitTest" title=":nth-of-type(odd) selector"></div>
844
+ <div class="unitTest" title=":nth-last-of-type(odd) selector"></div>
845
+ </div>
846
+ <div class="test nthoftype2">
847
+ <div class="unitTest" title=":nth-last-of-type(even) selector"></div>
848
+ <p class="unitTest" title=":nth-* selector"></p>
849
+ <p class="unitTest" title=":nth-* selector"></p>
850
+ <div class="unitTest" title=":nth-of-type(even) selector"></div>
851
+ <p class="unitTest" title=":nth-* selector"></p>
852
+ <div class="unitTest" title=":nth-last-of-type(even) selector"></div>
853
+ <div class="unitTest" title=":nth-of-type(even) selector"></div>
854
+ </div>
855
+ <div class="test nthoftype3">
856
+ <div class="unitTest" title=":nth-of-type(3n+1) selector"></div>
857
+ <p class="unitTest" title=":nth-* selector"></p>
858
+ <p class="unitTest" title=":nth-* selector"></p>
859
+ <div class="unitTest" title=":nth-last-of-type(3n+2) selector"></div>
860
+ <p class="unitTest" title=":nth-* selector"></p>
861
+ <div class="unitTest" title=":nth-last-of-type(3n+1) selector"></div>
862
+ <div class="unitTest" title=":nth-of-type(3n+1) selector"></div>
863
+ <p class="unitTest" title=":nth-* selector"></p>
864
+ <div class="unitTest" title=":nth-last-of-type(3n+2) selector"></div>
865
+ <div class="unitTest" title=":nth-last-of-type(3n+1) selector"></div>
866
+ </div>
867
+
868
+ <div class="test lastChild">
869
+ <p class="unitTest" title=":not(:last-child) selector"></p>
870
+ <div class="unitTest" title=":last-child selector"></div>&nbsp;
871
+ </div>
872
+
873
+ <div class="test firstOfType">
874
+ <p class="unitTest" title=":first-of-type selector"></p>
875
+ <div class="unitTest" title=":first-of-type selector"></div>
876
+ <p class="unitTest" title=":not(:first-of-type)"></p>
877
+ <div class="unitTest" title=":not(:first-of-type)"></div>
878
+ </div>
879
+
880
+ <div class="test lastOfType">
881
+ <p class="unitTest" title=":not(:last-of-type)"></p>
882
+ <div class="unitTest" title=":not(:last-of-type)"></div>
883
+ <p class="unitTest" title=":last-of-type selector"></p>
884
+ <div class="unitTest" title=":last-of-type selector"></div>
885
+ </div>
886
+
887
+ <div class="test onlyChild">
888
+ <div class="unitTest" title=":only-child where the element is NOT the only child"></div>
889
+ <div class="unitTest" title=":only-child where the element is the only child">
890
+ <div class="unitTest" title=":only-child where the element is the only child"></div>
891
+ </div>
892
+ </div>
893
+
894
+ <div class="test onlyOfType">
895
+ <p class="unitTest" title=":only-of-type"></p>
896
+ <div class="unitTest" title=":only-of-type">
897
+ <div class="unitTest" title=":only-of-type"></div>
898
+ </div>
899
+ <div class="unitTest" title=":not(only-of-type)"></div>
900
+ </div>
901
+
902
+ <div class="test empty">
903
+ <div class="unitTest isEmpty" title=":empty with empty element"></div>
904
+ <div class="unitTest isNotEmpty" title=":empty but element contains a whitespace"> </div>
905
+ <div class="unitTest isEmpty" title=":empty and element contains an SGML comment"><!-- foo --></div>
906
+ <div class="unitTest isNotEmpty" title=":empty but element contains a SPAN element"><span></span></div>
907
+ <div class="unitTest isNotEmpty" title=":empty but element contains an entity reference">&nbsp;</div>
908
+ </div>
909
+
910
+ <div class="test lang">
911
+ <div id="nofragment" class="unitTest" title=":lang() where language comes from the document"></div>
912
+ <div class="unitTest" lang="fr" title=":lang() where language comes from the element"></div>
913
+ <div class="unitTest" lang="en-US" title=":lang() where language comes from the element but is a dialect of the language queried"></div>
914
+ <div class="unitTest t1" lang="es" title=":lang() where language comes from the element but the language queried is a dialect of the element's one so it should not match"></div>
915
+ </div>
916
+
917
+ <div class="test attrLang">
918
+ <div class="unitTest t1" title="[|=] where language comes from the document"></div>
919
+ <div class="unitTest" lang="fr" title="[|=] where language comes from the element"></div>
920
+ <div class="unitTest t2" lang="en-US" title="[|=] where language comes from the element but is a dialect of the language queried"></div>
921
+ <div class="unitTest t3" lang="es" title="[|=] where language comes from the element but the language queried is a dialect of the element's one so it should not match"></div>
922
+ </div>
923
+
924
+ <div class="test UI">
925
+ <button name="submit" type="submit" value="submit" class="t1" title=":enabled pseudo-class"><div class="unitTest"></div></button>
926
+ <button name="submit" type="submit" value="submit" class="t2" disabled="true" title=":enabled pseudo-class"><div class="unitTest"></div></button>
927
+ </div>
928
+ <div class="test UI">
929
+ <input class="t3" type="checkbox" checked="true"/><div class="unitTest" title=":checked"></div>
930
+ the previous square should be green when the checkbox is checked and become red when you uncheck it
931
+ </div>
932
+ <div class="test UI">
933
+ <input class="t4" type="checkbox"/><div class="unitTest" title=":not(:checked)"></div>
934
+ the previous square should be green when the checkbox is NOT checked and become red when you check it
935
+ </div>
936
+
937
+ <div class="test tilda">
938
+ <div class="unitTest t1" title="~ combinator"></div>
939
+ <div class="unitTest" title="~ combinator"></div>
940
+ <div class="unitTest" title="~ combinator"></div>
941
+ <div class="unitTest" title="~ combinator"></div>
942
+ <span style="float:left">the three last squares should be green and become red when the pointer hovers over the white square</span>
943
+ </div>
944
+ <div class="test plus">
945
+ <div class="unitTest t1" title="+ combinator"></div>
946
+ <div class="unitTest t2" title="+ combinator"></div>
947
+ <div class="unitTest" title="+ combinator"></div>
948
+ <span style="float:left">the last square should be green and become red when the pointer hovers over the FIRST white square</span>
949
+ </div>
950
+ </div>
951
+ <div id="root2">
952
+ <div class="header">
953
+ <h3>CSS 3 Selectors tests</h3>
954
+ <p>(c) <a href="http://www.disruptive-innovations.com">Disruptive Innovations</a> 2008<br/>
955
+ Last update: 2008-06-06</p>
956
+ </div>
957
+
958
+ <div class="test">
959
+ <div class="blox1 unitTest" title="childhood selector"></div>
960
+ </div>
961
+
962
+ <div class="test attributeExistence">
963
+ <div class="blox2 unitTest" align="center" title="attribute existence selector"></div>
964
+ <div class="blox3 unitTest" align="" title="attribute existence selector with empty string value"></div>
965
+ <div class="blox4 unitTest" valign="center" title="attribute existence selector with almost identical attribute"></div>
966
+ <div class="blox5 unitTest" alignv="center" title="attribute existence selector with almost identical attribute"></div>
967
+ </div>
968
+
969
+ <div class="test attributeValue">
970
+ <div class="blox6 unitTest" align="center" title="attribute value selector"></div>
971
+ <div class="blox6 unitTest" foo="&eacute;" title="attribute value selector with an entity in the attribute and an escaped value in the selector"></div>
972
+ <div class="blox6 unitTest" _foo="&eacute;" title="attribute value selector with an entity in the attribute, an escaped value in the selector, and a leading underscore in the attribute name"></div>
973
+ </div>
974
+
975
+ <div class="test attributeSpaceSeparatedValues">
976
+ <div class="blox7 foo unitTest" title="[~=] attribute selector"></div>
977
+ <div class="blox8 unitTest" title="[~=] attribute selector looking for empty string"></div>
978
+ <div class="blox9 unitTest" foo="" title="[~=] attribute selector looking for empty string in empty attribute"></div>
979
+ <div class="blox10 unitTest" foo="foobar" title="[~=] attribute selector looking for 'foo' in 'foobar'"></div>
980
+ </div>
981
+
982
+ <div class="test attrStart">
983
+ <div class="unitTest t1" title="[^=] attribute selector"></div>
984
+ <div class="unitTest t2" title="[^=] attribute selector"></div>
985
+ <div class="unitTest t3" align="center" title="[^=] attribute selector looking for empty string"></div>
986
+ <div class="unitTest t4" foo="&eacute;tagada" title="[^=] attribute selector looking for &eacute;"></div>
987
+ </div>
988
+
989
+ <div class="test attrEnd">
990
+ <div class="unitTest t1" title="[$=] attribute selector"></div>
991
+ <div class="unitTest t2" title="[$=] attribute selector"></div>
992
+ <div class="unitTest t3" align="center" title="[$=] attribute selector looking for empty string"></div>
993
+ <div class="unitTest t4" foo="tagada&eacute;" title="[$=] attribute selector looking for &eacute;"></div>
994
+ </div>
995
+
996
+ <div class="test attrMiddle">
997
+ <div class="unitTest t1" title="[*=] attribute selector"></div>
998
+ <div class="unitTest t2" title="[*=] attribute selector"></div>
999
+ <div class="unitTest t3" align="center" title="[*=] attribute selector looking for empty string"></div>
1000
+ <div class="unitTest t4" foo="tagada&eacute;foo" title="[*=] attribute selector looking for &eacute;"></div>
1001
+ </div>
1002
+
1003
+ <div class="test firstChild">
1004
+ <div class="unitTest" title=":first-child selector"></div>
1005
+ <div class="blox12 unitTest" title=":first-child selector should not match non first child"></div>
1006
+ <div class="blox13 unitTest" title=":first-child selector should not match non first child"></div>
1007
+ </div>
1008
+
1009
+ <div class="test not">
1010
+ <div class="blox14 unitTest" title="negation pseudo-class with argument being an element type selector"></div>
1011
+ <div class="blox15 unitTest" foo="blox15" title="negation pseudo-class with argument being an attribute selector"></div>
1012
+ <div class="blox16 unitTest" foo="blox15" title="negation pseudo-class accepts only simple selectors for argument"></div>
1013
+ </div>
1014
+
1015
+ <div class="test onlyOfType">
1016
+ <div class="blox17 unitTest" title=":only-of-type selector"></div>
1017
+ <p class="blox18 unitTest" title="negated :only-of-type selector"></p>
1018
+ <p class="blox18 unitTest" title="negated :only-of-type selector"></p>
1019
+ </div>
1020
+
1021
+ <div class="test nthchild1">
1022
+ <div class="unitTest" title=":nth-child(odd) selector"></div>
1023
+ <div class="unitTest" title=":nth-last-child(odd) selector"></div>
1024
+ <div class="unitTest" title=":nth-child(odd) selector"></div>
1025
+ <div class="unitTest" title=":nth-last-child(odd) selector"></div>
1026
+ <div class="unitTest" title=":nth-child(odd) selector"></div>
1027
+ <div class="unitTest" title=":nth-last-child(odd) selector"></div>
1028
+ </div>
1029
+ <div class="test nthchild2">
1030
+ <div class="unitTest" title=":nth-last-child(even) selector"></div>
1031
+ <div class="unitTest" title=":nth-child(even) selector"></div>
1032
+ <div class="unitTest" title=":nth-last-child(even) selector"></div>
1033
+ <div class="unitTest" title=":nth-child(even) selector"></div>
1034
+ <div class="unitTest" title=":nth-last-child(even) selector"></div>
1035
+ <div class="unitTest" title=":nth-child(even) selector"></div>
1036
+ </div>
1037
+ <div class="test nthchild3">
1038
+ <div class="unitTest no" title=":nth-last-child(3n+3) selector"></div>
1039
+ <div class="unitTest" title=":nth-child(3n+2) selector"></div>
1040
+ <div class="unitTest no" title=":nth-last-child(3n+1) selector"></div>
1041
+ <div class="unitTest no" title=":nth-last-child(3n+3) selector"></div>
1042
+ <div class="unitTest" title=":nth-child(3n+2) selector"></div>
1043
+ <div class="unitTest no" title=":nth-last-child(3n+1) selector"></div>
1044
+ </div>
1045
+
1046
+ <div class="test nthoftype1">
1047
+ <div class="unitTest" title=":nth-of-type(odd) selector"></div>
1048
+ <p class="unitTest" title=":nth-of-* selector"></p>
1049
+ <p class="unitTest" title=":nth-of-* selector"></p>
1050
+ <div class="unitTest" title=":nth-last-of-type(odd) selector"></div>
1051
+ <p class="unitTest" title=":nth-of-* selector"></p>
1052
+ <div class="unitTest" title=":nth-of-type(odd) selector"></div>
1053
+ <div class="unitTest" title=":nth-last-of-type(odd) selector"></div>
1054
+ </div>
1055
+ <div class="test nthoftype2">
1056
+ <div class="unitTest" title=":nth-last-of-type(even) selector"></div>
1057
+ <p class="unitTest" title=":nth-of-* selector"></p>
1058
+ <p class="unitTest" title=":nth-of-* selector"></p>
1059
+ <div class="unitTest" title=":nth-of-type(even) selector"></div>
1060
+ <p class="unitTest" title=":nth-of-* selector"></p>
1061
+ <div class="unitTest" title=":nth-last-of-type(even) selector"></div>
1062
+ <div class="unitTest" title=":nth-of-type(even) selector"></div>
1063
+ </div>
1064
+ <div class="test nthoftype3">
1065
+ <div class="unitTest" title=":nth-of-type(3n+1) selector"></div>
1066
+ <p class="unitTest" title=":nth-of-* selector"></p>
1067
+ <p class="unitTest" title=":nth-of-* selector"></p>
1068
+ <div class="unitTest" title=":nth-last-of-type(3n+2) selector"></div>
1069
+ <p class="unitTest" title=":nth-of-* selector"></p>
1070
+ <div class="unitTest" title=":nth-last-of-type(3n+1) selector"></div>
1071
+ <div class="unitTest" title=":nth-of-type(3n+1) selector"></div>
1072
+ <p class="unitTest" title=":nth-of-* selector"></p>
1073
+ <div class="unitTest" title=":nth-last-of-type(3n+2) selector"></div>
1074
+ <div class="unitTest" title=":nth-last-of-type(3n+1) selector"></div>
1075
+ </div>
1076
+
1077
+ <div class="test lastChild">
1078
+ <p class="unitTest" title=":not(:last-child) selector"></p>
1079
+ <div class="unitTest" title=":last-child selector"></div>&nbsp;
1080
+ </div>
1081
+
1082
+ <div class="test firstOfType">
1083
+ <p class="unitTest" title=":first-of-type selector"></p>
1084
+ <div class="unitTest" title=":first-of-type selector"></div>
1085
+ <p class="unitTest" title=":not(:first-of-type)"></p>
1086
+ <div class="unitTest" title=":not(:first-of-type)"></div>
1087
+ </div>
1088
+
1089
+ <div class="test lastOfType">
1090
+ <p class="unitTest" title=":not(:last-of-type)"></p>
1091
+ <div class="unitTest" title=":not(:last-of-type)"></div>
1092
+ <p class="unitTest" title=":last-of-type selector"></p>
1093
+ <div class="unitTest" title=":last-of-type selector"></div>
1094
+ </div>
1095
+
1096
+ <div class="test onlyChild">
1097
+ <div class="unitTest" title=":only-child where the element is NOT the only child"></div>
1098
+ <div class="unitTest" title=":only-child where the element is the only child">
1099
+ <div class="unitTest" title=":only-child where the element is the only child"></div>
1100
+ </div>
1101
+ </div>
1102
+
1103
+ <div class="test onlyOfType">
1104
+ <p class="unitTest" title=":only-of-type"></p>
1105
+ <div class="unitTest" title=":only-of-type">
1106
+ <div class="unitTest" title=":only-of-type"></div>
1107
+ </div>
1108
+ <div class="unitTest" title=":not(only-of-type)"></div>
1109
+ </div>
1110
+
1111
+ <div class="test empty">
1112
+ <div class="unitTest isEmpty" title=":empty with empty element"></div>
1113
+ <div class="unitTest isNotEmpty" title=":empty but element contains a whitespace"> </div>
1114
+ <div class="unitTest isEmpty" title=":empty and element contains an SGML comment"><!-- foo --></div>
1115
+ <div class="unitTest isNotEmpty" title=":empty but element contains a SPAN element"><span></span></div>
1116
+ <div class="unitTest isNotEmpty" title=":empty but element contains an entity reference">&nbsp;</div>
1117
+ </div>
1118
+
1119
+ <div class="test lang">
1120
+ <div id="nofragment" class="unitTest" title=":lang() where language comes from the document"></div>
1121
+ <div class="unitTest" lang="fr" title=":lang() where language comes from the element"></div>
1122
+ <div class="unitTest" lang="en-US" title=":lang() where language comes from the element but is a dialect of the language queried"></div>
1123
+ <div class="unitTest t1" lang="es" title=":lang() where language comes from the element but the language queried is a dialect of the element's one so it should not match"></div>
1124
+ </div>
1125
+
1126
+ <div class="test attrLang">
1127
+ <div class="unitTest t1" title="[|=] where language comes from the document"></div>
1128
+ <div class="unitTest" lang="fr" title="[|=] where language comes from the element"></div>
1129
+ <div class="unitTest t2" lang="en-US" title="[|=] where language comes from the element but is a dialect of the language queried"></div>
1130
+ <div class="unitTest t3" lang="es" title="[|=] where language comes from the element but the language queried is a dialect of the element's one so it should not match"></div>
1131
+ </div>
1132
+
1133
+ <div class="test UI">
1134
+ <button name="submit" type="submit" value="submit" class="t1" title=":enabled pseudo-class"><div class="unitTest"></div></button>
1135
+ <button name="submit" type="submit" value="submit" class="t2" disabled="true" title=":enabled pseudo-class"><div class="unitTest"></div></button>
1136
+ </div>
1137
+ <div class="test UI">
1138
+ <input class="t3" type="checkbox" checked="true"/><div class="unitTest" title=":checked"></div>
1139
+ the previous square should be green when the checkbox is checked and become red when you uncheck it
1140
+ </div>
1141
+ <div class="test UI">
1142
+ <input class="t4" type="checkbox"/><div class="unitTest" title=":not(:checked)"></div>
1143
+ the previous square should be green when the checkbox is NOT checked and become red when you check it
1144
+ </div>
1145
+
1146
+ <div class="test tilda">
1147
+ <div class="unitTest t1" title="~ combinator"></div>
1148
+ <div class="unitTest" title="~ combinator"></div>
1149
+ <div class="unitTest" title="~ combinator"></div>
1150
+ <div class="unitTest" title="~ combinator"></div>
1151
+ <span style="float:left">the three last squares should be green and become red when the pointer hovers over the white square</span>
1152
+ </div>
1153
+ <div class="test plus">
1154
+ <div class="unitTest t1" title="+ combinator"></div>
1155
+ <div class="unitTest t2" title="+ combinator"></div>
1156
+ <div class="unitTest" title="+ combinator"></div>
1157
+ <span style="float:left">the last square should be green and become red when the pointer hovers over the FIRST white square</span>
1158
+ </div>
1159
+ </div>
1160
+ <div id="root3">
1161
+ <div id="svgs">
1162
+ <!-- svg elements, but in the xhtml namespace -->
1163
+ <svg width="12cm" height="4cm" viewBox="0 0 1200 400" version="1.1" id="svg1">
1164
+ <desc id="desc1">Example circle01 - circle filled with red and stroked with blue</desc>
1165
+ <rect id="rect1" x="1" y="1" width="1198" height="398" fill="none" stroke="blue" stroke-width="2"/>
1166
+ <circle id="circle1" cx="600" cy="200" r="100" fill="red" stroke="blue" stroke-width="10" />
1167
+ </svg>
1168
+ <!-- svg elements using svg: -->
1169
+ <svg:svg width="12cm" height="4cm" viewBox="0 0 1200 400" version="1.1" id="svg2">
1170
+ <svg:desc id="desc2">Example circle01 - circle filled with red and stroked with blue</svg:desc>
1171
+ <svg:rect id="rect2" x="1" y="1" width="1198" height="398" fill="none" stroke="blue" stroke-width="2"/>
1172
+ <svg:circle id="circle2" cx="600" cy="200" r="100" fill="red" stroke="blue" stroke-width="10" />
1173
+ </svg:svg>
1174
+ <!-- svg using an inline xmlns -->
1175
+ <svg width="12cm" height="4cm" viewBox="0 0 1200 400" xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg3">
1176
+ <desc id="desc3">Example circle01 - circle filled with red and stroked with blue</desc>
1177
+ <rect id="rect3" x="1" y="1" width="1198" height="398" fill="none" stroke="blue" stroke-width="2"/>
1178
+ <circle id="circle3" cx="600" cy="200" r="100" fill="red" stroke="blue" stroke-width="10" />
1179
+ </svg>
1180
+ </div>
1181
+
1182
+ <h1 id="header">jQuery Test Suite</h1>
1183
+ <h2 id="banner"></h2>
1184
+ <h2 id="userAgent"></h2>
1185
+
1186
+ <!-- Test HTML -->
1187
+ <div id="nothiddendiv" style="height:1px;background:white;">
1188
+
1189
+ <div id="nothiddendivchild"></div>
1190
+ </div>
1191
+ <!-- this iframe is outside the #main so it won't reload constantly wasting time, but it means the tests must be "safe" and clean up after themselves -->
1192
+ <iframe id="loadediframe" name="loadediframe" style="display:none;"></iframe>
1193
+ <dl id="dl" style="display:none;">
1194
+ <div id="main" style="display: none;">
1195
+ <p id="firstp">See <a id="simon1" href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p>
1196
+
1197
+ <p id="ap">
1198
+ Here are some links in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>,
1199
+ <a id="groups" href="http://groups.google.com/">Google Groups</a>.
1200
+ This link has <code><a href="http://smin" id="anchor1">class="blog"</a></code>:
1201
+ <a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a>
1202
+
1203
+ </p>
1204
+ <div id="foo">
1205
+
1206
+ <p id="sndp">Everything inside the red border is inside a div with <code>id="foo"</code>.</p>
1207
+ <p lang="en" id="en">This is a normal link: <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p>
1208
+ <p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p>
1209
+
1210
+ </div>
1211
+
1212
+ <p id="first">Try them out:</p>
1213
+ <ul id="firstUL"></ul>
1214
+ <ol id="empty"></ol>
1215
+ <form id="form" action="formaction">
1216
+ <input type="text" name="action" value="Test" id="text1" maxlength="30"/>
1217
+ <input type="text" name="text2" value="Test" id="text2" disabled="disabled"/>
1218
+ <input type="radio" name="radio1" id="radio1" value="on"/>
1219
+
1220
+ <input type="radio" name="radio2" id="radio2" checked="checked"/>
1221
+
1222
+ <input type="checkbox" name="check" id="check1" checked="checked"/>
1223
+ <input type="checkbox" id="check2" value="on"/>
1224
+
1225
+ <input type="hidden" name="hidden" id="hidden1"/>
1226
+ <input type="text" style="display:none;" name="foo[bar]" id="hidden2"/>
1227
+
1228
+ <input type="text" id="name" name="name" value="name" />
1229
+
1230
+ <button id="button" name="button">Button</button>
1231
+
1232
+ <textarea id="area1" maxlength="30">foobar</textarea>
1233
+
1234
+
1235
+ <select name="select1" id="select1">
1236
+ <option id="option1a" class="emptyopt" value="">Nothing</option>
1237
+ <option id="option1b" value="1">1</option>
1238
+ <option id="option1c" value="2">2</option>
1239
+ <option id="option1d" value="3">3</option>
1240
+ </select>
1241
+ <select name="select2" id="select2">
1242
+
1243
+ <option id="option2a" class="emptyopt" value="">Nothing</option>
1244
+ <option id="option2b" value="1">1</option>
1245
+ <option id="option2c" value="2">2</option>
1246
+ <option id="option2d" selected="selected" value="3">3</option>
1247
+ </select>
1248
+ <select name="select3" id="select3" multiple="multiple">
1249
+ <option id="option3a" class="emptyopt" value="">Nothing</option>
1250
+
1251
+ <option id="option3b" selected="selected" value="1">1</option>
1252
+ <option id="option3c" selected="selected" value="2">2</option>
1253
+ <option id="option3d" value="3">3</option>
1254
+ </select>
1255
+
1256
+ <object id="object1" codebase="stupid">
1257
+ <param name="p1" value="x1" />
1258
+ <param name="p2" value="x2" />
1259
+
1260
+ </object>
1261
+
1262
+ <span id="台北Táiběi"></span>
1263
+ <span id="台北" lang="中文"></span>
1264
+ <span id="utf8class1" class="台北Táiběi 台北"></span>
1265
+ <span id="utf8class2" class="台北"></span>
1266
+ <span id="foo:bar" class="foo:bar"></span>
1267
+ <span id="test.foo[5]bar" class="test.foo[5]bar"></span>
1268
+
1269
+ <foo_bar id="foobar">test element</foo_bar>
1270
+
1271
+ </form>
1272
+ <b id="floatTest">Float test.</b>
1273
+ <iframe id="iframe" name="iframe"></iframe>
1274
+ <form id="lengthtest">
1275
+ <input type="text" id="length" name="test"/>
1276
+ <input type="text" id="idTest" name="id"/>
1277
+ </form>
1278
+ <table id="table"></table>
1279
+
1280
+
1281
+ <div id="fx-queue">
1282
+ <div id="fadein" class='chain test'>fadeIn<div>fadeIn</div></div>
1283
+ <div id="fadeout" class='chain test out'>fadeOut<div>fadeOut</div></div>
1284
+
1285
+ <div id="show" class='chain test'>show<div>show</div></div>
1286
+ <div id="hide" class='chain test out'>hide<div>hide</div></div>
1287
+
1288
+
1289
+ <div id="togglein" class='chain test'>togglein<div>togglein</div></div>
1290
+ <div id="toggleout" class='chain test out'>toggleout<div>toggleout</div></div>
1291
+
1292
+
1293
+ <div id="slideup" class='chain test'>slideUp<div>slideUp</div></div>
1294
+ <div id="slidedown" class='chain test out'>slideDown<div>slideDown</div></div>
1295
+
1296
+ <div id="slidetogglein" class='chain test'>slideToggleIn<div>slideToggleIn</div></div>
1297
+
1298
+ <div id="slidetoggleout" class='chain test out'>slideToggleOut<div>slideToggleOut</div></div>
1299
+ </div>
1300
+
1301
+ <div id="fx-tests"></div>
1302
+
1303
+ <form id="testForm" action="#" method="get">
1304
+ <textarea name="T3" rows="2" cols="15">?
1305
+ Z</textarea>
1306
+ <input type="hidden" name="H1" value="x" />
1307
+ <input type="hidden" name="H2" />
1308
+
1309
+ <input name="PWD" type="password" value="" />
1310
+ <input name="T1" type="text" />
1311
+ <input name="T2" type="text" value="YES" readonly="readonly" />
1312
+ <input type="checkbox" name="C1" value="1" />
1313
+ <input type="checkbox" name="C2" />
1314
+ <input type="radio" name="R1" value="1" />
1315
+ <input type="radio" name="R1" value="2" />
1316
+ <input type="text" name="My Name" value="me" />
1317
+ <input type="reset" name="reset" value="NO" />
1318
+
1319
+ <select name="S1">
1320
+ <option value="abc">ABC</option>
1321
+ <option value="abc">ABC</option>
1322
+ <option value="abc">ABC</option>
1323
+ </select>
1324
+ <select name="S2" multiple="multiple" size="3">
1325
+ <option value="abc">ABC</option>
1326
+
1327
+ <option value="abc">ABC</option>
1328
+ <option value="abc">ABC</option>
1329
+ </select>
1330
+ <select name="S3">
1331
+ <option selected="selected">YES</option>
1332
+ </select>
1333
+ <select name="S4">
1334
+
1335
+ <option value="" selected="selected">NO</option>
1336
+ </select>
1337
+ <input type="submit" name="sub1" value="NO" />
1338
+ <input type="submit" name="sub2" value="NO" />
1339
+ <input type="image" name="sub3" value="NO" />
1340
+ <button name="sub4" type="submit" value="NO">NO</button>
1341
+ <input name="D1" type="text" value="NO" disabled="disabled" />
1342
+ <input type="checkbox" checked="checked" disabled="disabled" name="D2" value="NO" />
1343
+
1344
+ <input type="radio" name="D3" value="NO" checked="checked" disabled="disabled" />
1345
+ <select name="D4" disabled="disabled">
1346
+ <option selected="selected" value="NO">NO</option>
1347
+ </select>
1348
+ </form>
1349
+ <div id="moretests">
1350
+ <form>
1351
+ <div id="checkedtest" style="display:none;">
1352
+
1353
+ <input type="radio" name="checkedtestradios" checked="checked"/>
1354
+ <input type="radio" name="checkedtestradios" value="on"/>
1355
+ <input type="checkbox" name="checkedtestcheckboxes" checked="checked"/>
1356
+ <input type="checkbox" name="checkedtestcheckboxes" />
1357
+ </div>
1358
+ </form>
1359
+ <div id="nonnodes"><span>hi</span> there <!-- mon ami --></div>
1360
+
1361
+ <div id="t2037">
1362
+ <div><div class="hidden">hidden</div></div>
1363
+ </div>
1364
+ </div>
1365
+ </div>
1366
+ </dl>
1367
+
1368
+ <ol id="tests"></ol>
1369
+ </div>
1370
+ <ol id="results"></ol>
1371
+ </body>
1372
+ </html>