1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style>
#t1 { border-top-width: 1 }
#t2 { border-right-width: 1 }
#t3 { border-bottom-width: 1 }
#t4 { border-left-width: 1 }
#t5 { border-width: 1 }
#t6 { bottom: 1 }
#t7 { clip: rect(1 1 1 1) }
#t8 { font-size: 1 }
#t9 { height: 1 }
#t10 { left: 1 }
#t11 { letter-spacing: 1 }
#t12 { margin-right: 1 }
#t13 { margin-left: 1 }
#t14 { margin-top: 1 }
#t15 { margin-bottom: 1 }
#t16 { margin: 1 }
#t17 { padding-right: 1 }
#t18 { padding-left: 1 }
#t19 { padding-top: 1 }
#t20 { padding-bottom: 1 }
#t21 { padding: 1 }
#t22 { right: 1 }
#t23 { top: 1 }
#t24 { width: 1 }
#t25 { word-spacing: 1 }
#t26 { border-top: 1 }
#t27 { border-right: 1 }
#t28 { border-bottom: 1 }
#t29 { border-left: 1 }
#t30 { border-spacing: 10 }
#t31 { border-spacing: 10 20 }
#t32 { border-top: 10 double #ff0000 }
#t33 { border-top: 10px double ff0000 }
#t34 { border-top: 10px double #ff0000 }
#t35 { border-top: 10 double ff0000 }
#t36 { border: 10 solid #ff0000 }
#t37 { border: 10px solid ff0000 }
#t38 { border: 10px solid #ff0000 }
#t39 { border: 10 solid ff0000 }
#t40 { font: 10 }
#t41 { font: 10 / 20 }
#t42 { background-position: 10 }
#t43 { background-position: 10 20 }
#t44 { background: #ff0000 10 }
#t45 { background: ff0000 10px }
#t46 { background: #ff0000 10px }
#t47 { background: ff0000 10 }
#t48 { text-indent: 10 }
#t49 { outline-width: 10 }
#t50 { min-width: 10 }
#t51 { min-height: 10 }
#t52 { max-width: 10 }
#t53 { max-height: 10 }
</style>
<script>
var sheet = document.styleSheets[0];
test(function(){ assert_true(!!sheet); }, "StyleSheet present");
test(function(){ assert_equals(sheet.cssRules.length, 53); }, "All rules parsed");
test(function(){
assert_equals(sheet.cssRules[0].style.borderTopWidth, "1px");
}, "Unitless length quirk for border-top-width property");
test(function(){
assert_equals(sheet.cssRules[1].style.borderRightWidth, "1px");
}, "Unitless length quirk for border-right-width property");
test(function(){
assert_equals(sheet.cssRules[2].style.borderBottomWidth, "1px");
}, "Unitless length quirk for border-bottom-width property");
test(function(){
assert_equals(sheet.cssRules[3].style.borderLeftWidth, "1px");
}, "Unitless length quirk for border-left-width property");
test(function(){
assert_equals(sheet.cssRules[4].style.borderWidth, "1px");
}, "Unitless length quirk for border-width property");
test(function(){
assert_equals(sheet.cssRules[5].style.bottom, "1px");
}, "Unitless length quirk for bottom property");
test(function(){
assert_equals(sheet.cssRules[6].style.clip, "rect(1px 1px 1px 1px)");
}, "Unitless length quirk for clip property");
test(function(){
assert_equals(sheet.cssRules[7].style.fontSize, "1px");
}, "Unitless length quirk for font-size property");
test(function(){
assert_equals(sheet.cssRules[8].style.height, "1px");
}, "Unitless length quirk for height property");
test(function(){
assert_equals(sheet.cssRules[9].style.left, "1px");
}, "Unitless length quirk for left property");
test(function(){
assert_equals(sheet.cssRules[10].style.letterSpacing, "1px");
}, "Unitless length quirk for letter-spacing property");
test(function(){
assert_equals(sheet.cssRules[11].style.marginRight, "1px");
}, "Unitless length quirk for margin-right property");
test(function(){
assert_equals(sheet.cssRules[12].style.marginLeft, "1px");
}, "Unitless length quirk for margin-left property");
test(function(){
assert_equals(sheet.cssRules[13].style.marginTop, "1px");
}, "Unitless length quirk for margin-top property");
test(function(){
assert_equals(sheet.cssRules[14].style.marginBottom, "1px");
}, "Unitless length quirk for margin-bottom property");
test(function(){
assert_equals(sheet.cssRules[15].style.margin, "1px");
}, "Unitless length quirk for margin property");
test(function(){
assert_equals(sheet.cssRules[16].style.paddingRight, "1px");
}, "Unitless length quirk for padding-right property");
test(function(){
assert_equals(sheet.cssRules[17].style.paddingLeft, "1px");
}, "Unitless length quirk for padding-left property");
test(function(){
assert_equals(sheet.cssRules[18].style.paddingTop, "1px");
}, "Unitless length quirk for padding-top property");
test(function(){
assert_equals(sheet.cssRules[19].style.paddingBottom, "1px");
}, "Unitless length quirk for padding-bottom property");
test(function(){
assert_equals(sheet.cssRules[20].style.padding, "1px");
}, "Unitless length quirk for padding property");
test(function(){
assert_equals(sheet.cssRules[21].style.right, "1px");
}, "Unitless length quirk for right property");
test(function(){
assert_equals(sheet.cssRules[22].style.top, "1px");
}, "Unitless length quirk for top property");
test(function(){
assert_equals(sheet.cssRules[23].style.width, "1px");
}, "Unitless length quirk for width property");
test(function(){
assert_equals(sheet.cssRules[24].style.wordSpacing, "1px");
}, "Unitless length quirk for word-spacing property");
test(function(){
assert_equals(sheet.cssRules[25].style.borderTop, "");
}, "No unitless length quirk for border-top property");
test(function(){
assert_equals(sheet.cssRules[26].style.borderRight, "");
}, "No unitless length quirk for border-right property");
test(function(){
assert_equals(sheet.cssRules[27].style.borderBottom, "");
}, "No unitless length quirk for border-bottom property");
test(function(){
assert_equals(sheet.cssRules[28].style.borderLeft, "");
}, "No unitless length quirk for border-left property");
test(function(){
assert_equals(sheet.cssRules[29].style.borderSpacing, "10px");
}, "Unitless length quirk for border-spacing property");
test(function(){
assert_equals(sheet.cssRules[30].style.borderSpacing, "10px 20px");
}, "Unitless length quirk for border-spacing property");
test(function(){
assert_equals(sheet.cssRules[31].style.borderTop, "");
}, "No unitless length quirk for border-top property");
test(function(){
assert_equals(sheet.cssRules[32].style.borderTop, "");
}, "No unitless length quirk for border-top property");
test(function(){
assert_equals(sheet.cssRules[33].style.borderTop, "10px double rgb(255, 0, 0)");
}, "Unitless length quirk for border-top property");
test(function(){
assert_equals(sheet.cssRules[34].style.borderTop, "");
}, "No unitless length quirk for border-top property");
test(function(){
assert_equals(sheet.cssRules[35].style.border, "");
}, "No unitless length quirk for border property");
test(function(){
assert_equals(sheet.cssRules[36].style.border, "");
}, "No unitless length quirk for border property");
test(function(){
assert_equals(sheet.cssRules[37].style.border, "10px solid rgb(255, 0, 0)");
}, "Unitless length quirk for border property");
test(function(){
assert_equals(sheet.cssRules[38].style.border, "");
}, "No unitless length quirk for border property");
test(function(){
assert_equals(sheet.cssRules[39].style.font, "");
}, "No unitless length quirk for font property");
test(function(){
assert_equals(sheet.cssRules[40].style.font, "");
}, "No unitless length quirk for font property");
test(function(){
assert_equals(sheet.cssRules[41].style.backgroundPosition, "10px center");
}, "Unitless length quirk for background-position property");
test(function(){
assert_equals(sheet.cssRules[42].style.backgroundPosition, "10px 20px");
}, "Unitless length quirk for background-position property");
test(function(){
assert_equals(sheet.cssRules[43].style.background, "");
}, "No unitless length quirk for background property");
test(function(){
assert_equals(sheet.cssRules[44].style.background, "");
}, "No unitless length quirk for background property");
test(function(){
assert_equals(sheet.cssRules[45].style.background, "10px center rgb(255, 0, 0)");
}, "No unitless length quirk for background property");
test(function(){
assert_equals(sheet.cssRules[46].style.background, "");
}, "No unitless length quirk for background property");
test(function(){
assert_equals(sheet.cssRules[47].style.textIndent, "10px");
}, "Unitless length quirk for text-indent property");
test(function(){
assert_equals(sheet.cssRules[48].style.outlineWidth, "");
}, "No unitless length quirk for outline-width property");
test(function(){
assert_equals(sheet.cssRules[49].style.minWidth, "10px");
}, "Unitless length quirk for min-width property");
test(function(){
assert_equals(sheet.cssRules[50].style.minHeight, "10px");
}, "Unitless length quirk for min-height property");
test(function(){
assert_equals(sheet.cssRules[51].style.maxWidth, "10px");
}, "Unitless length quirk for max-width property");
test(function(){
assert_equals(sheet.cssRules[52].style.maxHeight, "10px");
}, "Unitless length quirk for max-height property");
</script>
|