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