index.html
174 KB
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html lang="en-US"><head>
<title>CSSOM</title>
<style type="text/css">
pre.idl { border:solid thin; background:#eee; color:#000; padding:0.5em }
pre.idl :link, pre.idl :visited { color:inherit; background:transparent }
dfn { font-weight:bold; font-style:normal }
.example { margin-left:1em; padding-left:1em; border-left:double; color:#222; background:#fcfcfc }
.example table code { color:inherit }
td, th { padding:.1em }
.note { margin-left:2em; color:green; font-style:italic; font-weight:bold }
p.note::before { content:"Note: " }
.XXX { padding:.5em; border:solid red }
p.XXX::before { content:"Issue: " }
dl.switch { padding-left:2em }
dl.switch > dt { text-indent:-1.5em }
dl.switch > dt:before { content:'\21AA'; padding:0 0.5em 0 0; display:inline-block; width:1em; text-align:right; line-height:0.5em }
code { color:orangered }
code :link, code :visited { color:inherit }
</style>
<link href="http://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet">
</head>
<body class="draft">
<div class="head">
<!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p>
<!--end-logo-->
<h1 id="cssom">CSSOM</h1>
<h2 class="no-num no-toc" id="w3c-working-draft-12-july-2011">W3C Working Draft 12 July 2011</h2>
<dl>
<dt>This Version:</dt>
<dd class="publish"><a href="http://www.w3.org/TR/2011/WD-cssom-20110712/">http://www.w3.org/TR/2011/WD-cssom-20110712/</a></dd>
<dt class="publish">Latest Version:</dt>
<dd class="publish"><a href="http://www.w3.org/TR/cssom/">http://www.w3.org/TR/cssom/</a></dd>
<dt class="publish">Latest Editor's draft:</dt>
<dd class="publish"><a href="http://dev.w3.org/csswg/cssom/">http://dev.w3.org/csswg/cssom/</a></dd>
<dt>Editor:</dt>
<dd><a href="http://annevankesteren.nl/">Anne van Kesteren</a>
(<a href="http://www.opera.com/">Opera Software ASA</a>)
<<a href="mailto:annevk@opera.com">annevk@opera.com</a>></dd>
</dl>
<!--begin-copyright-->
<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2011 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>
<!--end-copyright-->
</div>
<hr class="top">
<h2 class="no-num no-toc" id="abstract">Abstract</h2>
<p>CSSOM defines APIs (including generic parsing and serialization rules)
for Media Queries, Selectors, and of course CSS itself.</p>
<h2 class="no-num no-toc" id="sotd">Status of this Document</h2>
<p><em>This section describes the status of this document at the time of
its publication. Other documents may supersede this document. A list of
current W3C publications and the latest revision of this technical report
can be found in the
<a href="http://www.w3.org/TR/">W3C technical reports index at http://www.w3.org/TR/.</a></em>
<p>The
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
public mailing list <a href="mailto:www-style@w3.org">www-style@w3.org</a>
(see <a href="http://www.w3.org/Mail/Request">instructions</a>) is
preferred for discussion of this specification. When sending e-mail,
please put the text “cssom-view” in the subject, preferably
like this: “[<!---->cssom-view<!---->] <em>…summary of
comment…</em>”
<p>This is the 12 July 2011 First Public Working Draft of CSSOM, produced by the
<a href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part
of the <a href="http://www.w3.org/Style/">Style Activity</a>).
<!--XXX remove "First Public" after initial publication -->
<p>This document was produced by a group operating under the
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>.
W3C maintains a
<a href="http://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a>
made in connection with the deliverables of the group; that page also
includes instructions for disclosing a patent. An individual who has
actual knowledge of a patent which the individual believes contains
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a>
must disclose the information in accordance with
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>.</p>
<p>Publication as a Working Draft does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or
obsoleted by other documents at any time. It is inappropriate to cite this
document as other than work in progress.
<h2 class="no-num no-toc" id="toc">Table of Contents</h2>
<!--begin-toc-->
<ol class="toc">
<li><a href="#introduction"><span class="secno">1 </span>Introduction</a>
<ol class="toc">
<li><a href="#history"><span class="secno">1.1 </span>History</a></ol></li>
<li><a href="#conformance"><span class="secno">2 </span>Conformance</a></li>
<li><a href="#terminology"><span class="secno">3 </span>Terminology</a>
<ol class="toc">
<li><a href="#common-serializing-idioms"><span class="secno">3.1 </span>Common Serializing Idioms</a></ol></li>
<li><a href="#media-queries"><span class="secno">4 </span>Media Queries</a>
<ol class="toc">
<li><a href="#parsing-media-queries"><span class="secno">4.1 </span>Parsing Media Queries</a></li>
<li><a href="#serializing-media-queries"><span class="secno">4.2 </span>Serializing Media Queries</a>
<ol class="toc">
<li><a href="#serializing-media-feature-values"><span class="secno">4.2.1 </span>Serializing Media Feature Values</a></ol></li>
<li><a href="#comparing-media-queries"><span class="secno">4.3 </span>Comparing Media Queries</a></li>
<li><a href="#the-medialist-interface"><span class="secno">4.4 </span>The <code title="">MediaList</code> Interface</a></li>
<li><a href="#creating-a-medialist-object"><span class="secno">4.5 </span>Creating a <code title="">MediaList</code> Object</a></ol></li>
<li><a href="#selectors"><span class="secno">5 </span>Selectors</a>
<ol class="toc">
<li><a href="#parsing-selectors"><span class="secno">5.1 </span>Parsing Selectors</a></li>
<li><a href="#serializing-selectors"><span class="secno">5.2 </span>Serializing Selectors</a></ol></li>
<li><a href="#css"><span class="secno">6 </span>CSS</a>
<ol class="toc">
<li><a href="#style-sheet-0"><span class="secno">6.1 </span>Style Sheet</a>
<ol class="toc">
<li><a href="#the-stylesheet-interface"><span class="secno">6.1.1 </span>The <code title="">StyleSheet</code> Interface</a></li>
<li><a href="#the-cssstylesheet-interface"><span class="secno">6.1.2 </span>The <code title="">CSSStyleSheet</code> Interface</a></ol></li>
<li><a href="#style-sheet-collections"><span class="secno">6.2 </span>Style Sheet Collections</a>
<ol class="toc">
<li><a href="#the-http-default-style-header"><span class="secno">6.2.1 </span>The HTTP <code title="">Default-Style</code> Header</a></li>
<li><a href="#the-stylesheetlist-sequence"><span class="secno">6.2.2 </span>The <code title="">StyleSheetList</code> Sequence</a></li>
<li><a href="#extensions-to-the-document-interface"><span class="secno">6.2.3 </span>Extensions to the <code title="">Document</code> Interface</a></li>
<li><a href="#interaction-with-the-user-interface"><span class="secno">6.2.4 </span>Interaction with the User Interface</a>
<ol class="toc">
<li><a href="#persisting-the-selected-style-sheet-set"><span class="secno">6.2.4.1 </span>Persisting the selected style sheet set</a></ol></li>
<li><a href="#examples"><span class="secno">6.2.5 </span>Examples</a></ol></li>
<li><a href="#style-sheet-association"><span class="secno">6.3 </span>Style Sheet Association</a>
<ol class="toc">
<li><a href="#the-linkstyle-interface"><span class="secno">6.3.1 </span>The <code title="">LinkStyle</code> Interface</a></li>
<li><a href="#requirements-on-specifications"><span class="secno">6.3.2 </span>Requirements on specifications</a></li>
<li><a href="#requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction"><span class="secno">6.3.3 </span>Requirements on User Agents Implementing the
<span title=""><code>xml-stylesheet</code> processing instruction</span></a></li>
<li><a href="#requirements-on-user-agents-implementing-the-http-link-header"><span class="secno">6.3.4 </span>Requirements on User Agents Implementing the HTTP
<code title="">Link</code> Header</a></ol></li>
<li><a href="#css-rules"><span class="secno">6.4 </span>CSS Rules</a>
<ol class="toc">
<li><a href="#the-cssrulelist-sequence"><span class="secno">6.4.1 </span>The <code title="">CSSRuleList</code> Sequence</a></li>
<li><a href="#the-cssrule-interface"><span class="secno">6.4.2 </span>The <code title="">CSSRule</code> Interface</a>
<ol class="toc">
<li><a href="#extensibility"><span class="secno">6.4.2.1 </span>Extensibility</a></ol></li>
<li><a href="#css-style-rule-rule-set"><span class="secno">6.4.3 </span>CSS Style Rule (Rule Set)</a></li>
<li><a href="#css-import-rule"><span class="secno">6.4.4 </span>CSS <code title="">@import</code> Rule</a></li>
<li><a href="#css-media-rule"><span class="secno">6.4.5 </span>CSS <code title="">@media</code> Rule</a></li>
<li><a href="#css-font-face-rule"><span class="secno">6.4.6 </span>CSS <code title="">@font-face</code> Rule</a></li>
<li><a href="#css-page-rule"><span class="secno">6.4.7 </span>CSS <code title="">@page</code> Rule</a></li>
<li><a href="#css-namespace-rule"><span class="secno">6.4.8 </span>CSS <code title="">@namespace</code> Rule</a></ol></li>
<li><a href="#css-declaration-blocks"><span class="secno">6.5 </span>CSS Declaration Blocks</a>
<ol class="toc">
<li><a href="#the-cssstyledeclaration-interface"><span class="secno">6.5.1 </span>The <code title="">CSSStyleDeclaration</code> Interface</a></li>
<li><a href="#the-cssstyledeclarationvalue-interface"><span class="secno">6.5.2 </span>The <code title="">CSSStyleDeclarationValue</code> Interface</a></ol></li>
<li><a href="#css-values"><span class="secno">6.6 </span>CSS Values</a>
<ol class="toc">
<li><a href="#parsing-css-values"><span class="secno">6.6.1 </span>Parsing CSS Values</a></li>
<li><a href="#serializing-css-values"><span class="secno">6.6.2 </span>Serializing CSS Values</a>
<ol class="toc">
<li><a href="#examples-0"><span class="secno">6.6.2.1 </span>Examples</a></ol></li>
<li><a href="#the-csspropertyvalue-interface"><span class="secno">6.6.3 </span>The <code title="">CSSPropertyValue</code> Interface</a></li>
<li><a href="#the-cssmapvalue-interface"><span class="secno">6.6.4 </span>The <code title="">CSSMapValue</code> Interface</a></li>
<li><a href="#the-csspropertyvaluelist-interface"><span class="secno">6.6.5 </span>The <code title="">CSSPropertyValueList</code> Interface</a></li>
<li><a href="#the-csscomponentvalue-interface"><span class="secno">6.6.6 </span>The <code title="">CSSComponentValue</code> Interface</a></ol></ol></li>
<li><a href="#dom-access-to-css-declaration-blocks"><span class="secno">7 </span>DOM Access to CSS Declaration Blocks</a>
<ol class="toc">
<li><a href="#the-elementcssinlinestyle-interface"><span class="secno">7.1 </span>The <code>ElementCSSInlineStyle</code> Interface</a></li>
<li><a href="#extensions-to-the-window-interface"><span class="secno">7.2 </span>Extensions to the <code title="">Window</code> Interface</a></ol></li>
<li><a href="#resolved-values"><span class="secno">8 </span>Resolved Values</a></li>
<li><a href="#iana-considerations"><span class="secno">9 </span>IANA Considerations</a>
<ol class="toc">
<li><a href="#default-style"><span class="secno">9.1 </span><code>Default-Style</code></a></ol></li>
<li><a class="no-num" href="#references">References</a>
<ol class="toc">
<li><a class="no-num" href="#normative-references">Normative references</a></li>
<li><a class="no-num" href="#informative-references">Informative references</a></ol></li>
<li><a class="no-num" href="#acknowledgments">Acknowledgments</a></ol>
<!--end-toc-->
<h2 id="introduction"><span class="secno">1 </span>Introduction</h2>
<p class="XXX">...</p>
<h3 id="history"><span class="secno">1.1 </span>History</h3>
<p>Several interfaces from DOM Level 2 Style
<a href="http://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html" title="[CSSOM] CSSValue and related interfaces (message from the CSS WG)">have
been obsoleted</a> because they were thought to be too awkward for
frequent use. This specification no longer contains those features.
<code>DOMImplementationCSS</code> and <code>CSSCharsetRule</code> have
been removed as well as they were not deemed necessary.</p>
<h2 id="conformance"><span class="secno">2 </span>Conformance</h2>
<p>All diagrams, examples, and notes in this specification are
non-normative, as are all sections explicitly marked non-normative.
Everything else in this specification is normative.
<p>The key words "MUST", "MUST NOT", "REQUIRED", <!--"SHALL", "SHALL
NOT",--> "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in the normative parts of this document are to be
interpreted as described in RFC2119. For readability, these words do
not appear in all uppercase letters in this specification.
<a href="#refsRFC2119">[RFC2119]</a>
<p>Requirements phrased in the imperative as part of algorithms
(such as "strip any leading space characters" or "return false and
terminate these steps") are to be interpreted with the meaning of the
key word ("must", "should", "may", etc) used in introducing the
algorithm.
<p>Conformance requirements phrased as algorithms or specific steps
may be implemented in any manner, so long as the end result is
equivalent. (In particular, the algorithms defined in this
specification are intended to be easy to follow, and not intended to
be performant.)
<p id="hardwareLimitations">User agents may impose
implementation-specific limits on otherwise unconstrained inputs,
e.g. to prevent denial of service attacks, to guard against running
out of memory, or to work around platform-specific limitations.
<p>When a method or an attribute is said to call another method or attribute, the user agent must invoke its internal API for that attribute or method so that e.g. the author can't change the behavior by overriding attributes or methods with custom properties or functions in ECMAScript.
<p>Unless otherwise stated, string comparisons are done in a
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#case-sensitive">case-sensitive</a> manner.
<h2 id="terminology"><span class="secno">3 </span>Terminology</h2>
<p>Terminology used in this specification is from
<cite>DOM Core</cite>,
<cite>HTML</cite>,
<cite>Associating Style Sheets with XML documents</cite>
and
<cite>XML</cite>
<a href="#refsDOMCORE">[DOMCORE]</a>
<a href="#refsHTML">[HTML]</a>
<a href="#refsXMLSS">[XMLSS]</a>
<a href="#refsXML">[XML]</a>
<p class="XXX"><dfn id="supported-styling-language">supported styling language</dfn>
<p>When this specification talks about object
<code title=""><var>A</var></code> where <code title=""><var>A</var></code> is actually an interface, it generally means an object implementing interface
<code title=""><var>A</var></code>.</p>
<p>The term <dfn id="whitespace">whitespace</dfn> is used as defined in CSS.
<!--XXX <a href="#ref-css">[CSS]</a>--></p>
<h3 id="common-serializing-idioms"><span class="secno">3.1 </span>Common Serializing Idioms</h3>
<p>To <dfn id="serialize-a-character">serialize a character</dfn> means to create a string of
"<code>\</code>" (U+005C), followed by the character.</p>
<p>To <dfn id="serialize-a-character-as-code-point">serialize a character as code point</dfn> means to create a
string of "<code>\</code>" (U+005C), followed by the Unicode code point as
the smallest possible number of hexadecimal digits in the range 0-9 a-f
(U+0030 to U+0039 and U+0061 to U+0066) to represent the code point in
base 16, followed by a space (U+0020).</p>
<p>To <dfn id="serialize-an-identifier">serialize an identifier</dfn> means to create a string represented
by the concatenation of, for each character of the identifier:</p>
<ul>
<li>If the character is in the range U+0000 to U+001F, the character
<a href="#serialize-a-character-as-code-point" title="serialize a character as code point">escaped as code point</a>.</li>
<li>If the character is the first character and is in the range 0-9
(U+0030 to U+0039), the character
<a href="#serialize-a-character-as-code-point" title="serialize a character as code point">escaped as code point</a>.</li>
<li>If the character is the second character and is in the range 0-9
(U+0030 to U+0039) and the first character is a "<code>-</code>"
(U+002D), the character
<a href="#serialize-a-character-as-code-point" title="serialize a character as code point">escaped as code point</a>.</li>
<li>If the character is the second character and is "<code>-</code>"
(U+002D) and the first character is "<code>-</code>" too, the
<a href="#serialize-a-character" title="serialize a character">escaped</a> character.</li>
<li>If the character is not handled by one of the above rules and is
greater than or equal to U+0080, is "<code>-</code>" (U+002D) or
"<code>_</code>" (U+005F), or is in one of the ranges 0-9 (U+0030 to
U+0039), A-Z (U+0041 to U+005A), or a-z (U+0061 to U+007A), the character
itself.</li>
<li>Otherwise, the <a href="#serialize-a-character" title="serialize a character">escaped</a>
character.</li>
</ul>
<p>To <dfn id="serialize-a-string">serialize a string</dfn> means to create a string represented
by '<code>"</code>' (U+0022), followed by the result of applying the rules
below to each character of the given string, followed by
'<code>"</code>' (U+0022):</p>
<ul>
<li>If the character is in the range U+0000 to U+001F, the character
<a href="#serialize-a-character-as-code-point" title="serialize a character as code point">escaped as code point</a>.</li>
<li>If the character is '<code>"</code>' (U+0022) or '<code>\</code>'
(U+005C), the <a href="#serialize-a-character" title="serialize a character">escaped</a> character.</li>
<li>Otherwise, the character itself.</li>
</ul>
<p class="note">"<code>'</code>" (U+0027) is not escaped because strings
are always serialized with '<code>"</code>' (U+0022).</p>
<p>To <dfn id="serialize-a-url">serialize a URL</dfn> means to create a string represented by
"<code title="">url(</code>", followed by the
<a href="#serialize-a-string" title="serialize a string">string escaped</a> value of the given
string, followed by "<code>)</code>".</p>
<p>To <dfn id="serialize-a-comma-separated-list">serialize a comma-separated list</dfn> concatenate all items of
the list in list order while separating them by "<code>,</code>" (U+002C),
followed by a space (U+0020).</p>
<p>To <dfn id="serialize-a-whitespace-separated-list">serialize a whitespace-separated list</dfn> concatenate all
items of the list in list order while separating them a space (U+0020).</p>
<h2 id="media-queries"><span class="secno">4 </span>Media Queries</h2>
<p>Media queries are defined by the Media Queries specification. This
section defines various concepts around media queries, including their API
and serialization form.</p>
<!-- XXX ref -->
<h3 id="parsing-media-queries"><span class="secno">4.1 </span>Parsing Media Queries</h3>
<p>To
<dfn id="parse-a-media-query-list">parse a media query list</dfn> for a
given string <var title="">s</var> into a media query list is defined in
the Media Queries specification. Return the list of one or more media
queries that the algorithm defined there gives.</p> <!-- XXX ref -->
<p class="note">A media query that ends up being "ignored" will turn
into "<code title="">not all</code>".</p>
<p>To
<dfn id="parse-a-media-query">parse a media query</dfn> for a given string
<var title="">s</var> means to follow the
<a href="#parse-a-media-query-list">parse a media query list</a> steps and return null if more
than one media query is returned or a media query if a
single media query is returned.</p>
<p class="note">Again, a media query that ends up being "ignored" will
turn into "<code title="">not all</code>".</p>
<h3 id="serializing-media-queries"><span class="secno">4.2 </span>Serializing Media Queries</h3>
<p>To
<dfn id="serialize-a-media-query-list">serialize a media query list</dfn>
run these steps:</p>
<ol>
<li><p>If the media query list is empty return the empty string and
terminate these steps.</li>
<li><p><a href="#serialize-a-media-query" title="serialize a media query">Serialize</a> each
media query in the list of media queries, sort them in lexicographical
order, and then
<a href="#serialize-a-comma-separated-list" title="serialize a comma-separated list">serialize</a> the
list.</li>
</ol>
<p>To
<dfn id="serialize-a-media-query">serialize a media query</dfn> let
<var title="">s</var> be the empty string, run the steps below, and
finally return <var title="">s</var>:</p>
<ol>
<li><p>If the media query is negated append "<code>not</code>", followed
by a space (U+0020), to <var title="">s</var>.</li>
<li><p>Let <var title="">type</var> be the media type of the media query,
<a href="#serialize-an-identifier" title="serialize an identifier">escaped</a> and
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</li>
<li><p>If the media query does not contain media features append
<var title="">type</var>, to <var title="">s</var>,
then return <var title="">s</var> and terminate this algorithm.</li>
<li><p>If <var title="">type</var> is not "<code>all</code>" or if the
media query is negated append <var title="">type</var>, followed by a
space (U+0020), followed by "<code>and</code>", followed by a space
(U+0020), to <var title="">s</var>.</li>
<li><p>Sort the media features in lexicographical order.</li>
<li>
<p>Then, for each media feature:</p>
<ol>
<li>Append a "<code>(</code>" (U+0028), followed by the media feature
name, <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#converted-to-ascii-lowercase">converted to ASCII lowercase</a>,
to <var title="">s</var>.<p></li>
<li><p>If a value is given append a "<code>:</code>" (U+003A), followed
by a space (U+0020), followed by the
<a href="#serialize-a-media-feature-value" title="serialize a media feature value">serialized media feature value</a>,
to <var title="">s</var>.</p>
<li><p>Append a "<code>)</code>" (U+0029) to
<var title="">s</var>.</li>
<li><p>If this is not the last media feature append a space (U+0020),
followed by "<code>and</code>", followed by a space (U+0020), to
<var title="">s</var>.</li>
</ol>
</li>
</ol>
<div class="example">
<p>Here are some examples of input (first column) and output (second
column):</p>
<table>
<thead>
<tr><th>Input<th>Output
<tbody>
<tr>
<td><code>not screen and (min-WIDTH:5px) AND (max-width:40px )</code>
<td><code>not screen and (max-width: 40px) and (min-width: 5px)</code>
<tr>
<td><code>all and (color) and (color)</code>
<td><code>(color)</code>
</table>
</div>
<h4 id="serializing-media-feature-values"><span class="secno">4.2.1 </span>Serializing Media Feature Values</h4>
<p class="XXX">This should probably be done in terms of mapping it to
serializing CSS values as media features are defined in terms of CSS
values after all.</p>
<p>To <dfn id="serialize-a-media-feature-value">serialize a media feature value</dfn>
named <var title="">v</var> locate <var title="">v</var> in the first
column of the table below and use the serialization format described in
the second column:</p>
<table>
<tr>
<th>Media Feature
<th>Serialization
<tr>
<td><code title="">width</code>
<td>...
<tr>
<td><code title="">height</code>
<td>...
<tr>
<td><code title="">device-width</code>
<td>...
<tr>
<td><code title="">device-height</code>
<td>...
<tr>
<td><code title="">orientation</code>
<td>
<p>If the value is `<code title="">portrait</code>`: "<code title="">portrait</code>".</p>
<p>If the value is `<code title="">landscape</code>`: "<code title="">landscape</code>".</p>
<tr>
<td><code title="">aspect-ratio</code>
<td>...
<tr>
<td><code title="">device-aspect-ratio</code>
<td>...
<tr>
<td><code title="">color</code>
<td>...
<tr>
<td><code title="">color-index</code>
<td>...
<tr>
<td><code title="">monochrome</code>
<td>...
<tr>
<td><code title="">resolution</code>
<td>...
<tr>
<td><code title="">scan</code>
<td>
<p>If the value is `<code title="">progressive</code>`: "<code title="">progressive</code>".</p>
<p>If the value is `<code title="">interlace</code>`: "<code title="">interlace</code>".</p>
<tr>
<td><code title="">grid</code>
<td>...
</table>
<p>Other specifications can extend this table and vendor-prefixed media
features can have custom serialization formats as well.</p>
<h3 id="comparing-media-queries"><span class="secno">4.3 </span>Comparing Media Queries</h3>
<p>To
<dfn id="compare-media-queries">compare media queries</dfn>
<var title="">m1</var> and <var title="">m2</var> means to
<a href="#serialize-a-media-query" title="serialize a media query">serialize</a> them both and
return true if they are a
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#case-sensitive">case-sensitive</a> match and false if they
are not.</p>
<h3 id="the-medialist-interface"><span class="secno">4.4 </span>The <code title="">MediaList</code> Interface</h3>
<p>An object that implements the <code><a href="#medialist">MediaList</a></code> interface has an
associated <dfn id="collection-of-media-queries">collection of media queries</dfn>.</p>
<!-- http://dev.w3.org/2006/webapi/WebIDL/#idl-indexed-properties -->
<pre class="idl">interface <dfn id="medialist">MediaList</dfn> {
stringifier attribute DOMString <a href="#dom-medialist-mediatext" title="dom-MediaList-mediaText">mediaText</a>;
readonly attribute unsigned long <a href="#dom-medialist-length" title="dom-MediaList-length">length</a>;
getter DOMString <a href="#dom-medialist-item" title="dom-MediaList-item">item</a>(unsigned long <var title="">index</var>);
void <a href="#dom-medialist-appendmedium" title="dom-MediaList-appendMedium">appendMedium</a>(DOMString <var title="">medium</var>);
void <a href="#dom-medialist-deletemedium" title="dom-MediaList-deleteMedium">deleteMedium</a>(DOMString <var title="">medium</var>);
};</pre>
<p>The
<dfn id="dom-medialist-mediatext" title="dom-MediaList-mediaText"><code>mediaText</code></dfn>
attribute, on getting, must return a
<a href="#serialize-a-media-query-list" title="serialize a media query list">serialization</a> of
the <a href="#collection-of-media-queries">collection of media queries</a>.</p>
<p>On setting the <code title="dom-MediaList-mediaText"><a href="#dom-medialist-mediatext">mediaText</a></code>
attribute these steps must be run:</p>
<ol>
<li><p>Empty the <a href="#collection-of-media-queries">collection of media queries</a>.</li>
<li><p>If the given value is the empty string terminate these
steps.</li>
<li><p>Append all the media queries as a result of
<a href="#parse-a-media-query-list" title="parse a media query list">parsing</a> the given
value to the <a href="#collection-of-media-queries">collection of media queries</a>.</li>
</ol>
<p>The
<dfn id="dom-medialist-length" title="dom-MediaList-length"><code>length</code></dfn>
attribute must return the number of media queries in
the <a href="#collection-of-media-queries">collection of media queries</a>.</p>
<p>The
<dfn id="dom-medialist-item" title="dom-MediaList-item"><code>item(<var title="">index</var>)</code></dfn>
method must return the media query in the
<a href="#collection-of-media-queries">collection of media queries</a> given by
<var title="">index</var>, or null, if <var title="">index</var> is
greater than or equal to the number of media queries in the
<a href="#collection-of-media-queries">collection of media queries</a>.</p>
<!-- XXX need consistency here WebIDL? list of media queries? -->
<p>The
<dfn id="dom-medialist-appendmedium" title="dom-MediaList-appendmedium"><code>appendMedium(<var title="">medium</var>)</code></dfn>
method must run these steps:</p>
<ol>
<li><p>Let <var title="">m</var> be the result of
<a href="#parse-a-media-query" title="parse a media query">parsing</a> the given
value.</li>
<li><p>If <var title="">m</var> is null terminate these steps.</li>
<li><p>If <a href="#compare-media-queries" title="compare media queries">comparing</a>
<var title="">m</var> with any of the media queries in the
<a href="#collection-of-media-queries">collection of media queries</a> returns true terminate these
steps.</li>
<li><p>Append <var title="">m</var> to the
<a href="#collection-of-media-queries">collection of media queries</a>.</li>
</ol>
<p>The
<dfn id="dom-medialist-deletemedium" title="dom-MediaList-deletemedium"><code>deleteMedium(<var title="">medium</var>)</code></dfn>
method must run these steps:</p>
<ol>
<li><p>Let <var title="">m</var> be the result of
<a href="#parse-a-media-query" title="parse a media query">parsing</a> the given
value.</li>
<li><p>If <var title="">m</var> is null terminate these steps.</li>
<li><p>Remove any media query from the
<a href="#collection-of-media-queries">collection of media queries</a> for which
<a href="#compare-media-queries" title="compare media queries">comparing</a> the media query with
<var title="">m</var> returns true.</li>
</ol>
<h3 id="creating-a-medialist-object"><span class="secno">4.5 </span>Creating a <code title="">MediaList</code> Object</h3>
<p>To
<dfn id="create-a-medialist-object">create a <code>MediaList</code> object</dfn>
from <var title="">s</var> run these steps:</p>
<ol>
<li><p>Create a new <code><a href="#medialist">MediaList</a></code> object.</li>
<li><p>Set its <a href="#dom-medialist-mediatext" title="dom-MediaList-mediaText">mediaText</a>
attribute to <var title="">s</var>.</li>
<li><p>Return the newly created <code><a href="#medialist">MediaList</a></code> object.</li>
</ol>
<h2 id="selectors"><span class="secno">5 </span>Selectors</h2>
<p>Selectors are defined in the Selectors specification. This section
mainly defines how to serialize them.</p> <!-- XXX ref -->
<!-- XXX ref universal selector etc? some are in <span> some not -->
<h3 id="parsing-selectors"><span class="secno">5.1 </span>Parsing Selectors</h3>
<p>To
<dfn id="parse-a-group-of-selectors">parse a group of selectors</dfn>
means to parse the value using the <code title="">selectors_group</code>
production defined in the Selectors specification and return either a
group of selectors if parsing did not fail or null if parsing did
fail.</p> <!-- XXX ref -->
<h3 id="serializing-selectors"><span class="secno">5.2 </span>Serializing Selectors</h3>
<!-- http://dump.testsuite.org/2009/cssom/serializing-selectors.htm -->
<p>To
<dfn id="serialize-a-group-of-selectors">serialize a group of selectors</dfn>
<a href="#serialize-a-selector" title="serialize a selector">serialize</a> each selector in the
group of selectors and then
<a href="#serialize-a-comma-separated-list" title="serialize a comma-separated list">serialize</a> the
group.</p>
<p>To <dfn id="serialize-a-selector">serialize a selector</dfn> let
<var title="">s</var> be the empty string, run the steps below for each
part of the chain of the selector, and finally return
<var title="">s</var>:</p>
<ol>
<li><p>If there is only one <span>simple selector</span> in the
<span>sequence of simple selectors</span> which is a
<span>universal selector</span>, append the result of
<a href="#serialize-a-simple-selector" title="serialize a simple selector">serializing</a> the
<span>universal selector</span> to <var title="">s</var>.</li>
<li><p>Otherwise, for each <span>simple selector</span> in the
<span>sequence of simple selectors</span> that is not a
universal selector of which the <span>namespace prefix</span> maps to
the null namespace (not in a namespace) or of which the
<span>namespace prefix</span> maps to a namespace that is not the
<span>default namespace</span>
<a href="#serialize-a-simple-selector" title="serialize a simple selector">serialize</a> the
<span>simple selector</span> and append the result to
<var title="">s</var>.</li>
<li><p>If this is not the last part of the chain of the selector append a
space (U+0020), followed by the combinator
"<code>></code>",
"<code>+</code>", or
"<code>~</code>"
as appropriate, followed by another space (U+0020) if the combinator was
not whitespace, to <var title="">s</var>.</li>
<li><p>If this is the last part of the chain of the selector and there is
a pseudo-element, append "<code>::</code>" followed by the name of the
pseudo-class, to <var title="">s</var>.</li>
</ol>
<p>To
<dfn id="serialize-a-simple-selector">serialize a simple selector</dfn>
let <var title="">s</var> be the empty string, run the steps below, and
finally return <var title="">s</var>:</p>
<dl class="switch">
<dt>type selector</dt>
<dt>universal selector</dt>
<dd>
<ol>
<li><p>If the <span>namespace prefix</span> maps to a namespace that is
not the <span>default namespace</span> and is not the
null namespace (not in a namespace) append the
<a href="#serialize-an-identifier" title="serialize an identifier">escaped</a>
<span>namespace prefix</span>, followed by a "<code>|</code>" (U+007C)
to <var title="">s</var>.</li>
<li><p>If the <span>namespace prefix</span> maps to a namespace that is
the null namespace (not in a namespace) append
"<code>|</code>" (U+007C) to <var title="">s</var>.</li>
<!-- This includes |* -->
<li><p>If this is a type selector append the
<a href="#serialize-an-identifier" title="serialize an identifier">escaped</a> element name to
<var title="">s</var>.</p>
<li><p>If this is a universal selector append "<code>*</code> (U+002A)
to <var title="">s</var>.</li>
</ol>
</dd>
<dt>attribute selector</dt>
<dd>
<ol>
<li><p>Append "<code>[</code>" (U+005B) to
<var title="">s</var>.</li>
<li><p>If the <span>namespace prefix</span> maps to a namespace that is
not the null namespace (not in a namespace) append the
<a href="#serialize-an-identifier" title="serialize an identifier">escaped</a>
<span>namespace prefix</span>, followed by a "<code>|</code>" (U+007C)
to <var title="">s</var>.</li>
<li><p>If the <span>namespace prefix</span> maps to a namespace that is
the null namespace (not in a namespace) append
"<code>|</code>" (U+007C) to <var title="">s</var>.</li>
<!-- This includes |* -->
<li><p>Append the <a href="#serialize-an-identifier" title="serialize an identifier">escaped</a>
attribute name to <var title="">s</var>.</li>
<li><p>If there is an attribute value specified, append
"<code>=</code>",
"<code>~=</code>",
"<code>|=</code>",
"<code>^=</code>",
"<code>$=</code>", or
"<code>*=</code>"
as appropriate (depending on the type of attribute selector), followed
by the <a href="#serialize-a-string" title="serialize a string">string escaped</a>
attribute value, to <var title="">s</var>.</li>
<li><p>Append "<code>]</code>" (U+005D) to
<var title="">s</var>.</li>
</ol>
</dd>
<dt>class selector</dt>
<dd><p>Append a "<code>.</code>" (U+002E), followed by the
<a href="#serialize-an-identifier" title="serialize an identifier">escaped</a> class name to
<var title="">s</var>.</dd>
<dt>ID selector</dt>
<dd><p>Append a "<code>#</code>" (U+0023), followed by the
<a href="#serialize-an-identifier" title="serialize an identifier">escaped</a> ID to
<var title="">s</var>.</dd>
<dt>pseudo-class</dt>
<dd>
<p>If the pseudo-class does not accept arguments append
"<code>:</code>" (U+003A), followed by the name of the pseudo-class, to
<var title="">s</var>.</p>
<p>Otherwise, append "<code>:</code>" (U+003A), followed by the name of
the pseudo-class, followed by "<code>(</code>" (U+0028), followed by the
value of the pseudo-class argument determined as per below, followed by
"<code>)</code>" (U+0029), to <var title="">s</var>.</p>
<dl class="switch">
<dt><code title="">:lang()</code></dt>
<dd><p>The <a href="#serialize-an-identifier" title="serialize an identifier">escaped</a>
value.</dd>
<dt><code title="">:nth-child()</code></dt>
<dt><code title="">:nth-last-child()</code></dt>
<dt><code title="">:nth-of-type()</code></dt>
<dt><code title="">:nth-last-of-type()</code></dt>
<dd>
<ol>
<li><p>If the value is odd let the value be
"<code title="">2n+1</code>".</li>
<li><p>If the value is even let the value be
"<code title="">2n</code>".</li>
<li><p>If <var title="">a</var> is zero let the value be
<var title="">b</var>
<a href="#serialize-a-css-value-component" title="serialize a CSS component value">serialized</a> as <integer>.</li>
<li><p>If <var title="">a</var> is one or minus one and
<var title="">b</var> is zero let the value be
"<code title="">n</code>" (U+006E).</li>
<li><p>If <var title="">a</var> is one or minus one let the value be
"<code title="">n</code>" (U+006E), followed by
"<code>+</code>" (U+002B) if <var title="">b</var> is positive,
followed by <var title="">b</var>
<a href="#serialize-a-css-value-component" title="serialize a CSS component value">serialized</a> as <integer>.</li>
<li><p>If <var title="">b</var> is zero let the value be
<var title="">a</var>
<a href="#serialize-a-css-value-component" title="serialize a CSS component value">serialized</a> as <integer>,
followed by "<code title="">n</code>" (U+006E).</li>
<li><p>Otherwise let the value be
<var title="">a</var>
<a href="#serialize-a-css-value-component" title="serialize a CSS component value">serialized</a> as <integer>,
followed by "<code title="">n</code>" (U+006E), followed by
"<code>+</code>" (U+002B) if <var title="">b</var> is positive,
followed by <var title="">b</var>
<a href="#serialize-a-css-value-component" title="serialize a CSS component value">serialized</a> as <integer>.</li>
</ol>
</dd>
<dt><code title="">:not()</code></dt>
<dd><p>The result of serializing the value using the rules for
<a href="#serialize-a-group-of-selectors" title="serialize a group of selectors">serializing a group of selectors</a>.</dd>
</dl>
</dd>
</dl>
<h2 id="css"><span class="secno">6 </span>CSS</h2>
<h3 id="style-sheet-0"><span class="secno">6.1 </span>Style Sheet</h3>
<!-- XXX
element inserted into the DOM, style sheet created, element removed from
the DOM, what happens to StyleSheet?
-->
<p>A <dfn id="style-sheet">style sheet</dfn> is an abstract concept that
represents a style sheet as defined by the CSS specification. In the DOM a
<a href="#style-sheet">style sheet</a> is a <code><a href="#cssstylesheet">CSSStyleSheet</a></code> object. A
<a href="#style-sheet">style sheet</a> has a number of associated properties:</p>
<dl>
<dt><dfn id="style-sheet-type">style sheet type</dfn></dt>
<dd><p>The literal string "<code>text/css</code>".</dd>
<dt><dfn id="style-sheet-location">style sheet location</dfn></dt>
<dd><p>The <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#url">URL</a> of the
<a href="#style-sheet">style sheet</a> or null if the <a href="#style-sheet">style sheet</a> was
embedded.</dd>
<dt><dfn id="style-sheet-parent">style sheet parent</dfn></dt>
<dd><p>The <a href="#style-sheet">style sheet</a> that is the parent of the
<a href="#style-sheet">style sheet</a>.</dd>
<dt><dfn id="style-sheet-owner-node">style sheet owner node</dfn></dt>
<dd><p>The DOM node associated with the <a href="#style-sheet">style sheet</a> or
null if there is no associated DOM node.</dd>
<dt><dfn id="style-sheet-owner-css-rule">style sheet owner CSS rule</dfn></dt>
<dd><p>The <span>CSS rule</span> in the <a href="#style-sheet-parent">style sheet parent</a>
that caused the inclusion of the <a href="#style-sheet">style sheet</a> or null if
there is no such <span>CSS rule</span>.</dd>
<dt><dfn id="style-sheet-media">style sheet media</dfn></dt>
<dd>
<p>The <code><a href="#medialist">MediaList</a></code> object associated with the
<a href="#style-sheet">style sheet</a>.</p>
<p>If this property is set to a string run the
<a href="#create-a-medialist-object">create a <code>MediaList</code> object</a> steps for that
string and associate the returned object with the
<a href="#style-sheet">style sheet</a>.</p>
</dd>
<dt><dfn id="style-sheet-title">style sheet title</dfn></dt>
<dd>
<p>The title of the <a href="#style-sheet">style sheet</a>. It is said to be empty
if the title is the empty string.</p>
<div class="example">
<p>In these examples the <a href="#style-sheet-title">style sheet title</a> ends up being
empty:</p>
<pre><style title=""> body { background:papayawhip } </style></pre>
<pre><style> body { background:orange } </style></pre>
</div>
</dd>
<dt><dfn id="style-sheet-alternate-flag">style sheet alternate flag</dfn></dt>
<dd>
<p>Either true or false. False by default.</p>
<div class="example">
<p>The following <a href="#style-sheet" title="style sheet">style sheets</a> have
their <a href="#style-sheet-alternate-flag">style sheet alternate flag</a> set:</p>
<pre><code><?xml-stylesheet alternate="yes" title="x" href="data:text/css,…"?></code></pre>
<pre><code><link rel="alternate stylesheet" title="x" href="data:text/css,…"></code></pre>
</div>
</dd>
<dt><dfn id="style-sheet-disabled-flag">style sheet disabled flag</dfn></dt>
<dd>
<p>Either true or false. False by default.</p>
<p class="note">Even when false it does not necessarily mean that the
<a href="#style-sheet">style sheet</a> is actually rendered.</p>
</dd>
<dt><dfn id="style-sheet-css-rules">style sheet CSS rules</dfn></dt>
<dd><p>The <span title="CSS rule">CSS rules</span> associated with the
<a href="#style-sheet">style sheet</a>.</dd>
</dl>
<p>When you are to <a href="#create-a-style-sheet">create a style sheet</a> the above properties,
with the exception of <a href="#style-sheet-type">style sheet type</a> and
<a href="#style-sheet-css-rules">style sheet CSS rules</a>, are to be set to
their proper values.</p>
<!-- same-origin restrictions -->
<h4 id="the-stylesheet-interface"><span class="secno">6.1.1 </span>The <code title="">StyleSheet</code> Interface</h4>
<p>The <code><a href="#stylesheet">StyleSheet</a></code> interface represents a base interface that
has no meaning on its own.</p>
<pre class="idl">interface <dfn id="stylesheet">StyleSheet</dfn> {
readonly attribute DOMString <a href="#dom-stylesheet-type" title="dom-StyleSheet-type">type</a>;
readonly attribute DOMString <a href="#dom-stylesheet-href" title="dom-StyleSheet-href">href</a>;
readonly attribute Node <a href="#dom-stylesheet-ownernode" title="dom-StyleSheet-ownerNode">ownerNode</a>;
readonly attribute <a href="#stylesheet">StyleSheet</a> <a href="#dom-stylesheet-parentstylesheet" title="dom-StyleSheet-parentStyleSheet">parentStyleSheet</a>;
readonly attribute DOMString <a href="#dom-stylesheet-title" title="dom-StyleSheet-title">title</a>;
[PutForwards=<a href="#dom-medialist-mediatext" title="dom-MediaList-mediaText">mediaText</a>] readonly attribute <a href="#medialist">MediaList</a> <a href="#dom-stylesheet-media" title="dom-StyleSheet-media">media</a>;
attribute boolean <a href="#dom-stylesheet-disabled" title="dom-StyleSheet-disabled">disabled</a>;
};</pre>
<p>The
<dfn id="dom-stylesheet-type" title="dom-StyleSheet-type"><code>type</code></dfn>
attribute must return the
<a href="#style-sheet-type">style sheet type</a>.</p>
<p>The
<dfn id="dom-stylesheet-href" title="dom-StyleSheet-href"><code>href</code></dfn>
attribute must return the
<a href="#style-sheet-location">style sheet location</a>.</p>
<p>The
<dfn id="dom-stylesheet-ownernode" title="dom-StyleSheet-ownerNode"><code>ownerNode</code></dfn>
attribute must return the
<a href="#style-sheet-owner-node">style sheet owner node</a>.</p>
<p>The
<dfn id="dom-stylesheet-parentstylesheet" title="dom-StyleSheet-parentStyleSheet"><code>parentStyleSheet</code></dfn>
attribute must return the
<a href="#style-sheet-parent">style sheet parent</a>.</p>
<p>The
<dfn id="dom-stylesheet-title" title="dom-StyleSheet-title"><code>title</code></dfn>
attribute must return the
<a href="#style-sheet-title">style sheet title</a>.</p>
<p>The
<dfn id="dom-stylesheet-media" title="dom-StyleSheet-media"><code>media</code></dfn>
attribute must return the
<a href="#style-sheet-media">style sheet media</a>.</p>
<p>The
<dfn id="dom-stylesheet-disabled" title="dom-StyleSheet-disabled"><code>disabled</code></dfn>
attribute must, on getting, return the
<a href="#style-sheet-disabled-flag">style sheet disabled flag</a>. On setting, it
must set the <a href="#style-sheet-disabled-flag">style sheet disabled flag</a> to
the given value.</p>
<h4 id="the-cssstylesheet-interface"><span class="secno">6.1.2 </span>The <code title="">CSSStyleSheet</code> Interface</h4>
<p>The <code><a href="#cssstylesheet">CSSStyleSheet</a></code> interface represents a
<a href="#style-sheet">style sheet</a>.</p>
<!--
IE exposes:
owningElement, pages, id, type, href, disabled, cssText, readOnly, title,
parentStyleSheet, imports, rules, media
-->
<pre class="idl">interface <dfn id="cssstylesheet">CSSStyleSheet</dfn> : <a href="#stylesheet">StyleSheet</a> {
readonly attribute <a href="#cssrule">CSSRule</a> <a href="#dom-cssstylesheet-ownerrule" title="dom-CSSStyleSheet-ownerRule">ownerRule</a>;
readonly attribute <a href="#cssrulelist">CSSRuleList</a> <a href="#dom-cssstylesheet-cssrules" title="dom-CSSStyleSheet-cssRules">cssRules</a>;
unsigned long <a href="#dom-cssstylesheet-insertrule" title="dom-CSSStyleSheet-insertRule">insertRule</a>(DOMString <var title="">rule</var>, unsigned long <var title="">index</var>);
void <a href="#dom-cssstylesheet-deleterule" title="dom-CSSStyleSheet-deleteRule">deleteRule</a>(unsigned long <var title="">index</var>);
};</pre>
<p>The
<dfn id="dom-cssstylesheet-ownerrule" title="dom-CSSStyleSheet-ownerRule"><code>ownerRule</code></dfn>
attribute must return the
<a href="#style-sheet-owner-css-rule">style sheet owner CSS rule</a>.</p>
<p>The
<dfn id="dom-cssstylesheet-cssrules" title="dom-CSSStyleSheet-cssRules"><code>cssRules</code></dfn>
attribute must return a <code><a href="#cssrulelist">CSSRuleList</a></code>
object representing the <a href="#style-sheet-css-rules">style sheet CSS rules</a>.</p>
<p class="note">CSS rules that were dropped during parsing can not be
found using APIs described by this specification.</p>
<p>The
<dfn id="dom-cssstylesheet-insertrule" title="dom-CSSStyleSheet-insertRule"><code>insertRule(<var title="">rule</var>, <var title="">index</var>)</code></dfn>
method must <a href="#insert-a-css-rule">insert a CSS rule</a>
<var title="">rule</var> the in CSS rule list returned by
<code title="dom-CSSStyleSheet-cssRules"><a href="#dom-cssstylesheet-cssrules">cssRules</a></code> at
<var title="">index</var>.</p>
<p>The
<dfn id="dom-cssstylesheet-deleterule" title="dom-CSSStyleSheet-deleteRule"><code>deleteRule(<var title="">index</var>)</code></dfn>
method must <a href="#remove-a-css-rule">remove a CSS rule</a> from the
CSS rule list returned by
<code title="dom-CSSStyleSheet-cssRules"><a href="#dom-cssstylesheet-cssrules">cssRules</a></code> at
<var title="">index</var>.</p>
<h3 id="style-sheet-collections"><span class="secno">6.2 </span>Style Sheet Collections</h3>
<p>Below various new concepts are defined that are associated with each
<code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a></code> object.</p>
<p>Each <code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a></code> has an associated list of zero or more
<a href="#style-sheet" title="style sheet">style sheets</a>, named the
<dfn id="document-style-sheets">document style sheets</dfn>. This is
an ordered list that contains all
<a href="#style-sheet" title="style sheet">style sheets</a> associated with the
<code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a></code>, in
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#tree-order">tree order</a>, with
<a href="#style-sheet" title="style sheet">style sheets</a> created from HTTP
<code title="http-link">Link</code> headers first, if any, in header
order.</p>
<p>To <dfn id="create-a-style-sheet">create a style sheet</dfn>, run these
steps:</p>
<ol>
<li><p>Create a new <a href="#style-sheet">style sheet</a> object and set its
properties as specified.</li>
<li><p>Then run the <a href="#add-a-style-sheet">add a style sheet</a> steps for the newly
created <a href="#style-sheet">style sheet</a>.</li>
</ol>
<p>To <dfn id="add-a-style-sheet">add a style sheet</dfn>, run these
steps:</p>
<ol>
<li><p>Add the <a href="#style-sheet">style sheet</a> to the list of
<a href="#document-style-sheets">document style sheets</a> at the appropriate location. The
remainder of these steps deal with the
<a href="#style-sheet-disabled-flag">style sheet disabled flag</a>.</li>
<li><p>If the <a href="#style-sheet-disabled-flag">style sheet disabled flag</a> is true terminate
these steps.</li>
<li><p>If the <a href="#style-sheet-title">style sheet title</a> is non-empty, the
<a href="#style-sheet-alternate-flag">style sheet alternate flag</a> is false, and
<a href="#preferred-style-sheet-set-name">preferred style sheet set name</a> is the empty string
<a href="#change-the-preferred-style-sheet-set-name">change the preferred style sheet set name</a> to the
<a href="#style-sheet-title">style sheet title</a>.</li>
<li>
<p>If any of the following is true set the
<a href="#style-sheet-disabled-flag">style sheet disabled flag</a> to false and terminate these
steps:</p>
<ul>
<li><p>The <a href="#style-sheet-title">style sheet title</a> is empty.</li>
<li><p>The <a href="#last-style-sheet-set-name">last style sheet set name</a> is null and the
<a href="#style-sheet-title">style sheet title</a> is a
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#case-sensitive">case-sensitive</a> match
for the <a href="#preferred-style-sheet-set-name">preferred style sheet set name</a>.</li>
<li><p>The <a href="#style-sheet-title">style sheet title</a> is a
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#case-sensitive">case-sensitive</a> match for the
<a href="#last-style-sheet-set-name">last style sheet set name</a>.</li>
</ul>
</li>
<li><p>Set the <a href="#style-sheet-disabled-flag">style sheet disabled flag</a> to true.</li>
</ol>
<p>A <dfn id="persistent-style-sheet">persistent style sheet</dfn> is a
<a href="#style-sheet">style sheet</a> from the <a href="#document-style-sheets">document style sheets</a>
whose <a href="#style-sheet-title">style sheet title</a> is the empty string and whose
<a href="#style-sheet-alternate-flag">style sheet alternate flag</a> is false.</p>
<p>A <dfn id="style-sheet-set">style sheet set</dfn> is an ordered
collection of one or more <a href="#style-sheet" title="style sheet">style sheets</a>
from the <a href="#document-style-sheets">document style sheets</a> which have an identical
<a href="#style-sheet-title">style sheet title</a> that is not the empty string.</p>
<p>A <dfn id="style-sheet-set-name">style sheet set name</dfn> is the
<a href="#style-sheet-title">style sheet title</a> the <a href="#style-sheet-set">style sheet set</a> has in
common.</p>
<p>An <dfn id="enabled-style-sheet-set">enabled style sheet set</dfn> is a
<a href="#style-sheet-set">style sheet set</a> of which each <a href="#style-sheet">style sheet</a> has
its <a href="#style-sheet-disabled-flag">style sheet disabled flag</a> set to false.</p>
<p>To <dfn id="enable-a-style-sheet-set">enable a style sheet set</dfn>
with name <var title="">name</var>, run these steps:</p>
<ol>
<li><p>If <var title="">name</var> is the empty string set the
<a href="#style-sheet-disabled-flag">style sheet disabled flag</a> for each <a href="#style-sheet">style sheet</a>
that is in a <a href="#style-sheet-set">style sheet set</a> to true and terminate these
steps.</li>
<li><p>Set the <a href="#style-sheet-disabled-flag">style sheet disabled flag</a> for each
<a href="#style-sheet">style sheet</a> in a <a href="#style-sheet-set">style sheet set</a> whose
<a href="#style-sheet-set-name">style sheet set name</a> is a
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#case-sensitive">case-sensitive</a> match for
<var title="">name</var> to false and set it to true for all other
<a href="#style-sheet" title="style sheet">style sheets</a> in a
<a href="#style-sheet-set">style sheet set</a>.</li>
</ol>
<p>To <dfn id="select-a-style-sheet-set">select a style sheet set</dfn>
with name <var title="">name</var>, run these steps:</p>
<ol>
<li><p><a href="#enable-a-style-sheet-set">Enable a style sheet set</a> with name
<var title="">name</var>.</li>
<li><p>Set <a href="#last-style-sheet-set-name">last style sheet set name</a> to
<var title="">name</var>.</li>
</ol>
<p>A <dfn id="last-style-sheet-set-name">last style sheet set name</dfn>
is a concept to determine what <a href="#style-sheet-set">style sheet set</a> was last
<a href="#select-a-style-sheet-set" title="select a style sheet set">selected</a>. Initially its
value is null.</p>
<p>A
<dfn id="preferred-style-sheet-set-name">preferred style sheet set name</dfn>
is a concept to determine which
style sheets need to have their
<a href="#style-sheet-disabled-flag">style sheet disabled flag</a> set to false. Initially its value
is the empty string.
<p>To
<dfn id="change-the-preferred-style-sheet-set-name">change the preferred style sheet set name</dfn>
with name <var title="">name</var>, run these steps:</p>
<ol>
<li><p>Let the <a href="#preferred-style-sheet-set-name">preferred style sheet set name</a> be
<var title="">current</var>.</li>
<li><p>Set <a href="#preferred-style-sheet-set-name">preferred style sheet set name</a> to
<var title="">name</var>.</li>
<li><p>If <var title="">name</var> is not a
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#case-sensitive">case-sensitive</a> match for
<var title="">current</var> and
<a href="#last-style-sheet-set-name">last style sheet set name</a> is null
<a href="#enable-a-style-sheet-set">enable a style sheet set</a> with name
<var title="">new</var>.</li>
</ol>
<!-- XXX ought to define "applied"
thoughts:
depends on disabled flag, alternate flag, media queries, sheesh
-->
<h4 id="the-http-default-style-header"><span class="secno">6.2.1 </span>The HTTP <code title="">Default-Style</code> Header</h4>
<p>The HTTP <code title="http-default-style"><a href="#default-style">Default-Style</a></code> header
can be used to set the <a href="#preferred-style-sheet-set-name">preferred style sheet set name</a>
influencing which <a href="#style-sheet-set">style sheet set</a> is (initially) the
<a href="#enabled-style-sheet-set">enabled style sheet set</a>.</p>
<p>For each HTTP <code title="http-default-style"><a href="#default-style">Default-Style</a></code>
header, in header order, the user agent must
<a href="#change-the-preferred-style-sheet-set-name">change the preferred style sheet set name</a> with name being the
value of the header.</p>
<h4 id="the-stylesheetlist-sequence"><span class="secno">6.2.2 </span>The <code title="">StyleSheetList</code> Sequence</h4>
<p>The sequence parameterized type represents an ordered collection of
<a href="#style-sheet" title="style sheet">style sheets</a>.</p>
<pre class="idl">typedef sequence<<a href="#stylesheet">StyleSheet</a>> <dfn id="stylesheetlist">StyleSheetList</dfn>;</pre>
<!--
<pre class="idl">interface <dfn>StyleSheetList</dfn> {
readonly attribute unsigned long <span title="stylesheetlist-length">length</span>;
getter <span>StyleSheet</span> <span title="stylesheetlist-item">item</span>(unsigned long <var title="">index</var>);
};</pre>
<p>The
<dfn id="stylesheetlist-length" title="stylesheetlist-length"><code>length</code></dfn>
attribute, on getting, must return the number of
objects currently in the list.</p>
<p>The
<dfn title="stylesheetlist-item"><code>item(<var title="">index</var>)</code></dfn>
method, when invoked, must return the
<code>StyleSheet</code> object in the list given by <var title="">index</var>, or
null, if <var title="">index</var> is greater than or equal to the
number of items in the list.</p>
-->
<h4 id="extensions-to-the-document-interface"><span class="secno">6.2.3 </span>Extensions to the <code title="">Document</code> Interface</h4>
<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=200930 (FIXED) -->
<pre class="idl">partial interface <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a> {
readonly attribute <a href="#stylesheetlist">StyleSheetList</a> <a href="#dom-document-stylesheets" title="dom-Document-styleSheets">styleSheets</a>;
attribute DOMString? <a href="#dom-document-selectedStyleSheetSet" title="dom-Document-selectedStyleSheetSet">selectedStyleSheetSet</a>;
readonly attribute DOMString? <a href="#dom-document-lastStyleSheetSet" title="dom-Document-lastStyleSheetSet">lastStyleSheetSet</a>;
readonly attribute DOMString? <a href="#dom-document-preferredStyleSheetSet" title="dom-Document-preferredStyleSheetSet">preferredStyleSheetSet</a>;
readonly attribute DOMStringList <a href="#dom-document-styleSheetSets" title="dom-Document-styleSheetSets">styleSheetSets</a>;
void <a href="#dom-document-enablestylesheetsforset" title="dom-Document-enableStyleSheetsForSet">enableStyleSheetsForSet</a>(DOMString? <var title="">name</var>);
};</pre>
<p>The
<dfn id="dom-document-stylesheets" title="dom-Document-styleSheets"><code>styleSheets</code></dfn>
attribute must return a <code><a href="#stylesheetlist">StyleSheetList</a></code>
sequence representing the <a href="#document-style-sheets">document style sheets</a>.</p>
<p class="note">Because of historical IDL limitations the
<code title="dom-Document-styleSheets"><a href="#dom-document-stylesheets">styleSheets</a></code> attribute used
to be on a separate interface, <code title="">DocumentStyle</code>.</p>
<p>The
<dfn id="dom-document-selectedStyleSheetSet" title="dom-Document-selectedStyleSheetSet"><code>selectedStyleSheetSet</code></dfn>
attribute, on getting, must run these steps:</p>
<ol>
<li><p>If there is a single <a href="#enabled-style-sheet-set">enabled style sheet set</a> and no
other <a href="#document-style-sheets">document style sheets</a> with a non-empty
<a href="#style-sheet-title">style sheet title</a> have the
<a href="#style-sheet-disabled-flag">style sheet disabled flag</a> set to false return the
<a href="#style-sheet-set-name">style sheet set name</a> of the
<a href="#enabled-style-sheet-set">enabled style sheet set</a> and terminate this set of
steps.</li>
<li><p>Otherwise, if <a href="#style-sheet" title="style sheet">style sheets</a> from
different <a href="#style-sheet-set" title="style sheet set">style sheet sets</a> have
their <a href="#style-sheet-disabled-flag">style sheet disabled flag</a> set to false return
null and terminate this set of steps.</li>
<li>
<p>Otherwise, return the empty string.</p>
<p class="note">At this point either all
<a href="#style-sheet" title="style sheet">style sheets</a> with a non-empty
<a href="#style-sheet-title">style sheet title</a> have the
<a href="#style-sheet-disabled-flag">style sheet disabled flag</a> set to true or there are no such
<a href="#style-sheet" title="style sheet">style sheets</a>.</p>
</li>
</ol>
<p>On setting the
<code title="dom-Document-selectedStyleSheetSet"><a href="#dom-document-selectedStyleSheetSet">selectedStyleSheetSet</a></code>
attribute these steps must be run:</p>
<ol>
<li><p>If the value is null terminate this set of steps.</li>
<li><p>Otherwise, <a href="#select-a-style-sheet-set">select a style sheet set</a> with as name the
value passed.</li>
</ol>
<p>From the DOM's perspective, all views have the same
<code title="dom-Document-selectedStyleSheetSet"><a href="#dom-document-selectedStyleSheetSet">selectedStyleSheetSet</a></code>.
If a user agent supports multiple views with different selected
alternative style sheets, then this attribute (and the
<code><a href="#stylesheet">StyleSheet</a></code> interface's
<code title="dom-StyleSheet-disabled"><a href="#dom-stylesheet-disabled">disabled</a></code> attribute)
must return and set the value for the default
view.</p>
<!-- XXX clean up once we get rid of views -->
<p>The
<dfn id="dom-document-lastStyleSheetSet" title="dom-Document-lastStyleSheetSet"><code>lastStyleSheetSet</code></dfn>
attribute must return the
<a href="#last-style-sheet-set-name">last style sheet set name</a>.</p>
<p class="note">This attribute is initially null.</p>
<p>The
<dfn id="dom-document-preferredStyleSheetSet" title="dom-Document-preferredStyleSheetSet"><code>preferredStyleSheetSet</code></dfn>
attribute must return the
<a href="#preferred-style-sheet-set-name">preferred style sheet set name</a>.</p>
<p class="note">Unlike
<code title="dom-Document-lastStyleSheetSet"><a href="#dom-document-lastStyleSheetSet">lastStyleSheetSet</a></code>,
this attribute is initially the empty string.</p> <!-- XXX change? -->
<p>The
<dfn id="dom-document-styleSheetSets" title="dom-Document-styleSheetSets"><code>styleSheetSets</code></dfn>
attribute must return a list of the
<a href="#style-sheet-set-name" title="style sheet set name">style sheet set names</a> of the
<a href="#style-sheet-set" title="style sheet set">style sheet sets</a>, in order of the
<a href="#document-style-sheets">document style sheets</a>.</p>
<p>The
<dfn id="dom-document-enablestylesheetsforset" title="dom-Document-enableStyleSheetsForSet"><code>enableStyleSheetsForSet(<var title="">name</var>)</code></dfn>
method must, when invoked, run these steps:</p>
<ol>
<li><p>If <var title="">name</var> is null terminate these
steps.</li>
<li><p><a href="#enable-a-style-sheet-set">Enable a style sheet set</a> with name
<var title="">name</var>.</li>
</ol>
<p class="note"><a href="#style-sheet" title="Style sheet">Style sheets</a> with an
empty <a href="#style-sheet-title">style sheet title</a> are never affected by this method.
This method does not change the values of the
<code title="dom-Document-lastStyleSheetSet"><a href="#dom-document-lastStyleSheetSet">lastStyleSheetSet</a></code> or
<code title="dom-Document-preferredStyleSheetSet"><a href="#dom-document-preferredStyleSheetSet">preferredStyleSheetSet</a></code>
attributes.</p>
<h4 id="interaction-with-the-user-interface"><span class="secno">6.2.4 </span>Interaction with the User Interface</h4>
<p>The user interface of Web browsers that support style sheets
should list the style sheet titles given in the
<code title="dom-Document-styleSheetSets"><a href="#dom-document-styleSheetSets">styleSheetSets</a></code> list,
showing the
<code title="dom-Document-selectedStyleSheetSet"><a href="#dom-document-selectedStyleSheetSet">selectedStyleSheetSet</a></code>
as the selected style sheet set, leaving none selected if it is
null or the empty string, and selecting an extra option
"Basic Page Style" (or similar) if it is the empty string and the
<code title="dom-Document-preferredStyleSheetSet"><a href="#dom-document-preferredStyleSheetSet">preferredStyleSheetSet</a></code>
is the empty string as well.</p>
<p>Selecting a style sheet from this list should
use the <a href="#select-a-style-sheet-set">select a style sheet set</a> set of steps. This
(by definition) affects the
<code title="dom-Document-lastStyleSheetSet"><a href="#dom-document-lastStyleSheetSet">lastStyleSheetSet</a></code>
attribute.</p>
<h5 id="persisting-the-selected-style-sheet-set"><span class="secno">6.2.4.1 </span>Persisting the selected style sheet set</h5>
<p>If a user agent persist the selected style sheet set, they should use
the value of the
<code title="dom-Document-selectedStyleSheetSet"><a href="#dom-document-selectedStyleSheetSet">selectedStyleSheetSet</a></code>
attribute, or if that is null, the
<code title="dom-Document-lastStyleSheetSet"><a href="#dom-document-lastStyleSheetSet">lastStyleSheetSet</a></code>
attribute, when leaving the page (or at some other time) to determine the
set name to store. If that is null then the style sheet set should not be
persisted.</p>
<p>When re-setting the style sheet set to the persisted value (which can
happen at any time, typically at the first time the style sheets are
needed for styling the document, after the <code><head></code> of
the document has been parsed, after any scripts that are not dependent on
computed style have executed), the style sheet set
should be set by using the
<a href="#select-a-style-sheet-set">select a style sheet set</a> set of steps as if the user had
selected the set manually.</p>
<p class="note">This specification does not give any suggestions on
how user agents should decide to persist the style sheet set or whether or
how to persist the selected set across pages.</p>
<!-- XXX this UI section suggests we may want to introduce a few more
idioms -->
<h4 id="examples"><span class="secno">6.2.5 </span>Examples</h4>
<div class="example">
<p>Thus, in the following HTML snippet:</p>
<pre><link rel="alternate stylesheet" title="foo" href="a">
<link rel="alternate stylesheet" title="bar" href="b">
<script>
document.selectedStyleSheetSet = 'foo';
document.styleSheets[1].disabled = false;
</script>
<link rel="alternate stylesheet" title="foo" href="c">
<link rel="alternate stylesheet" title="bar" href="d"></pre>
<p>...the style sheets that end up enabled are style sheets "a", "b",
and "c", the
<code title="dom-Document-selectedStyleSheetSet"><a href="#dom-document-selectedStyleSheetSet">selectedStyleSheetSet</a></code>
attribute would return null,
<code title="dom-Document-lastStyleSheetSet"><a href="#dom-document-lastStyleSheetSet">lastStyleSheetSet</a></code>
would return "foo", and
<code title="dom-Document-preferredStyleSheetSet"><a href="#dom-document-preferredStyleSheetSet">preferredStyleSheetSet</a></code>
would return the empty string.</p>
<p>Similarly, in the following HTML snippet:</p>
<pre><link rel="alternate stylesheet" title="foo" href="a">
<link rel="alternate stylesheet" title="bar" href="b">
<script>
var before = document.preferredStyleSheetSet;
document.styleSheets[1].disabled = false;
</script>
<link rel="stylesheet" title="foo" href="c">
<link rel="alternate stylesheet" title="bar" href="d">
<script>
var after = document.preferredStyleSheetSet;
</script></pre>
<p>...the "before" variable will be equal to the empty string, the
"after" variable will be equal to "foo", and style sheets "a" and "c"
will be enabled. This is the case even though the first script block
sets style sheet "b" to be enabled, because upon parsing the
following <code><link></code> element, the
<code title="dom-Document-preferredStyleSheetSet"><a href="#dom-document-preferredStyleSheetSet">preferredStyleSheetSet</a></code>
is set and the
<code title="dom-Document-enableStyleSheetsForSet"><a href="#dom-document-enablestylesheetsforset">enableStyleSheetsForSet()</a></code>
method is called (since
<code title="dom-Document-selectedStyleSheetSet"><a href="#dom-document-selectedStyleSheetSet">selectedStyleSheetSet</a></code>
was never set
explicitly, leaving
<code title="dom-Document-lastStyleSheetSet"><a href="#dom-document-lastStyleSheetSet">lastStyleSheetSet</a></code> at
null throughout), which changes which style sheets are enabled and which
are not.</p>
</div>
<h3 id="style-sheet-association"><span class="secno">6.3 </span>Style Sheet Association</h3>
<p>This section defines the interface a
<a href="#style-sheet-owner-node">style sheet owner node</a> of a <a href="#style-sheet">style sheet</a> has to
implement and defines the requirements for
<a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-xml-stylesheet" title="xml-stylesheet processing instruction">xml-stylesheet processing instructions</a>
and HTTP <code title="http-link">Link</code> headers when the link
relation type is an
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for
"<code title="">stylesheet</code>" since nobody else was interested in
defining this.</p>
<p class="note">The editor is in good hope that HTML and SVG will define the
appropriate processing in their respective specifications, in terms of
this specification, in due course.</p>
<h4 id="the-linkstyle-interface"><span class="secno">6.3.1 </span>The <code title="">LinkStyle</code> Interface</h4>
<p>The <dfn id="associated-style-sheet">associated style sheet</dfn> of a
node is the <a href="#style-sheet">style sheet</a> in the list of
<a href="#document-style-sheets">document style sheets</a> of which the
<a href="#style-sheet-owner-node">style sheet owner node</a>
implements the <code><a href="#linkstyle">LinkStyle</a></code> interface.</p>
<pre class="idl">[NoInterfaceObject] interface <dfn id="linkstyle">LinkStyle</dfn> {
readonly attribute <a href="#stylesheet">StyleSheet</a> <a href="#dom-linkstyle-sheet" title="dom-linkstyle-sheet">sheet</a>;
};</pre>
<p>The <dfn id="dom-linkstyle-sheet" title="dom-LinkStyle-sheet"><code>sheet</code></dfn> attribute
must return the <a href="#associated-style-sheet">associated style sheet</a> for the node, or null,
if there is no <a href="#associated-style-sheet">associated style sheet</a>.</p>
<div class="example">
<p>In the following HTML snippet the first HTML <code>style</code>
element has a <code>sheet</code> attribute that returns a
<code><a href="#stylesheet">StyleSheet</a></code> object representing the style sheet, but for
the second <code>style</code> attribute it returns null.
(Assuming the user agent supports CSS (<code>text/css</code>) and does
not support ExampleSheets (<code>text/example-sheets</code>).</p>
<pre><style type=text/css> body { background:lime } </style>
<style type=text/example-sheets> $(body).background := lime </style></pre>
</div>
<p class="note">Whether or not the node refers to a style sheet is defined
by the specification that defines the semantics of said node.</p>
<h4 id="requirements-on-specifications"><span class="secno">6.3.2 </span>Requirements on specifications</h4>
<p>Specifications introducing new ways of associating style sheets through
the DOM should define which nodes implement the
<code><a href="#linkstyle">LinkStyle</a></code> interface. When doing so, they
must also define when a <a href="#style-sheet">style sheet</a> is
<a href="#create-a-style-sheet" title="create a style sheet">created</a>.</p>
<h4 id="requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction"><span class="secno">6.3.3 </span>Requirements on User Agents Implementing the
<span title=""><code>xml-stylesheet</code> processing instruction</span></h4>
<!-- XXX load/error events, reparse -->
<pre class="idl"><a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#processinginstruction">ProcessingInstruction</a> implements <a href="#linkstyle">LinkStyle</a>;</pre>
<p>For each
<a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-xml-stylesheet"><code>xml-stylesheet</code> processing instruction</a>
that is not part of the
<a class="external" href="http://www.w3.org/TR/xml/#dt-doctype">document type declaration</a> and has an
<code title="">href</code>
<a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a> these steps must
(unless otherwise stated) be run:</p>
<ol>
<li><p>Let <var title="">title</var> be the value of the
<code title="">title</code> <a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a> or the empty string if the
<code title="">title</code> <a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a> is not specified.</li>
<li><p>If there is an <code title="">alternate</code> <a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a>
whose value is a <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#case-sensitive">case-sensitive</a> match
for "<code title="">yes</code>" and <var title="">title</var> is the
empty string terminate these steps.</li>
<li><p>If there is a <code title="">type</code> <a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a> whose
value is not a <a href="#supported-styling-language">supported styling language</a> the user agent
may terminate these steps.</li>
<li><p><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#resolve-a-url" title="Resolve a URL">Resolve</a>
the <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#url">URL</a> specified by the
<code title="">href</code> <a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a> and then
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#fetch">fetch</a> it.</li>
<li>
<p>When the resource is available, the document is in
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-quirks-mode" title="concept-quirks-mode">quirks mode</a>
and the
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#content-type">Content-Type metadata</a> of
the resource is not a <a href="#supported-styling-language">supported styling language</a> change the
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#content-type">Content-Type metadata</a> of the resource
to <code title="">text/css</code>.</p>
<p class="note">This step might never actually happen, but is included
here in case other specifications change, to keep things consistent.</p>
</li>
<li><p>If the resource is not in a
<a href="#supported-styling-language">supported styling language</a> terminate these steps.</li>
<li>
<p><a href="#create-a-style-sheet">Create a style sheet</a> with the following properties:</p>
<dl>
<dt><a href="#style-sheet-location">style sheet location</a></dt>
<dd><p>The <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#absolute-url">absolute URL</a> of the
resource.</dd>
<dt><a href="#style-sheet-parent">style sheet parent</a></dt>
<dd><p>null</dd>
<dt><a href="#style-sheet-owner-node">style sheet owner node</a></dt>
<dd><p>The node.</dd>
<dt><a href="#style-sheet-owner-css-rule">style sheet owner CSS rule</a></dt>
<dd><p>null</dd>
<dt><a href="#style-sheet-media">style sheet media</a></dt>
<dd><p>The value of the <code title="">media</code> <a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a>
if any, or the empty string otherwise.</dd>
<dt><a href="#style-sheet-title">style sheet title</a></dt>
<dd><p><var title="">title</var></dd>
<dt><a href="#style-sheet-alternate-flag">style sheet alternate flag</a></dt>
<dd><p>True if the <code title="">alternate</code> <a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a>
value is a <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#case-sensitive">case-sensitive</a> match for
"<code>yes</code>", and false otherwise.</dd>
</dl>
</li>
</ol>
<h4 id="requirements-on-user-agents-implementing-the-http-link-header"><span class="secno">6.3.4 </span>Requirements on User Agents Implementing the HTTP
<code title="">Link</code> Header</h4>
<!-- XXX ref, one day -->
<!-- XXX deal with media param -->
<p>For each HTTP <code title="http-link">Link</code> header of which one
of the link relation types is an
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match
for "<code title="">stylesheet</code>" these steps
must be run:</p>
<ol>
<li><p>Let <var title="">title</var> be the value of the first of all the
<code title="">title</code> and <code title="">title*</code> parameters.
If there are no such parameters it is the empty string.</li>
<li><p>If one of the (other) link relation types is an
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for
"<code title="">alternate</code>" and <var title="">title</var> is the
empty string terminate these steps.</li>
<li><p><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#resolve-a-url" title="Resolve a URL">Resolve</a>
the specified <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#url">URL</a> and
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#fetch">fetch</a> it.</li>
<li><p>When the resource is available, the document is in
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-quirks-mode" title="concept-quirks-mode">quirks mode</a>
and the <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#content-type">Content-Type metadata</a> of
the resource is not a <a href="#supported-styling-language">supported styling language</a> change the
<a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#content-type">Content-Type metadata</a> of the resource
to <code title="">text/css</code>.</li>
<li><p>If the resource is not in a
<a href="#supported-styling-language">supported styling language</a> terminate these steps.</li>
<li>
<p><a href="#create-a-style-sheet">Create a style sheet</a> with the following properties:</p>
<dl>
<dt><a href="#style-sheet-location">style sheet location</a></dt>
<dd><p>The <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#absolute-url">absolute URL</a> of the
resource.</dd>
<dt><a href="#style-sheet-owner-node">style sheet owner node</a></dt>
<dd><p>null</dd>
<dt><a href="#style-sheet-parent">style sheet parent</a></dt>
<dd><p>null</dd>
<dt><a href="#style-sheet-owner-node">style sheet owner node</a></dt>
<dd><p>null</dd>
<dt><a href="#style-sheet-owner-css-rule">style sheet owner CSS rule</a></dt>
<dd><p>null</dd>
<dt><a href="#style-sheet-media">style sheet media</a></dt>
<dd><p>The value of the first <code title="">media</code> parameter.</dd>
<!-- XXX register media parameter? bah -->
<dt><a href="#style-sheet-title">style sheet title</a></dt>
<dd><p><var title="">title</var></dd>
<dt><a href="#style-sheet-alternate-flag">style sheet alternate flag</a></dt>
<dd><p>True if one of the specified link relation type for this HTTP
<code title="http-link">Link</code> header is an
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for
"<code title="">alternate</code>". Otherwise, false.</dd>
</dl>
</li>
</ol>
<h3 id="css-rules"><span class="secno">6.4 </span>CSS Rules</h3>
<p>To <dfn id="parse-a-css-rule">parse a CSS rule</dfn> ...</p>
<p>To <dfn id="serialize-a-css-rule">serialize a CSS rule</dfn> depends on the type of CSS rule, as
follows:</p>
<dl class="switch">
<dt><code><a href="#cssstylerule">CSSStyleRule</a></code></dt>
<dd class="XXX">...</dd>
<dt><code><a href="#cssimportrule">CSSImportRule</a></code></dt>
<dd>
<p>The result of concatenating these strings:</p>
<ol>
<li>The literal string "<code>@import</code>", followed by a space
(U+0020), followed by the <a href="#serialize-a-url" title="serialize a URL">URL escaped</a>
value of the <code title="dom-CSSImportRule-href"><a href="#dom-cssimportrule-href">href</a></code>
attribute.</li>
<li>If the associated <code><a href="#medialist">MediaList</a></code> object is not empty, a
space (U+0020), followed by the value of the
<code title="dom-MediaList-mediaText"><a href="#dom-medialist-mediatext">mediaText</a></code> attribute of the
associated <code><a href="#medialist">MediaList</a></code> object.</li>
<li>A "<code>;</code>" (U+003B).</li>
</ol>
</dd>
<dt><code><a href="#cssmediarule">CSSMediaRule</a></code></dt>
<dd class="XXX">...</dd>
<dt><code><a href="#cssfontfacerule">CSSFontFaceRule</a></code></dt>
<dd class="XXX">...</dd>
<dt><code><a href="#csspagerule">CSSPageRule</a></code></dt>
<dd class="XXX">...</dd>
<dt><code><a href="#cssnamespacerule">CSSNamespaceRule</a></code></dt>
<dd><p>The literal string "<code>@namespace</code>", followed by a space
(U+0020), followed by the
<a href="#serialize-an-identifier" title="serialize an identifier">identifier escaped</a> value of the
<code title="dom-CSSNamespaceRule-prefix"><a href="#dom-cssnamespacerule-prefix">prefix</a></code> attribute (if
any), followed by a space (U+0020) if there is a prefix, followed by the
<a href="#serialize-a-url" title="serialize a URL">URL escaped</a> value of the
<code title="dom-CSSNamespaceRule-namespaceURI"><a href="#dom-cssnamespacerule-namespaceuri">namespaceURI</a></code>
attribute, followed the character "<code>;</code>" (U+003B).</dd>
</dl>
<p>To <dfn id="insert-a-css-rule">insert a CSS rule</dfn> <var title="">rule</var> into a
CSS rule list <var title="">list</var> at location
<var title="">index</var> follow these steps:</p>
<ol>
<li><p>If <var title="">index</var> is negative or greater than the
length of the <var title="">list</var> raise an
<code>INDEX_SIZE_ERR</code> exception and terminate these steps.</li>
<li><p><a href="#parse-a-css-rule" title="Parse a CSS rule">Parse</a>
<var title="">rule</var>.</li>
<li><p>If parsing failed terminate these steps.</li>
<li><p>If the new object can not be inserted within the
<var title="">list</var> at the given <var title="">index</var> due to
limitations of the CSS specification raise a
<code>HIERARCHY_REQUEST_ERR</code> exception and terminate these
steps.</li>
<li><p>Insert the new object at the given <var title="">index</var>
within the <var title="">list</var>.</li>
</ol>
<p>To <dfn id="remove-a-css-rule">remove a CSS rule</dfn> from CSS rule list
<var title="">list</var> at location <var title="">index</var> follow
these steps:</p>
<ol>
<li><p>If <var title="">index</var> is negative or greater than the
length of the <var title="">list</var> raise an
<code>INDEX_SIZE_ERR</code> exception and terminate these steps.</li>
<li><p>Remove the object at <var title="">index</var> from
<var title="">list</var>.</li>
</ol>
<h4 id="the-cssrulelist-sequence"><span class="secno">6.4.1 </span>The <code title="">CSSRuleList</code> Sequence</h4>
<p>The <code><a href="#cssrulelist">CSSRuleList</a></code> object represents an ordered collection of
CSS rules.</p>
<pre class="idl">typedef sequence<<a href="#cssrule">CSSRule</a>> <dfn id="cssrulelist">CSSRuleList</dfn>;</pre>
<h4 id="the-cssrule-interface"><span class="secno">6.4.2 </span>The <code title="">CSSRule</code> Interface</h4>
<p>The <code><a href="#cssrule">CSSRule</a></code> interface is a base interface. Each unique
CSS rule has its own interface which inherits from this one.</p>
<!-- http://wiki.csswg.org/spec/cssom-constants -->
<pre class="idl">interface <dfn id="cssrule">CSSRule</dfn> {
// Types
const unsigned short <a href="#dom-cssrule-style_rule" title="dom-CSSRule-STYLE_RULE">STYLE_RULE</a> = 1;
const unsigned short <a href="#dom-cssrule-import_rule" title="dom-CSSRule-IMPORT_RULE">IMPORT_RULE</a> = 3;
const unsigned short <a href="#dom-cssrule-media_rule" title="dom-CSSRule-MEDIA_RULE">MEDIA_RULE</a> = 4;
const unsigned short <a href="#dom-cssrule-font_face_rule" title="dom-CSSRule-FONT_FACE_RULE">FONT_FACE_RULE</a> = 5;
const unsigned short <a href="#dom-cssrule-page_rule" title="dom-CSSRule-PAGE_RULE">PAGE_RULE</a> = 6;
const unsigned short <a href="#dom-cssrule-namespace_rule" title="dom-CSSRule-NAMESPACE_RULE">NAMESPACE_RULE</a> = 10;
readonly attribute unsigned short <a href="#dom-cssrule-type" title="dom-CSSRule-type">type</a>;
// Parsing and serialization
attribute DOMString <a href="#dom-cssrule-csstext" title="dom-CSSRule-cssText">cssText</a>;
// Context
readonly attribute <a href="#cssrule">CSSRule</a> <a href="#dom-cssrule-parentrule" title="dom-CSSRule-parentRule">parentRule</a>;
readonly attribute <a href="#cssstylesheet">CSSStyleSheet</a> <a href="#dom-cssrule-parentstylesheet" title="dom-CSSRule-parentStyleSheet">parentStyleSheet</a>;
};</pre>
<p>The
<dfn id="dom-cssrule-type" title="dom-CSSRule-type"><code>type</code></dfn>
attribute must return the <span>CSS rule</span> type,
as follows:</p>
<dl class="switch">
<dt><dfn id="dom-cssrule-style_rule" title="dom-CSSRule-STYLE_RULE"><code>STYLE_RULE</code></dfn> (numeric value 1)</dt>
<dd>The object is a <code><a href="#cssstylerule">CSSStyleRule</a></code>.</dd>
<dt><dfn id="dom-cssrule-import_rule" title="dom-CSSRule-IMPORT_RULE"><code>IMPORT_RULE</code></dfn> (numeric value 3)</dt>
<dd>The object is a <code><a href="#cssimportrule">CSSImportRule</a></code>.</dd>
<dt><dfn id="dom-cssrule-media_rule" title="dom-CSSRule-MEDIA_RULE"><code>MEDIA_RULE</code></dfn> (numeric value 4)</dt>
<dd>The object is a <code><a href="#cssmediarule">CSSMediaRule</a></code>.</dd>
<dt><dfn id="dom-cssrule-font_face_rule" title="dom-CSSRule-FONT_FACE_RULE"><code>FONT_FACE_RULE</code></dfn> (numeric value 5)</dt>
<dd>The object is a <code><a href="#cssfontfacerule">CSSFontFaceRule</a></code>.</dd>
<dt><dfn id="dom-cssrule-page_rule" title="dom-CSSRule-PAGE_RULE"><code>PAGE_RULE</code></dfn> (numeric value 6)</dt>
<dd>The object is a <code><a href="#csspagerule">CSSPageRule</a></code>.</dd>
<dt><dfn id="dom-cssrule-namespace_rule" title="dom-CSSRule-NAMESPACE_RULE"><code>NAMESPACE_RULE</code></dfn> (numeric value 10)</dt>
<dd>The object is a <code><a href="#cssnamespacerule">CSSNamespaceRule</a></code>.</dd>
</dl>
<p class="note">Constants with values 0 and 2 have been obsoleted by this
specification. They might be re-allocated in the future. 7 is reserved for
<code>@color-profile</code>. 8 and 9 are reserved for CSS animation.</p>
<p>The
<dfn id="dom-cssrule-csstext" title="dom-CSSRule-cssText"><code>cssText</code></dfn>
attribute, on getting, must return a
<a href="#serialize-a-css-rule" title="serialize a CSS rule">serialization</a> of the
<span>CSS rule</span>.</p>
<p>On setting the <code title="dom-CSSRule-cssText"><a href="#dom-cssrule-csstext">cssText</a></code>
attribute these steps must be run:</p>
<ol>
<li><p><a href="#parse-a-css-rule" title="Parse a CSS rule">Parse</a> the value.</li>
<li><p>If parsing failed terminate this algorithm.</li>
<li><p>If the <code title="dom-CSSRule-type"><a href="#dom-cssrule-type">type</a></code> of the new
object does not match the <code title="dom-CSSRule-type"><a href="#dom-cssrule-type">type</a></code> of
the current object raise an <code>INVALID_MODIFICATION_ERR</code>
exception.</li>
<li><p>Replace the current object with the new object.</li>
</ol>
<p>The
<dfn id="dom-cssrule-parentrule" title="dom-CSSRule-parentRule"><code>parentRule</code></dfn>
attribute must return the nearest enclosing rule of the
current rule or null, if there is no enclosing rule.</p>
<p class="note">E.g. <code title="">@media</code> can enclose a rule.</p>
<p>The
<dfn id="dom-cssrule-parentstylesheet" title="dom-CSSRule-parentStyleSheet"><code>parentStyleSheet</code></dfn>
attribute must return the <code><a href="#cssstylesheet">CSSStyleSheet</a></code>
object that contains the the current rule.</p>
<h5 id="extensibility"><span class="secno">6.4.2.1 </span>Extensibility</h5>
<p>The constant values 0-1000 are reserved for future use by the CSS WG.</p>
<p>Vendors are encouraged to use reasonably unique values outside this range
so that they do not clash with extensions from other vendors. For example, the
first value for Mozilla could be <code>0x0<strong>8EC0</strong>001</code> and
<code>0x<strong>09E8A</strong>001</code> could be the first for Opera.</p>
<p>Vendors are encouraged to prefix the new interface names with a vendor
specific prefix. For example, "Example company" could have an interface called
"ExampleCSSTestRule".</p>
<p>In general, vendors are encouraged to discuss extensions on a public forum,
such as <code>www-style@w3.org</code>.</p>
<h4 id="css-style-rule-rule-set"><span class="secno">6.4.3 </span>CSS Style Rule (Rule Set)</h4>
<p>The <code><a href="#cssstylerule">CSSStyleRule</a></code> object represents a rule set.</p>
<!-- XXX ref -->
<pre class="idl">interface <dfn id="cssstylerule">CSSStyleRule</dfn> : <a href="#cssrule">CSSRule</a> {
attribute DOMString <a href="#dom-cssstylerule-selectortext" title="dom-CSSStyleRule-selectorText">selectorText</a>;
readonly attribute <a href="#cssstyledeclaration">CSSStyleDeclaration</a> <a href="#dom-cssstylerule-style" title="dom-CSSStyleRule-style">style</a>;
};</pre>
<p>The
<dfn id="dom-cssstylerule-selectortext" title="dom-CSSStyleRule-selectorText"><code>selectorText</code></dfn>
attribute, on getting, must return the result of
<a href="#serialize-a-group-of-selectors" title="serialize a group of selectors">serializing</a> the
associated <span>group of selectors</span>.</p>
<p>On setting the
<code title="dom-CSSStyleRule-selectorText"><a href="#dom-cssstylerule-selectortext">selectorText</a></code> attribute
these steps must be run:</p>
<ol>
<li><p>Run the <a href="#parse-a-group-of-selectors">parse a group of selectors</a> algorithm on the
given value.</li>
<li><p>If the algorithm returns a non-null value replace the associated
<span>group of selectors</span> with the returned value.</li>
<li><p>Otherwise, if the algorithm returns a null value, do
nothing.</li>
</ol>
<p>The
<dfn id="dom-cssstylerule-style" title="dom-CSSStyleRule-style"><code>style</code></dfn>
attribute must return a
<code><a href="#cssstyledeclaration">CSSStyleDeclaration</a></code> object for the rule set.</p>
<h4 id="css-import-rule"><span class="secno">6.4.4 </span>CSS <code title="">@import</code> Rule</h4>
<p>The <code><a href="#cssimportrule">CSSImportRule</a></code> object represents an
<code>@import</code> rule.</p>
<pre class="idl">interface <dfn id="cssimportrule">CSSImportRule</dfn> : <a href="#cssrule">CSSRule</a> {
readonly attribute DOMString <a href="#dom-cssimportrule-href" title="dom-CSSImportRule-href">href</a>;
[PutForwards=<a href="#dom-medialist-mediatext" title="dom-MediaList-mediaText">mediaText</a>] readonly attribute <a href="#medialist">MediaList</a> <a href="#dom-cssimportrule-media" title="dom-CSSImportRule-media">media</a>;
readonly attribute <a href="#cssstylesheet">CSSStyleSheet</a> <a href="#dom-cssimportrule-stylesheet" title="dom-CSSImportRule-styleSheet">styleSheet</a>;
};</pre>
<p>The
<dfn id="dom-cssimportrule-href" title="dom-CSSImportRule-href"><code>href</code></dfn>
attribute must return the <span>URL</span> specified
by the <code>@import</code> rule.</p>
<p class="note">To get the resolved <span>URL</span> use the
<code title="dom-StyleSheet-href"><a href="#dom-stylesheet-href">href</a></code> attribute of the associated
<a href="#style-sheet">style sheet</a>.</p>
<p>The
<dfn id="dom-cssimportrule-media" title="dom-CSSImportRule-media"><code>media</code></dfn>
attribute must return the value of the
<code title="dom-StyleSheet-media"><a href="#dom-stylesheet-media">media</a></code> attribute of the
associated <a href="#style-sheet">style sheet</a>.</p>
<p>The
<dfn id="dom-cssimportrule-stylesheet" title="dom-CSSImportRule-stylesheet"><code>styleSheet</code></dfn>
attribute must return the associated
<a href="#style-sheet">style sheet</a>.</p>
<p class="note">If loading of the style sheet fails its
<code title="dom-CSSStyleSheet-cssRules"><a href="#dom-cssstylesheet-cssrules">cssRules</a></code> list is simply
empty. I.e. an <code>@import</code> rule always has an associated
<a href="#style-sheet">style sheet</a>.</p>
<h4 id="css-media-rule"><span class="secno">6.4.5 </span>CSS <code title="">@media</code> Rule</h4>
<p>The <code><a href="#cssmediarule">CSSMediaRule</a></code> object represents an
<code title="">@media</code> rule.</p>
<pre class="idl">interface <dfn id="cssmediarule">CSSMediaRule</dfn> : <a href="#cssrule">CSSRule</a> {
[PutForwards=<a href="#dom-medialist-mediatext" title="dom-MediaList-mediaText">mediaText</a>] readonly attribute <a href="#medialist">MediaList</a> <a href="#dom-cssmediarule-media" title="dom-CSSMediaRule-media">media</a>;
readonly attribute <a href="#cssrulelist">CSSRuleList</a> <a href="#dom-cssmediarule-cssrules" title="dom-CSSMediaRule-cssRules">cssRules</a>;
unsigned long <a href="#dom-cssmediarule-insertrule" title="dom-CSSMediaRule-insertRule">insertRule</a>(DOMString <var title="">rule</var>, in unsigned long <var title="">index</var>);
void <a href="#dom-cssmediarule-deleterule" title="dom-CSSMediaRule-deleteRule">deleteRule</a>(unsigned long <var title="">index</var>);
};</pre>
<p>The
<dfn id="dom-cssmediarule-media" title="dom-CSSMediaRule-media"><code>media</code></dfn>
attribute must return a
<code><a href="#medialist">MediaList</a></code> object for the list of media queries specified
with the <code title="">@media</code> rule.</p>
<p>The
<dfn id="dom-cssmediarule-cssrules" title="dom-CSSMediaRule-cssRules"><code>cssRules</code></dfn>
attribute must return a
<code><a href="#cssrulelist">CSSRuleList</a></code> object for the list of CSS rules specified with the
<code title="">@media</code> rule.</p>
<p>The
<dfn id="dom-cssmediarule-insertrule" title="dom-CSSMediaRule-insertRule"><code>insertRule(<var title="">rule</var>,
<var title="">index</var>)</code></dfn> method must
<a href="#insert-a-css-rule">insert a CSS rule</a> <var title="">rule</var> into the
CSS rule list returned by
<code title="dom-CSSMediaRule-cssRules"><a href="#dom-cssmediarule-cssrules">cssRules</a></code> at
<var title="">index</var>.</p>
<p>The
<dfn id="dom-cssmediarule-deleterule" title="dom-CSSMediaRule-deleteRule"><code>deleteRule(<var title="">index</var>)</code></dfn>
method must <a href="#remove-a-css-rule">remove a CSS rule</a> from the
CSS rule list returned by
<code title="dom-CSSMediaRule-cssRules"><a href="#dom-cssmediarule-cssrules">cssRules</a></code> at
<var title="">index</var>.</p>
<h4 id="css-font-face-rule"><span class="secno">6.4.6 </span>CSS <code title="">@font-face</code> Rule</h4>
<p>The <code><a href="#cssfontfacerule">CSSFontFaceRule</a></code> object represents an
<code>@font-face</code> rule.</p>
<pre class="idl">interface <dfn id="cssfontfacerule">CSSFontFaceRule</dfn> : <a href="#cssrule">CSSRule</a> {
readonly attribute <a href="#cssstyledeclaration">CSSStyleDeclaration</a> <a href="#dom-cssfontfacerule-style" title="dom-CSSFontFaceRule-style">style</a>;
};</pre>
<p>The
<dfn id="dom-cssfontfacerule-style" title="dom-CSSFontFaceRule-style"><code>style</code></dfn>
attribute must return a <code><a href="#cssstyledeclaration">CSSStyleDeclaration</a></code>
block that contains the property declarations specified within the
<code>@font-face</code> rule.</p>
<h4 id="css-page-rule"><span class="secno">6.4.7 </span>CSS <code title="">@page</code> Rule</h4>
<p class="XXX">Need to define the rules for
<dfn id="parse-a-css-page-selector">parse a CSS page selector</dfn> and
<dfn id="serialize-a-css-page-selector">serialize a CSS page selector</dfn>.</p>
<p>The <code><a href="#csspagerule">CSSPageRule</a></code> object represents an <code>@page</code>
rule.</p>
<pre class="idl">interface <dfn id="csspagerule">CSSPageRule</dfn> : <a href="#cssrule">CSSRule</a> {
attribute DOMString <a href="#dom-csspagerule-selectortext" title="dom-CSSPageRule-selectorText">selectorText</a>;
readonly attribute <a href="#cssstyledeclaration">CSSStyleDeclaration</a> <a href="#dom-csspagerule-style" title="dom-CSSPageRule-style">style</a>;
};</pre>
<p>The
<dfn id="dom-csspagerule-selectortext" title="dom-CSSPageRule-selectorText"><code>selectorText</code></dfn>
attribute, on getting, must return the result of
<a href="#serialize-a-css-page-selector" title="serialize a CSS page selector">serializing</a> the
associated <span>CSS page selector</span>.</p>
<p>On setting the
<code title="dom-CSSPageRule-selectorText"><a href="#dom-csspagerule-selectortext">selectorText</a></code> attribute
these steps must be run:</p>
<ol>
<li><p>Run the <a href="#parse-a-css-page-selector">parse a CSS page selector</a> algorithm on the
given value.</li>
<li><p>If the algorithm returns a non-null value replace the associated
<span>CSS page selector</span> with the returned value.</li>
<li><p>Otherwise, if the algorithm returns a null value, do
nothing.</li>
</ol>
<p>The
<dfn id="dom-csspagerule-style" title="dom-CSSPageRule-style"><code>style</code></dfn>
attribute must return a
<code><a href="#cssstyledeclaration">CSSStyleDeclaration</a></code> for the <code>@page</code> rule.</p>
<h4 id="css-namespace-rule"><span class="secno">6.4.8 </span>CSS <code title="">@namespace</code> Rule</h4>
<p>The <code><a href="#cssnamespacerule">CSSNamespaceRule</a></code> object represents an
<code>@namespace</code> rule.</p>
<pre class="idl">interface <dfn id="cssnamespacerule">CSSNamespaceRule</dfn> : <a href="#cssrule">CSSRule</a> {
readonly attribute DOMString <a href="#dom-cssnamespacerule-namespaceuri" title="dom-CSSNamespaceRule-namespaceURI">namespaceURI</a>;
readonly attribute DOMString? <a href="#dom-cssnamespacerule-prefix" title="dom-CSSNamespaceRule-prefix">prefix</a>;
};</pre>
<p>The
<dfn id="dom-cssnamespacerule-namespaceuri" title="dom-CSSNamespaceRule-namespaceURI"><code>namespaceURI</code></dfn>
attribute must return the namespace of
the <code>@namespace</code> rule.</p>
<p>The
<dfn id="dom-cssnamespacerule-prefix" title="dom-CSSNamespaceRule-prefix"><code>prefix</code></dfn>
attribute must return the prefix of the
<code>@namespace</code> rule or the empty string if there is no prefix.</p>
<h3 id="css-declaration-blocks"><span class="secno">6.5 </span>CSS Declaration Blocks</h3>
<p>A <dfn id="css-declaration-block">CSS declaration block</dfn> is an ordered collection of CSS
properties with their associated values, also named CSS declarations. In
the DOM a <a href="#css-declaration-block">CSS declaration block</a> is a
<code><a href="#cssstyledeclaration">CSSStyleDeclaration</a></code> object. A
<a href="#css-declaration-block">CSS declaration block</a> has two associated properties:</p>
<dl>
<dt><dfn id="css-declaration-block-readonly-flag">CSS declaration block readonly flag</dfn></dt>
<dd><p>False if the object can be manipulated. True if it can not be
manipulated. If not explicitly set its value is false.</dd>
<dt><dfn id="css-declaration-block-declarations">CSS declaration block declarations</dfn></dt>
<dd><p>The CSS declarations associated with the object.</dd>
</dl>
<p class="note">The <a href="#css-declaration-block-declarations">CSS declaration block declarations</a> are
ordered. This matters for the
<code title="dom-CSSStyleDeclaration-item"><a href="#dom-cssstyledeclaration-item">item()</a></code> method.</p>
<p class="XXX">To
<dfn id="parse-a-css-declaration-block">parse a CSS declaration block</dfn>
...</p>
<p class="XXX">To
<dfn id="serialize-a-css-declaration-block">serialize a CSS declaration block</dfn>
...</p>
<h4 id="the-cssstyledeclaration-interface"><span class="secno">6.5.1 </span>The <code title="">CSSStyleDeclaration</code> Interface</h4>
<!-- XXX review nullable DOMString more carefully (DOMString?) -->
<pre class="idl">interface <dfn id="cssstyledeclaration">CSSStyleDeclaration</dfn> {
attribute DOMString <a href="#dom-cssstyledeclaration-csstext" title="dom-CSSStyleDeclaration-cssText">cssText</a>;
readonly attribute unsigned long <a href="#dom-cssstyledeclaration-length" title="dom-CSSStyleDeclaration-length">length</a>;
DOMString <a href="#dom-cssstyledeclaration-item" title="dom-CSSStyleDeclaration-item">item</a>(unsigned long <var title="">index</var>);
DOMString <a href="#dom-cssstyledeclaration-getpropertyvalue" title="dom-CSSStyleDeclaration-getPropertyValue">getPropertyValue</a>(DOMString <var title="">property</var>);
DOMString <a href="#dom-cssstyledeclaration-getpropertypriority" title="dom-CSSStyleDeclaration-getPropertyPriority">getPropertyPriority</a>(DOMString <var title="">property</var>);
void <a href="#dom-cssstyledeclaration-setproperty" title="dom-CSSStyleDeclaration-setProperty">setProperty</a>(DOMString? <var title="">property</var>, DOMString? <var title="">value</var>);
void <a href="#dom-cssstyledeclaration-setproperty" title="dom-CSSStyleDeclaration-setProperty">setProperty</a>(DOMString? <var title="">property</var>, DOMString? <var title="">value</var>, DOMString? <var title="">priority</var>);
DOMString <a href="#dom-cssstyledeclaration-removeproperty" title="dom-CSSStyleDeclaration-removeProperty">removeProperty</a>(DOMString <var title="">property</var>);
readonly attribute <a href="#cssstyledeclarationvalue">CSSStyleDeclarationValue</a> <a href="#dom-cssstyledeclaration-values" title="dom-CSSStyleDeclaration-values">values</a>;
readonly attribute <a href="#cssrule">CSSRule</a> <a href="#dom-cssstyledeclaration-parentrule" title="dom-CSSStyleDeclaration-parentRule">parentRule</a>;
// CSS Properties
attribute DOMString? <a href="#dom-cssstyledeclaration-azimuth" title="dom-CSSStyleDeclaration-azimuth">azimuth</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-background" title="dom-CSSStyleDeclaration-background">background</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-backgroundattachment" title="dom-CSSStyleDeclaration-backgroundAttachment">backgroundAttachment</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-backgroundcolor" title="dom-CSSStyleDeclaration-backgroundColor">backgroundColor</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-backgroundimage" title="dom-CSSStyleDeclaration-backgroundImage">backgroundImage</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-backgroundposition" title="dom-CSSStyleDeclaration-backgroundPosition">backgroundPosition</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-backgroundrepeat" title="dom-CSSStyleDeclaration-backgroundRepeat">backgroundRepeat</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-border" title="dom-CSSStyleDeclaration-border">border</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-bordercollapse" title="dom-CSSStyleDeclaration-borderCollapse">borderCollapse</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-bordercolor" title="dom-CSSStyleDeclaration-borderColor">borderColor</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderspacing" title="dom-CSSStyleDeclaration-borderSpacing">borderSpacing</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderstyle" title="dom-CSSStyleDeclaration-borderStyle">borderStyle</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-bordertop" title="dom-CSSStyleDeclaration-borderTop">borderTop</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderright" title="dom-CSSStyleDeclaration-borderRight">borderRight</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderbottom" title="dom-CSSStyleDeclaration-borderBottom">borderBottom</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderleft" title="dom-CSSStyleDeclaration-borderLeft">borderLeft</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-bordertopcolor" title="dom-CSSStyleDeclaration-borderTopColor">borderTopColor</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderrightcolor" title="dom-CSSStyleDeclaration-borderRightColor">borderRightColor</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderbottomcolor" title="dom-CSSStyleDeclaration-borderBottomColor">borderBottomColor</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderleftcolor" title="dom-CSSStyleDeclaration-borderLeftColor">borderLeftColor</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-bordertopstyle" title="dom-CSSStyleDeclaration-borderTopStyle">borderTopStyle</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderrightstyle" title="dom-CSSStyleDeclaration-borderRightStyle">borderRightStyle</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderbottomstyle" title="dom-CSSStyleDeclaration-borderBottomStyle">borderBottomStyle</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderleftstyle" title="dom-CSSStyleDeclaration-borderLeftStyle">borderLeftStyle</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-bordertopwidth" title="dom-CSSStyleDeclaration-borderTopWidth">borderTopWidth</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderrightwidth" title="dom-CSSStyleDeclaration-borderRightWidth">borderRightWidth</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderbottomwidth" title="dom-CSSStyleDeclaration-borderBottomWidth">borderBottomWidth</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderleftwidth" title="dom-CSSStyleDeclaration-borderLeftWidth">borderLeftWidth</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-borderwidth" title="dom-CSSStyleDeclaration-borderWidth">borderWidth</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-bottom" title="dom-CSSStyleDeclaration-bottom">bottom</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-captionside" title="dom-CSSStyleDeclaration-captionSide">captionSide</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-clear" title="dom-CSSStyleDeclaration-clear">clear</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-clip" title="dom-CSSStyleDeclaration-clip">clip</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-color" title="dom-CSSStyleDeclaration-color">color</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-content" title="dom-CSSStyleDeclaration-content">content</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-counterincrement" title="dom-CSSStyleDeclaration-counterIncrement">counterIncrement</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-counterreset" title="dom-CSSStyleDeclaration-counterReset">counterReset</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-cue" title="dom-CSSStyleDeclaration-cue">cue</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-cueafter" title="dom-CSSStyleDeclaration-cueAfter">cueAfter</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-cuebefore" title="dom-CSSStyleDeclaration-cueBefore">cueBefore</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-cursor" title="dom-CSSStyleDeclaration-cursor">cursor</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-direction" title="dom-CSSStyleDeclaration-direction">direction</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-display" title="dom-CSSStyleDeclaration-display">display</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-elevation" title="dom-CSSStyleDeclaration-elevation">elevation</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-emptycells" title="dom-CSSStyleDeclaration-emptyCells">emptyCells</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-cssfloat" title="dom-CSSStyleDeclaration-cssFloat">cssFloat</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-font" title="dom-CSSStyleDeclaration-font">font</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-fontfamily" title="dom-CSSStyleDeclaration-fontFamily">fontFamily</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-fontsize" title="dom-CSSStyleDeclaration-fontSize">fontSize</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-fontsizeadjust" title="dom-CSSStyleDeclaration-fontSizeAdjust">fontSizeAdjust</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-fontstretch" title="dom-CSSStyleDeclaration-fontStretch">fontStretch</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-fontstyle" title="dom-CSSStyleDeclaration-fontStyle">fontStyle</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-fontvariant" title="dom-CSSStyleDeclaration-fontVariant">fontVariant</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-fontweight" title="dom-CSSStyleDeclaration-fontWeight">fontWeight</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-height" title="dom-CSSStyleDeclaration-height">height</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-left" title="dom-CSSStyleDeclaration-left">left</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-letterspacing" title="dom-CSSStyleDeclaration-letterSpacing">letterSpacing</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-lineheight" title="dom-CSSStyleDeclaration-lineHeight">lineHeight</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-liststyle" title="dom-CSSStyleDeclaration-listStyle">listStyle</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-liststyleimage" title="dom-CSSStyleDeclaration-listStyleImage">listStyleImage</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-liststyleposition" title="dom-CSSStyleDeclaration-listStylePosition">listStylePosition</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-liststyletype" title="dom-CSSStyleDeclaration-listStyleType">listStyleType</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-margin" title="dom-CSSStyleDeclaration-margin">margin</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-margintop" title="dom-CSSStyleDeclaration-marginTop">marginTop</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-marginright" title="dom-CSSStyleDeclaration-marginRight">marginRight</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-marginbottom" title="dom-CSSStyleDeclaration-marginBottom">marginBottom</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-marginleft" title="dom-CSSStyleDeclaration-marginLeft">marginLeft</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-markeroffset" title="dom-CSSStyleDeclaration-markerOffset">markerOffset</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-marks" title="dom-CSSStyleDeclaration-marks">marks</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-maxheight" title="dom-CSSStyleDeclaration-maxHeight">maxHeight</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-maxwidth" title="dom-CSSStyleDeclaration-maxWidth">maxWidth</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-minheight" title="dom-CSSStyleDeclaration-minHeight">minHeight</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-minwidth" title="dom-CSSStyleDeclaration-minWidth">minWidth</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-orphans" title="dom-CSSStyleDeclaration-orphans">orphans</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-outline" title="dom-CSSStyleDeclaration-outline">outline</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-outlinecolor" title="dom-CSSStyleDeclaration-outlineColor">outlineColor</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-outlinestyle" title="dom-CSSStyleDeclaration-outlineStyle">outlineStyle</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-outlinewidth" title="dom-CSSStyleDeclaration-outlineWidth">outlineWidth</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-overflow" title="dom-CSSStyleDeclaration-overflow">overflow</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-padding" title="dom-CSSStyleDeclaration-padding">padding</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-paddingtop" title="dom-CSSStyleDeclaration-paddingTop">paddingTop</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-paddingright" title="dom-CSSStyleDeclaration-paddingRight">paddingRight</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-paddingbottom" title="dom-CSSStyleDeclaration-paddingBottom">paddingBottom</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-paddingleft" title="dom-CSSStyleDeclaration-paddingLeft">paddingLeft</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-page" title="dom-CSSStyleDeclaration-page">page</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-pagebreakafter" title="dom-CSSStyleDeclaration-pageBreakAfter">pageBreakAfter</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-pagebreakbefore" title="dom-CSSStyleDeclaration-pageBreakBefore">pageBreakBefore</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-pagebreakinside" title="dom-CSSStyleDeclaration-pageBreakInside">pageBreakInside</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-pause" title="dom-CSSStyleDeclaration-pause">pause</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-pauseafter" title="dom-CSSStyleDeclaration-pauseAfter">pauseAfter</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-pausebefore" title="dom-CSSStyleDeclaration-pauseBefore">pauseBefore</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-pitch" title="dom-CSSStyleDeclaration-pitch">pitch</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-pitchrange" title="dom-CSSStyleDeclaration-pitchRange">pitchRange</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-playduring" title="dom-CSSStyleDeclaration-playDuring">playDuring</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-position" title="dom-CSSStyleDeclaration-position">position</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-quotes" title="dom-CSSStyleDeclaration-quotes">quotes</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-richness" title="dom-CSSStyleDeclaration-richness">richness</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-right" title="dom-CSSStyleDeclaration-right">right</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-size" title="dom-CSSStyleDeclaration-size">size</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-speak" title="dom-CSSStyleDeclaration-speak">speak</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-speakheader" title="dom-CSSStyleDeclaration-speakHeader">speakHeader</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-speaknumeral" title="dom-CSSStyleDeclaration-speakNumeral">speakNumeral</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-speakpunctuation" title="dom-CSSStyleDeclaration-speakPunctuation">speakPunctuation</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-speechrate" title="dom-CSSStyleDeclaration-speechRate">speechRate</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-stress" title="dom-CSSStyleDeclaration-stress">stress</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-tablelayout" title="dom-CSSStyleDeclaration-tableLayout">tableLayout</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-textalign" title="dom-CSSStyleDeclaration-textAlign">textAlign</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-textdecoration" title="dom-CSSStyleDeclaration-textDecoration">textDecoration</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-textindent" title="dom-CSSStyleDeclaration-textIndent">textIndent</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-textshadow" title="dom-CSSStyleDeclaration-textShadow">textShadow</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-texttransform" title="dom-CSSStyleDeclaration-textTransform">textTransform</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-top" title="dom-CSSStyleDeclaration-top">top</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-unicodebidi" title="dom-CSSStyleDeclaration-unicodeBidi">unicodeBidi</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-verticalalign" title="dom-CSSStyleDeclaration-verticalAlign">verticalAlign</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-visibility" title="dom-CSSStyleDeclaration-visibility">visibility</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-voicefamily" title="dom-CSSStyleDeclaration-voiceFamily">voiceFamily</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-volume" title="dom-CSSStyleDeclaration-volume">volume</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-whitespace" title="dom-CSSStyleDeclaration-whiteSpace">whiteSpace</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-widows" title="dom-CSSStyleDeclaration-widows">widows</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-width" title="dom-CSSStyleDeclaration-width">width</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-wordspacing" title="dom-CSSStyleDeclaration-wordSpacing">wordSpacing</a>;
attribute DOMString? <a href="#dom-cssstyledeclaration-zindex" title="dom-CSSStyleDeclaration-zIndex">zIndex</a>;
};</pre>
<p>The
<dfn id="dom-cssstyledeclaration-csstext" title="dom-CSSStyleDeclaration-cssText"><code>cssText</code></dfn>
attribute must, on getting, return the result of
<a href="#serialize-a-css-declaration-block" title="serialize a CSS declaration block">serializing</a> the
<a href="#css-declaration-block-declarations">CSS declaration block declarations</a>.</p>
<p>On setting the <code title="">cssText</code> attribute these steps
must be run:</p>
<ol>
<li><p>If the <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> is true
raise a <code>NO_MODIFICATION_ALLOWED_ERR</code> and terminate this
algorithm.</li>
<li><p>Empty the
<a href="#css-declaration-block-declarations">CSS declaration block declarations</a>.</li>
<li><p><a href="#parse-a-css-declaration-block" title="Parse a CSS declaration block">Parse</a> the given
value and, if the return value is not null, insert it into the
<a href="#css-declaration-block-declarations">CSS declaration block declarations</a>.</li>
</ol>
<!-- XXX WebIDL work -->
<p>The
<dfn id="dom-cssstyledeclaration-length" title="dom-CSSStyleDeclaration-length"><code>length</code></dfn>
attribute must return the number of declarations in
the <span>collection of CSS declarations</span>.</p>
<p>The
<dfn id="dom-cssstyledeclaration-item" title="dom-CSSStyleDeclaration-item"><code>item(<var title="">index</var>)</code></dfn>
method, when invoked, <span class="XXX">...</span>.</p>
<!-- returns the name of property at position index. -->
<p>The
<dfn id="dom-cssstyledeclaration-getpropertyvalue" title="dom-CSSStyleDeclaration-getPropertyValue"><code>getPropertyValue(<var title="">property</var>)</code></dfn>
method, when invoked, <span class="XXX">...</span>.</p>
<!-- Once we have defined how everything will be canonicalized we can start
thinking about this... --><p></p>
<p>The
<dfn id="dom-cssstyledeclaration-getpropertypriority" title="dom-CSSStyleDeclaration-getPropertyPriority"><code>getPropertyPriority(<var title="">property</var>)</code></dfn>
method, when invoked, if <var title="">property</var> is an
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for a
property that has a priority user agents must return the canonical
priority of that property as given in the syntax definition. Otherwise,
the empty string must be returned.</p>
<p class="example">E.g. for <code>background-color:lime !IMPORTANT</code>
the return value would be "<code title="">important</code>".</p>
<p>When the
<dfn id="dom-cssstyledeclaration-setproperty" title="dom-CSSStyleDeclaration-setProperty"><code>setProperty(<var title="">property</var>, <var title="">value</var>, <var title="">priority</var>)</code></dfn>
method is invoked these steps must be run:</p>
<ol>
<li><p>If the <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> is true
raise a <code>NO_MODIFICATION_ALLOWED_ERR</code> and terminate this
algorithm.</li>
<li><p>If <var title="">property</var> is not an
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for a
supported property, terminate this algorithm.</li>
<li><p>If <var title="">value</var> is null or the empty string invoke
<code title="dom-CSSStyleDeclaration-removeProperty"><a href="#dom-cssstyledeclaration-removeproperty">removeProperty()</a></code>
with <var title="">property</var> as argument and terminate this
algorithm.</li>
<li><p>If the <var title="">priority</var> argument has been omitted let
<var title="">priority</var> be the empty string.</li>
<li><p>If <var title="">priority</var> is neither a valid priority nor
the empty string terminate this algorithm.</li>
<!-- define valid priority somehow -->
<li>
<p>If <a href="#parse-a-css-value" title="parse a CSS value">parsing the
<var title="">value</var></a> returns null abort this algorithm.</p>
<p class="note"><var title="">value</var> can not include
"<code title="">!important</code>".</p>
</li>
<li><p>Finally, set <var title="">property</var> to <var title="">value</var>
with priority <var title="">priority</var> when <var title="">priority</var>
is not the empty string. Otherwise set
<var title="">property</var> to <var title="">value</var>.</li>
</ol>
<p>When the
<dfn id="dom-cssstyledeclaration-removeproperty" title="dom-CSSStyleDeclaration-removeProperty"><code>removeProperty(<var title="">property</var>)</code></dfn>
method is invoked these steps must be run:</p>
<ol>
<li><p>If the <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> is true
raise a <code>NO_MODIFICATION_ALLOWED_ERR</code> and terminate this
algorithm.</li>
<li><p>If <var title="">property</var> is an
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for a
property of a declaration in the
<span>collection of CSS declarations</span> remove the declaration.</p>
</ol>
<p>The
<dfn id="dom-cssstyledeclaration-values" title="dom-CSSStyleDeclaration-values"><code>values</code></dfn>
attribute must return <span class="XXX">...</span></p>
<p>The
<dfn id="dom-cssstyledeclaration-parentrule" title="dom-CSSStyleDeclaration-parentRule"><code>parentRule</code></dfn>
attribute must return the
<code><a href="#cssrule">CSSrule</a></code> object the <code><a href="#cssstyledeclaration">CSSStyleDeclaration</a></code> is object is
associated with or null if it is not associated with a
<code><a href="#cssrule">CSSrule</a></code> object.</p>
<!-- XXX introduce a concept for this instead -->
<p>For the table below, the IDL attribute in the first column
must, on getting return the result of invoking
<code title="dom-CSSStyleDeclaration-getPropertyValue"><a href="#dom-cssstyledeclaration-getpropertyvalue">getPropertyValue()</a></code>
with as argument the CSS property given in the second column on the same
row.</p>
<p>Similarly for the table below, setting the IDL attribute in the
first column must invoke
<code title="dom-CSSStyleDeclaration-setProperty"><a href="#dom-cssstyledeclaration-setproperty">setProperty()</a></code> with as
first argument the CSS property given in the second column on the same
row, as second argument the given value, and no third argument. Any
exceptions raised must be re-raised.</p>
<table>
<thead>
<tr>
<th>IDL attribute
<th>CSS property
<tbody>
<tr>
<td><dfn id="dom-cssstyledeclaration-azimuth" title="dom-CSSStyleDeclaration-azimuth"><code>azimuth</code></dfn></td>
<td>"<code>azimuth</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-background" title="dom-CSSStyleDeclaration-background"><code>background</code></dfn></td>
<td>"<code>background</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-backgroundattachment" title="dom-CSSStyleDeclaration-backgroundAttachment"><code>backgroundAttachment</code></dfn></td>
<td>"<code>background-attachment</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-backgroundcolor" title="dom-CSSStyleDeclaration-backgroundColor"><code>backgroundColor</code></dfn></td>
<td>"<code>background-color</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-backgroundimage" title="dom-CSSStyleDeclaration-backgroundImage"><code>backgroundImage</code></dfn></td>
<td>"<code>background-image</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-backgroundposition" title="dom-CSSStyleDeclaration-backgroundPosition"><code>backgroundPosition</code></dfn></td>
<td>"<code>background-position</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-backgroundrepeat" title="dom-CSSStyleDeclaration-backgroundRepeat"><code>backgroundRepeat</code></dfn></td>
<td>"<code>background-repeat</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-border" title="dom-CSSStyleDeclaration-border"><code>border</code></dfn></td>
<td>"<code>border</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-bordercollapse" title="dom-CSSStyleDeclaration-borderCollapse"><code>borderCollapse</code></dfn></td>
<td>"<code>border-collapse</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-bordercolor" title="dom-CSSStyleDeclaration-borderColor"><code>borderColor</code></dfn></td>
<td>"<code>border-color</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderspacing" title="dom-CSSStyleDeclaration-borderSpacing"><code>borderSpacing</code></dfn></td>
<td>"<code>border-spacing</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderstyle" title="dom-CSSStyleDeclaration-borderStyle"><code>borderStyle</code></dfn></td>
<td>"<code>border-style</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-bordertop" title="dom-CSSStyleDeclaration-borderTop"><code>borderTop</code></dfn></td>
<td>"<code>border-top</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderright" title="dom-CSSStyleDeclaration-borderRight"><code>borderRight</code></dfn></td>
<td>"<code>border-right</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderbottom" title="dom-CSSStyleDeclaration-borderBottom"><code>borderBottom</code></dfn></td>
<td>"<code>border-bottom</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderleft" title="dom-CSSStyleDeclaration-borderLeft"><code>borderLeft</code></dfn></td>
<td>"<code>border-left</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-bordertopcolor" title="dom-CSSStyleDeclaration-borderTopColor"><code>borderTopColor</code></dfn></td>
<td>"<code>border-top-color</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderrightcolor" title="dom-CSSStyleDeclaration-borderRightColor"><code>borderRightColor</code></dfn></td>
<td>"<code>border-right-color</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderbottomcolor" title="dom-CSSStyleDeclaration-borderBottomColor"><code>borderBottomColor</code></dfn></td>
<td>"<code>border-bottom-color</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderleftcolor" title="dom-CSSStyleDeclaration-borderLeftColor"><code>borderLeftColor</code></dfn></td>
<td>"<code>border-left-color</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-bordertopstyle" title="dom-CSSStyleDeclaration-borderTopStyle"><code>borderTopStyle</code></dfn></td>
<td>"<code>border-top-style</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderrightstyle" title="dom-CSSStyleDeclaration-borderRightStyle"><code>borderRightStyle</code></dfn></td>
<td>"<code>border-right-style</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderbottomstyle" title="dom-CSSStyleDeclaration-borderBottomStyle"><code>borderBottomStyle</code></dfn></td>
<td>"<code>border-bottom-style</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderleftstyle" title="dom-CSSStyleDeclaration-borderLeftStyle"><code>borderLeftStyle</code></dfn></td>
<td>"<code>border-left-style</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-bordertopwidth" title="dom-CSSStyleDeclaration-borderTopWidth"><code>borderTopWidth</code></dfn></td>
<td>"<code>border-top-width</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderrightwidth" title="dom-CSSStyleDeclaration-borderRightWidth"><code>borderRightWidth</code></dfn></td>
<td>"<code>border-right-width</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderbottomwidth" title="dom-CSSStyleDeclaration-borderBottomWidth"><code>borderBottomWidth</code></dfn></td>
<td>"<code>border-bottom-width</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderleftwidth" title="dom-CSSStyleDeclaration-borderLeftWidth"><code>borderLeftWidth</code></dfn></td>
<td>"<code>border-left-width</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-borderwidth" title="dom-CSSStyleDeclaration-borderWidth"><code>borderWidth</code></dfn></td>
<td>"<code>border-width</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-bottom" title="dom-CSSStyleDeclaration-bottom"><code>bottom</code></dfn></td>
<td>"<code>bottom</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-captionside" title="dom-CSSStyleDeclaration-captionSide"><code>captionSide</code></dfn></td>
<td>"<code>caption-side</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-clear" title="dom-CSSStyleDeclaration-clear"><code>clear</code></dfn></td>
<td>"<code>clear</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-clip" title="dom-CSSStyleDeclaration-clip"><code>clip</code></dfn></td>
<td>"<code>clip</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-color" title="dom-CSSStyleDeclaration-color"><code>color</code></dfn></td>
<td>"<code>color</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-content" title="dom-CSSStyleDeclaration-content"><code>content</code></dfn></td>
<td>"<code>content</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-counterincrement" title="dom-CSSStyleDeclaration-counterIncrement"><code>counterIncrement</code></dfn></td>
<td>"<code>counter-increment</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-counterreset" title="dom-CSSStyleDeclaration-counterReset"><code>counterReset</code></dfn></td>
<td>"<code>counter-reset</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-cue" title="dom-CSSStyleDeclaration-cue"><code>cue</code></dfn></td>
<td>"<code>cue</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-cueafter" title="dom-CSSStyleDeclaration-cueAfter"><code>cueAfter</code></dfn></td>
<td>"<code>cue-after</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-cuebefore" title="dom-CSSStyleDeclaration-cueBefore"><code>cueBefore</code></dfn></td>
<td>"<code>cue-before</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-cursor" title="dom-CSSStyleDeclaration-cursor"><code>cursor</code></dfn></td>
<td>"<code>cursor</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-direction" title="dom-CSSStyleDeclaration-direction"><code>direction</code></dfn></td>
<td>"<code>direction</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-display" title="dom-CSSStyleDeclaration-display"><code>display</code></dfn></td>
<td>"<code>display</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-elevation" title="dom-CSSStyleDeclaration-elevation"><code>elevation</code></dfn></td>
<td>"<code>elevation</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-emptycells" title="dom-CSSStyleDeclaration-emptyCells"><code>emptyCells</code></dfn></td>
<td>"<code>empty-cells</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-cssfloat" title="dom-CSSStyleDeclaration-cssFloat"><code>cssFloat</code></dfn></td>
<td>"<code>float</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-font" title="dom-CSSStyleDeclaration-font"><code>font</code></dfn></td>
<td>"<code>font</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-fontfamily" title="dom-CSSStyleDeclaration-fontFamily"><code>fontFamily</code></dfn></td>
<td>"<code>font-family</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-fontsize" title="dom-CSSStyleDeclaration-fontSize"><code>fontSize</code></dfn></td>
<td>"<code>font-size</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-fontsizeadjust" title="dom-CSSStyleDeclaration-fontSizeAdjust"><code>fontSizeAdjust</code></dfn></td>
<td>"<code>font-size-adjust</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-fontstretch" title="dom-CSSStyleDeclaration-fontStretch"><code>fontStretch</code></dfn></td>
<td>"<code>font-stretch</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-fontstyle" title="dom-CSSStyleDeclaration-fontStyle"><code>fontStyle</code></dfn></td>
<td>"<code>font-style</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-fontvariant" title="dom-CSSStyleDeclaration-fontVariant"><code>fontVariant</code></dfn></td>
<td>"<code>font-variant</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-fontweight" title="dom-CSSStyleDeclaration-fontWeight"><code>fontWeight</code></dfn></td>
<td>"<code>font-weight</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-height" title="dom-CSSStyleDeclaration-height"><code>height</code></dfn></td>
<td>"<code>height</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-left" title="dom-CSSStyleDeclaration-left"><code>left</code></dfn></td>
<td>"<code>left</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-letterspacing" title="dom-CSSStyleDeclaration-letterSpacing"><code>letterSpacing</code></dfn></td>
<td>"<code>letter-spacing</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-lineheight" title="dom-CSSStyleDeclaration-lineHeight"><code>lineHeight</code></dfn></td>
<td>"<code>line-height</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-liststyle" title="dom-CSSStyleDeclaration-listStyle"><code>listStyle</code></dfn></td>
<td>"<code>list-style</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-liststyleimage" title="dom-CSSStyleDeclaration-listStyleImage"><code>listStyleImage</code></dfn></td>
<td>"<code>list-style-image</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-liststyleposition" title="dom-CSSStyleDeclaration-listStylePosition"><code>listStylePosition</code></dfn></td>
<td>"<code>list-style-position</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-liststyletype" title="dom-CSSStyleDeclaration-listStyleType"><code>listStyleType</code></dfn></td>
<td>"<code>list-style-type</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-margin" title="dom-CSSStyleDeclaration-margin"><code>margin</code></dfn></td>
<td>"<code>margin</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-margintop" title="dom-CSSStyleDeclaration-marginTop"><code>marginTop</code></dfn></td>
<td>"<code>margin-top</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-marginright" title="dom-CSSStyleDeclaration-marginRight"><code>marginRight</code></dfn></td>
<td>"<code>margin-right</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-marginbottom" title="dom-CSSStyleDeclaration-marginBottom"><code>marginBottom</code></dfn></td>
<td>"<code>margin-bottom</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-marginleft" title="dom-CSSStyleDeclaration-marginLeft"><code>marginLeft</code></dfn></td>
<td>"<code>margin-left</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-markeroffset" title="dom-CSSStyleDeclaration-markerOffset"><code>markerOffset</code></dfn></td>
<td>"<code>marker-offset</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-marks" title="dom-CSSStyleDeclaration-marks"><code>marks</code></dfn></td>
<td>"<code>marks</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-maxheight" title="dom-CSSStyleDeclaration-maxHeight"><code>maxHeight</code></dfn></td>
<td>"<code>max-height</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-maxwidth" title="dom-CSSStyleDeclaration-maxWidth"><code>maxWidth</code></dfn></td>
<td>"<code>max-width</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-minheight" title="dom-CSSStyleDeclaration-minHeight"><code>minHeight</code></dfn></td>
<td>"<code>min-height</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-minwidth" title="dom-CSSStyleDeclaration-minWidth"><code>minWidth</code></dfn></td>
<td>"<code>min-width</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-orphans" title="dom-CSSStyleDeclaration-orphans"><code>orphans</code></dfn></td>
<td>"<code>orphans</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-outline" title="dom-CSSStyleDeclaration-outline"><code>outline</code></dfn></td>
<td>"<code>outline</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-outlinecolor" title="dom-CSSStyleDeclaration-outlineColor"><code>outlineColor</code></dfn></td>
<td>"<code>outline-color</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-outlinestyle" title="dom-CSSStyleDeclaration-outlineStyle"><code>outlineStyle</code></dfn></td>
<td>"<code>outline-style</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-outlinewidth" title="dom-CSSStyleDeclaration-outlineWidth"><code>outlineWidth</code></dfn></td>
<td>"<code>outline-width</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-overflow" title="dom-CSSStyleDeclaration-overflow"><code>overflow</code></dfn></td>
<td>"<code>overflow</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-padding" title="dom-CSSStyleDeclaration-padding"><code>padding</code></dfn></td>
<td>"<code>padding</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-paddingtop" title="dom-CSSStyleDeclaration-paddingTop"><code>paddingTop</code></dfn></td>
<td>"<code>padding-top</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-paddingright" title="dom-CSSStyleDeclaration-paddingRight"><code>paddingRight</code></dfn></td>
<td>"<code>padding-right</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-paddingbottom" title="dom-CSSStyleDeclaration-paddingBottom"><code>paddingBottom</code></dfn></td>
<td>"<code>padding-bottom</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-paddingleft" title="dom-CSSStyleDeclaration-paddingLeft"><code>paddingLeft</code></dfn></td>
<td>"<code>padding-left</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-page" title="dom-CSSStyleDeclaration-page"><code>page</code></dfn></td>
<td>"<code>page</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-pagebreakafter" title="dom-CSSStyleDeclaration-pageBreakAfter"><code>pageBreakAfter</code></dfn></td>
<td>"<code>page-break-after</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-pagebreakbefore" title="dom-CSSStyleDeclaration-pageBreakBefore"><code>pageBreakBefore</code></dfn></td>
<td>"<code>page-break-before</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-pagebreakinside" title="dom-CSSStyleDeclaration-pageBreakInside"><code>pageBreakInside</code></dfn></td>
<td>"<code>page-break-inside</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-pause" title="dom-CSSStyleDeclaration-pause"><code>pause</code></dfn></td>
<td>"<code>pause</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-pauseafter" title="dom-CSSStyleDeclaration-pauseAfter"><code>pauseAfter</code></dfn></td>
<td>"<code>pause-after</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-pausebefore" title="dom-CSSStyleDeclaration-pauseBefore"><code>pauseBefore</code></dfn></td>
<td>"<code>pause-before</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-pitch" title="dom-CSSStyleDeclaration-pitch"><code>pitch</code></dfn></td>
<td>"<code>pitch</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-pitchrange" title="dom-CSSStyleDeclaration-pitchRange"><code>pitchRange</code></dfn></td>
<td>"<code>pitch-range</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-playduring" title="dom-CSSStyleDeclaration-playDuring"><code>playDuring</code></dfn></td>
<td>"<code>play-during</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-position" title="dom-CSSStyleDeclaration-position"><code>position</code></dfn></td>
<td>"<code>position</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-quotes" title="dom-CSSStyleDeclaration-quotes"><code>quotes</code></dfn></td>
<td>"<code>quotes</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-richness" title="dom-CSSStyleDeclaration-richness"><code>richness</code></dfn></td>
<td>"<code>richness</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-right" title="dom-CSSStyleDeclaration-right"><code>right</code></dfn></td>
<td>"<code>right</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-size" title="dom-CSSStyleDeclaration-size"><code>size</code></dfn></td>
<td>"<code>size</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-speak" title="dom-CSSStyleDeclaration-speak"><code>speak</code></dfn></td>
<td>"<code>speak</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-speakheader" title="dom-CSSStyleDeclaration-speakHeader"><code>speakHeader</code></dfn></td>
<td>"<code>speak-header</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-speaknumeral" title="dom-CSSStyleDeclaration-speakNumeral"><code>speakNumeral</code></dfn></td>
<td>"<code>speak-numeral</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-speakpunctuation" title="dom-CSSStyleDeclaration-speakPunctuation"><code>speakPunctuation</code></dfn></td>
<td>"<code>speak-punctuation</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-speechrate" title="dom-CSSStyleDeclaration-speechRate"><code>speechRate</code></dfn></td>
<td>"<code>speech-rate</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-stress" title="dom-CSSStyleDeclaration-stress"><code>stress</code></dfn></td>
<td>"<code>stress</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-tablelayout" title="dom-CSSStyleDeclaration-tableLayout"><code>tableLayout</code></dfn></td>
<td>"<code>table-layout</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-textalign" title="dom-CSSStyleDeclaration-textAlign"><code>textAlign</code></dfn></td>
<td>"<code>text-align</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-textdecoration" title="dom-CSSStyleDeclaration-textDecoration"><code>textDecoration</code></dfn></td>
<td>"<code>text-decoration</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-textindent" title="dom-CSSStyleDeclaration-textIndent"><code>textIndent</code></dfn></td>
<td>"<code>text-indent</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-textshadow" title="dom-CSSStyleDeclaration-textShadow"><code>textShadow</code></dfn></td>
<td>"<code>text-shadow</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-texttransform" title="dom-CSSStyleDeclaration-textTransform"><code>textTransform</code></dfn></td>
<td>"<code>text-transform</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-top" title="dom-CSSStyleDeclaration-top"><code>top</code></dfn></td>
<td>"<code>top</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-unicodebidi" title="dom-CSSStyleDeclaration-unicodeBidi"><code>unicodeBidi</code></dfn></td>
<td>"<code>unicode-bidi</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-verticalalign" title="dom-CSSStyleDeclaration-verticalAlign"><code>verticalAlign</code></dfn></td>
<td>"<code>vertical-align</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-visibility" title="dom-CSSStyleDeclaration-visibility"><code>visibility</code></dfn></td>
<td>"<code>visibility</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-voicefamily" title="dom-CSSStyleDeclaration-voiceFamily"><code>voiceFamily</code></dfn></td>
<td>"<code>voice-family</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-volume" title="dom-CSSStyleDeclaration-volume"><code>volume</code></dfn></td>
<td>"<code>volume</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-whitespace" title="dom-CSSStyleDeclaration-whiteSpace"><code>whiteSpace</code></dfn></td>
<td>"<code>white-space</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-widows" title="dom-CSSStyleDeclaration-widows"><code>widows</code></dfn></td>
<td>"<code>widows</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-width" title="dom-CSSStyleDeclaration-width"><code>width</code></dfn></td>
<td>"<code>width</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-wordspacing" title="dom-CSSStyleDeclaration-wordSpacing"><code>wordSpacing</code></dfn></td>
<td>"<code>word-spacing</code>"</td>
<tr>
<td><dfn id="dom-cssstyledeclaration-zindex" title="dom-CSSStyleDeclaration-zIndex"><code>zIndex</code></dfn></td>
<td>"<code>z-index</code>"</td>
</table>
<!--
<h4>CSS Properties</h4>
<p>The DOM attribute name of a CSS property can be found by using the
following algorithm:</p>
<ol>
<li>Let <var title="">r</var> be the CSS property to be
converted.</li>
<li>Uppercase the first character after every U+002D (<code>-</code>) in
<var title="">r</var>.</li>
<li>Remove every U+002D (<code>-</code>) in <var title="">r</var>.</li>
<li>Return <var title="">r</var>.</li>
</ol>
<p class="note">This means that
<code>-<var title="">vendor</var>-<var title="">property</var></code>
becomes
<code><var title=""><strong>V</strong>endor</var><var title=""><strong>P</strong>roperty</var></code>
for instance.</p>
-->
<h4 id="the-cssstyledeclarationvalue-interface"><span class="secno">6.5.2 </span>The <code title="">CSSStyleDeclarationValue</code> Interface</h4>
<pre class="idl">interface <dfn id="cssstyledeclarationvalue">CSSStyleDeclarationValue</dfn> {
<span class="XXX">// ...</span>
// CSS Properties
<!--CSSOM-DECLARATIONVALUEIDL-->
};</pre>
<p class="XXX">The rought idea is that this interface exposes the full
list of supported properties as well that each return a
<code><a href="#csspropertyvalue">CSSPropertyValue</a></code> object. That object can implement other
objects depending on the property involved. E.g. for '<code>width</code>'
the object would implement <code><a href="#csslengthcomponentvalue">CSSLengthComponentValue</a></code> and
<code><a href="#csspercentagecomponentvalue">CSSPercentageComponentValue</a></code>.</p>
<h3 id="css-values"><span class="secno">6.6 </span>CSS Values</h3>
<h4 id="parsing-css-values"><span class="secno">6.6.1 </span>Parsing CSS Values</h4>
<p>To <dfn id="parse-a-css-value">parse a CSS value</dfn> for a given
<var title="">property</var> means to a parse the given value according to
the definition of the property that is an
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for
<var title="">property</var> in the CSS specification. If the given value
is <span>ignored</span> return null. Otherwise return the CSS value for
the given <var title="">property</var>.</p>
<p class="note">"<code title="">!important</code>" declarations are not
part of the property value space and will therefore cause
<a href="#parse-a-css-value">parse a CSS value</a> to return null.</p>
<h4 id="serializing-css-values"><span class="secno">6.6.2 </span>Serializing CSS Values</h4>
<!-- based on http://damowmow.com/playground/canon.txt -->
<p>To <dfn id="serialize-a-css-value">serialize a CSS value</dfn> follow
these rules:</p>
<ul>
<li><p><a href="#serialize-a-css-value-component" title="Serialize a CSS component value">Serialize</a> any
CSS component values in the value.</li>
<li><p>Where multiple CSS component values can appear in any order
without changing the meaning of the value (typically represented by a
double bar <code>||</code> in the value syntax), use the order as given
in the syntax.</li>
<!-- <code><border-width> <border-style> <color></code>
for <code>border</code> -->
<li>
<p>Where CSS component values of the value can be omitted without
changing the meaning of the value (e.g. initial values in shorthand
properties), omit them. If this would remove all the values, then
include the first allowed value.</p>
<p class="example">E.g. <code>margin: 20px 20px</code> becomes
<code>margin: 20px</code>.</p>
<p class="example">E.g. the value <code>0</code> for the
'<code>border</code>' property.</p>
</li>
<li><p>If the value of a shorthand property is requested and it cannot be
computed because the properties associated with the shorthand have values
that cannot be represented by the shorthand the serialization is the
empty string.</li>
<li><p>If a value has a <a href="#whitespace">whitespace</a>-separated list of
CSS component values,
<a href="#serialize-a-whitespace-separated-list" title="serialize a whitespace-separated list">serialize</a> the
value as a whitespace-separated list.</li>
<li><p>If a value has a comma-separated list of
CSS component values,
<a href="#serialize-a-comma-separated-list" title="serialize a comma-separated list">serialize</a> the
value as a comma-separated list.</li>
</ul>
<p>To
<dfn id="serialize-a-css-value-component">serialize a CSS component value</dfn>
depends on the component, as follows:</p>
<dl class="switch">
<dt>keyword</dt>
<dd><p>The keyword
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</dd>
<dt><angle></dt>
<dd><p>The number of degrees serialized as per <number> followed by
the literal string "<code>deg</code>".</dd>
<dt><color></dt>
<dd><p class="XXX">preserve system colors, maybe color keywords...</dd>
<!--
<dt>It is a system color</dt>
<dd>See below (you use the representation given in the specification that
defines the keyword).</dd>
<dt>Alpha component is equal to 1.0</dt>
<dd>The color is an uppercase six-digit hexadecimal value, prefixed with a
<code>#</code> character (U+0023 NUMBER SIGN), with the first two digits
representing the red component, the next two digits representing the green
component, and the last two digits representing the blue component, the
digits being in the range 0-9 A-F (U+0030 to U+0039 and U+0041 to
U+0046).</dd>
<dt>Alpha component is less than 1.0</dt>
<dd>The color is in the CSS <code>rgba()</code> functional-notation format:
the literal string <code>rgba</code> (U+0072 U+0067 U+0062 U+0061) followed
by a U+0028 LEFT PARENTHESIS, a <span>color component integer</span>
representing the red component, a <span>color component separator</span>, a
<span>color component integer</span> for the green component, a <span>color
component separator</span>, a <span>color component integer</span> for the
blue component, another <span>color component separator</span> a U+0030
DIGIT ZERO, a U+002E FULL STOP (representing the decimal point), one or
more digits in the range 0-9 (U+0030 to U+0039) representing the fractional
part of the alpha value, and finally a U+0029 RIGHT PARENTHESIS.</dd>
<dt>The keyword <code>transparent</code> is used</dt>
<dd>The color is <code>rgba(0, 0, 0, 0)</code>.</dd>
-->
<dt><counter></dt>
<dd>
<p>The concatenation of:</p>
<ol>
<li><p>If <counter> has three CSS component values the string
"<code title="">counters(</code>".</li>
<li><p>If <counter> has two CSS component values the string
"<code title="">counter(</code>".</li>
<li><p>The result of
<a href="#serialize-a-comma-separated-list" title="serialize a comma-separated list">serializing</a> the
<a href="#serialize-a-css-value-component" title="serialize a CSS component value">serialized</a>
CSS component values belonging to <counter> as list while omitting
the last CSS component value if it is 'decimal'.</li>
<li><p>"<code>)</code>" (U+0029).</li>
</ol>
</dd>
<dt><frequency></dt>
<dd><p>The frequency in hertz serialized as per <number> followed by
the literal string "<code>hz</code>".</dd>
<dt><identifier></dt>
<dd><p>The identifier
<a href="#serialize-an-identifier" title="serialize an identifier">escaped</a>.</dd>
<dt><integer></dt>
<dd><p>A base-ten integer using digits 0-9 (U+0030 to U+0039) in the
shortest form possible, preceded by "<code>-</code>" (U+002D) if it is
negative.</dd>
<dt><length></dt>
<dd>
<p>A length of zero is represented by the literal string
"<code>0px</code>".</p>
<p>Absolute lengths: the number of millimeters serialized as per
<number> followed by the literal string "<code>mm</code>".
<span class="XXX">Rumor has it absolute lengths will become relative
lengths. Centimeters would be compatible with <resolution>...</span></p>
<p>Relative lengths: the <number> component serialized as per
<number> followed by the unit in its canonical form as defined in its
respective specification.</p>
</dd>
<dt><number></dt>
<dd><p class="XXX">Browsers seem to use ToString(), but that might give a
significand which according to some is teh evil (and also currently does
not parse correctly).</dd>
<dt><percentage></dt>
<dd><p>The <number> component serialized as per <number> followed
by the literal string "<code>%</code>" (U+0025).</dd>
<dt><resolution></dt>
<dd><p>The resolution in dots per centimeter serialized as per
<number> followed by the literal string "<code>dpcm</code>".</dd>
<dt><shape></dt>
<dd><p>The string "<code title="">rect(</code>", followed by the result
of <a href="#serialize-a-comma-separated-list" title="serialize a comma-separated list">serializing</a> the
<a href="#serialize-a-css-value-component" title="serialize a CSS component value">serialized</a>
CSS component values belonging to <shape> as list, followed by
"<code>)</code>" (U+0029).</dd>
<dt><string></dt>
<dt><family-name></dt>
<dt><specific-voice></dt>
<dd><p>The string
<a href="#serialize-a-string" title="serialize a string">string escaped</a>.</dd>
<dt><time></dt>
<dd><p>The time in seconds serialized as per <number> followed by
the literal string "<code>s</code>".</dd>
<dt><uri></dt>
<dd><p>The <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#absolute-url">absolute URL</a>
<a href="#serialize-a-url" title="serialize a URL">URL escaped</a>.</dd>
</dl>
<p>
<absolute-size>,
<border-width>,
<border-style>,
<bottom>,
<generic-family>,
<generic-voice>,
<left>,
<margin-width>,
<padding-width>,
<relative-size>,
<right>, and
<top>,
are considered macros by this specification. They all represent instances
of components outlined above.</p>
<p class="XXX">One idea is that we can remove this section somewhere in
the CSS3/CSS4 timeline by moving the above definitions to the drafts that
define the CSS components.</p>
<h5 id="examples-0"><span class="secno">6.6.2.1 </span>Examples</h5>
<p>Here are some examples of before and after results on specified values.
The before column could be what the author wrote in a style sheet, while
the after column shows what querying the DOM would return.</p>
<div class="example">
<table>
<thead>
<tr><th>Before<th>After
<tbody>
<tr><td><code>background: none</code><td><code>background: rgba(0, 0, 0, 0)</code>
<tr><td><code>outline: none</code><td><code>outline: invert</code>
<tr><td><code>border: none</code><td><code>border: medium</code>
<tr><td><code>list-style: none</code><td><code>list-style: disc</code>
<tr><td><code>margin: 0 1px 1px 1px</code><td><code>margin: 0px 1px 1px</code>
<tr><td><code>azimuth: behind left</code><td><code>azimuth: 220deg</code>
<tr><td><code>font-family: a, 'b"', serif</code><td><code>font-family: "a", "b\"", serif</code>
<tr><td><code>content: url('h)i') '\[\]'</code><td><code>content: url("h)i") "[]"</code>
<tr><td><code>azimuth: leftwards</code><td><code>azimuth: leftwards</code>
<tr><td><code>color: rgb(18, 52, 86)</code><td><code>color: #123456</code>
<tr><td><code>color: rgba(000001, 0, 0, 1)</code><td><code>color: #000000</code>
</table>
<p class="XXX">Some of these need to be updated per the new rules.</p>
</div>
<h4 id="the-csspropertyvalue-interface"><span class="secno">6.6.3 </span>The <code title="">CSSPropertyValue</code> Interface</h4>
<pre class="idl">interface <dfn id="csspropertyvalue">CSSPropertyValue</dfn> {
attribute DOMString <span title="dom-CSSPropertyValue-cssText">cssText</span>;
};</pre>
<p class="XXX">...</p>
<!--
what does the CSSValue represent
"map"
"list"
"space-list"
"component"
if it is a CSSComponentValue
-->
<h4 id="the-cssmapvalue-interface"><span class="secno">6.6.4 </span>The <code title="">CSSMapValue</code> Interface</h4>
<pre class="idl">[NoInterfaceObject] interface <dfn id="cssmapvalue">CSSMapValue</dfn> {
getter <span>CSSValue</span> (DOMString <var title="">name</var>);
};</pre>
<!-- see HTML5 DOMStringMap -->
<p class="XXX">This seems the simplest we can get away with.</p>
<h4 id="the-csspropertyvaluelist-interface"><span class="secno">6.6.5 </span>The <code title="">CSSPropertyValueList</code> Interface</h4>
<pre class="idl">[NoInterfaceObject] interface <dfn id="csspropertyvaluelist">CSSPropertyValueList</dfn> {
readonly attribute <span>CSSValue</span>[] <span title="dom-CSSPropertyValue-list">list</span>;
};</pre>
<p class="XXX">Ideally this attribute just returns a mutable array.</p>
<h4 id="the-csscomponentvalue-interface"><span class="secno">6.6.6 </span>The <code title="">CSSComponentValue</code> Interface</h4>
<pre class="idl">[NoInterfaceObject] interface <dfn id="csscomponentvalue">CSSComponentValue</dfn> {
readonly attribute DOMString <span title="dom-CSSComponentValue-type">type</span>;
attribute any <span title="dom-CSSComponentValue-value">value</span>;
};</pre>
<p class="XXX">type returns "string", "keyword", "identifier", "color", "em", "ex", "px", "url".</p>
<pre class="idl">[NoInterfaceObject] interface <dfn id="cssstringcomponentvalue">CSSStringComponentValue</dfn> {
attribute DOMString <span title="dom-CSSStringComponentValue-string">string</span>;
};</pre>
<pre class="idl">[NoInterfaceObject] interface <dfn id="csskeywordcomponentvalue">CSSKeywordComponentValue</dfn> {
attribute DOMString <span title="dom-CSSStringComponentValue-keyword">keyword</span>;
};</pre>
<pre class="idl">[NoInterfaceObject] interface <dfn id="cssidentifiercomponentvalue">CSSIdentifierComponentValue</dfn> {
attribute DOMString <span title="dom-CSSStringComponentValue-identifier">identifier</span>;
};</pre>
<pre class="idl">[NoInterfaceObject] interface <dfn id="csscolorcomponentvalue">CSSColorComponentValue</dfn> {
attribute short <span title="dom-CSSColorComponentValue-red">red</span>;
attribute short <span title="dom-CSSColorComponentValue-green">green</span>;
attribute short <span title="dom-CSSColorComponentValue-blue">blue</span>;
attribute float <span title="dom-CSSColorComponentValue-alpha">alpha</span>;
};</pre>
<p class="XXX">We can make this more complex later. This will probably move into the CSS Color Level 4.</p>
<pre class="idl">[NoInterfaceObject] interface <dfn id="csslengthcomponentvalue">CSSLengthComponentValue</dfn> {
attribute float <span title="dom-CSSLengthComponentValue-em">em</span>;
attribute float <span title="dom-CSSLengthComponentValue-ex">ex</span>;
attribute float <span title="dom-CSSLengthComponentValue-px">px</span>;
<span class="XXX">// figure out what to do with absolute lengths</span>
};</pre>
<pre class="idl">[NoInterfaceObject] interface <dfn id="csspercentagecomponentvalue">CSSPercentageComponentValue</dfn> {
attribute float <span title="dom-CSSPercentageComponentValue">percent</span>;
};</pre>
<pre class="idl">[NoInterfaceObject] interface <dfn id="cssurlcomponentvalue">CSSURLComponentValue</dfn> {
attribute DOMString? <span title="dom-CSSURLComponentValue-url">url</span>;
};</pre>
<h2 id="dom-access-to-css-declaration-blocks"><span class="secno">7 </span>DOM Access to CSS Declaration Blocks</h2>
<h3 id="the-elementcssinlinestyle-interface"><span class="secno">7.1 </span>The <code><a href="#elementcssinlinestyle">ElementCSSInlineStyle</a></code> Interface</h3>
<pre class="idl">[NoInterfaceObject] interface <dfn id="elementcssinlinestyle">ElementCSSInlineStyle</dfn> {
readonly attribute <a href="#cssstyledeclaration">CSSStyleDeclaration</a> <span>style</span>;
};</pre>
<p class="XXX">...</p>
<!-- XXX
how does this interact with the markup attribute
-->
<h3 id="extensions-to-the-window-interface"><span class="secno">7.2 </span>Extensions to the <code title="">Window</code> Interface</h3>
<pre class="idl">partial interface <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#window">Window</a> {
<a href="#cssstyledeclaration">CSSStyleDeclaration</a> <a href="#dom-window-getcomputedstyle" title="dom-Window-getComputedStyle">getComputedStyle</a>(<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#element">Element</a> <var title="">elt</var>);
<a href="#cssstyledeclaration">CSSStyleDeclaration</a> <a href="#dom-window-getcomputedstyle" title="dom-Window-getComputedStyle">getComputedStyle</a>(<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#element">Element</a> <var title="">elt</var>, DOMString <var title="">pseudoElt</var>);
};</pre>
<p>The
<dfn id="dom-window-getcomputedstyle" title="dom-Window-getComputedStyle"><code>getComputedStyle(<var title="">elt</var>, <var title="">pseudoElt</var>)</code></dfn>
method must run these steps:</p>
<ol>
<li><p>Let <var title="">doc</var> be the
<code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a></code>
associated with the <code class="external"><a href="http://www.whatwg.org/specs/web-apps/current-work/#window">Window</a></code> object on
which the method was invoked.</li>
<li><p>Let <var title="">obj</var> be <var title="">elt</var>.</li>
<li><p>If <var title="">pseudoElt</var> is as an
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for
either "<code>:before</code>" or "<code>::before</code>" let
<var title="">obj</var> be the '::before' pseudo-element of
<var title="">elt</var>.</li>
<li><p>If <var title="">pseudoElt</var> is as an
<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#ascii-case-insensitive">ASCII case-insensitive</a> match for
either "<code>:after</code>" or "<code>::after</code>" let
<var title="">obj</var> be the '::after' pseudo-element of
<var title="">elt</var>.</li>
<li>
<p>Return a <a href="#css-declaration-block">CSS declaration block</a> with the
<a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> set to true and the
<a href="#css-declaration-block-declarations">CSS declaration block declarations</a> set to all properties
the user agent supports with as value the <a href="#resolved-value">resolved value</a>
computed for <var title="">obj</var> using the style rules associated
with <var title="">doc</var>.</p>
<p class="note">This means that even if <var title="">obj</var> is in a
different document (e.g. one fetched via <code>XMLHttpRequest</code>) it
will still use the style rules associated with the document that is
associated with the global object on which
<code title="dom-Window-getComputedStyle"><a href="#dom-window-getcomputedstyle">getComputedStyle()</a></code> was
invoked to compute the <a href="#css-declaration-block">CSS declaration block</a>.</p>
</li>
<!-- https://bugs.webkit.org/show_bug.cgi?id=14563 has reasons for why
this is slightly crazy -->
</ol>
<p class="note">Because of historical IDL limitations the
<code title="dom-Window-getComputedStyle"><a href="#dom-window-getcomputedstyle">getComputedStyle()</a></code> method
used to be on a separate interface, <code title="">ViewCSS</code>.</p>
<h2 id="resolved-values"><span class="secno">8 </span>Resolved Values</h2>
<p><code title="dom-Window-getComputedStyle"><a href="#dom-window-getcomputedstyle">getComputedStyle()</a></code> was
historically defined to return the "computed value" of an element or
pseudo-element. However, the concept of "computed value" changed between
revisions of CSS while the implementation of
<code title="dom-Window-getComputedStyle"><a href="#dom-window-getcomputedstyle">getComputedStyle()</a></code> had to
remain the same for compatibility with deployed scripts. To address this
issue this specification introduces the concept of a
<dfn id="resolved-value">resolved value</dfn>.</p>
<p>The <a href="#resolved-value">resolved value</a> for a given property can be determined
as follows:</p>
<dl class="switch">
<!--
We want to treat shorthand properties like any other value basically.
<dt>'<code>background</code>'
<dt>'<code>border</code>'
<dt>'<code>border-collapse</code>'
<dt>'<code>border-color</code>'
<dt>'<code>border-spacing</code>'
<dt>'<code>border-style</code>'
<dt>'<code>border-top</code>'
<dt>'<code>border-right</code>'
<dt>'<code>border-bottom</code>'
<dt>'<code>border-left</code>'
<dt>'<code>border-width</code>'
<dt>'<code>font</code>'
<dt>'<code>list-style</code>'
<dt>'<code>margin</code>'
<dt>'<code>outline</code>'
<!- - overflow is not - ->
<dt>'<code>padding</code>'
<dt>'<code>pause</code>'
<dd>
<p>There is no <span>resolved value</span>.</p>
</dd>
-->
<dt>'<code>line-height</code>'</dt>
<dd><p>The <a href="#resolved-value">resolved value</a> is the used value.</dd>
<dt>'<code>height</code>'</dt>
<dt>'<code>margin</code>'</dt>
<dt>'<code>margin-bottom</code>'</dt>
<dt>'<code>margin-left</code>'</dt>
<dt>'<code>margin-right</code>'</dt>
<dt>'<code>margin-top</code>'</dt>
<dt>'<code>padding</code>'</dt>
<dt>'<code>padding-bottom</code>'</dt>
<dt>'<code>padding-left</code>'</dt>
<dt>'<code>padding-right</code>'</dt>
<dt>'<code>padding-top</code>'</dt>
<dt>'<code>width</code>'</dt>
<dd><p>If the property applies to the element or pseudo-element and the
<a href="#resolved-value">resolved value</a> of the '<code>display</code>' property is not
<code>none</code>, the <a href="#resolved-value">resolved value</a> is the
<span>used value</span>. Otherwise the <a href="#resolved-value">resolved value</a> is the
computed value.</dd>
<dt>Any other property</dt>
<dd><p>The <a href="#resolved-value">resolved value</a> is the computed value.</dd>
</dl>
<h2 id="iana-considerations"><span class="secno">9 </span>IANA Considerations</h2>
<h3 id="default-style"><span class="secno">9.1 </span><dfn title="http-default-style"><code>Default-Style</code></dfn></h3>
<p>This section describes a header field for registration in the Permanent
Message Header Field Registry.
<!--<a href="XXX">[RFC3864]</a>--></p>
<dl>
<dt>Header field name</dt>
<dd>Default-Style</dd>
<dt>Applicable protocol</dt>
<dd>http</dd>
<dt>Status</dt>
<dd>standard</dd>
<dt>Author/Change controller</dt>
<dd>W3C</dd>
<dt>Specification document(s)</dt>
<dd>This document is the relevant specification.</dd>
<dt>Related information</dt>
<dd>None.</dd>
</dl>
<h2 class="no-num" id="references">References</h2>
<h3 class="no-num" id="normative-references">Normative references</h3>
<div id="anolis-references-normative"><dl><dt id="refsDOMCORE">[DOMCORE]
<dd><cite><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html">DOM Core</a></cite>, A. van Kesteren and Ms2ger. W3C.
(Work in progress.)
<dt id="refsHTML">[HTML]
<dd><cite><a href="http://www.whatwg.org/html">HTML</a></cite>, I. Hickson. WHATWG.
(Work in progress.)
<dt id="refsRFC2119">[RFC2119]
<dd><cite><a href="http://www.ietf.org/rfc/rfc2119.txt">Key words for use in RFCs to Indicate Requirement Levels</a></cite>, S. Bradner. IETF.
<dt id="refsXML">[XML]
<dd><cite><a href="http://www.w3.org/TR/xml/">Extensible Markup Language</a></cite>, T. Bray, J. Paoli, C. Sperberg-McQueen et al.. W3C.
<dt id="refsXMLSS">[XMLSS]
<dd><cite><a href="http://www.w3.org/TR/xml-stylesheet/">Associating Style Sheets with XML documents 1.0 (Second Edition)</a></cite>, J. Clark, S. Pieters and H. S. Thompson. W3C.
</dl></div>
<h3 class="no-num" id="informative-references">Informative references</h3>
<div id="anolis-references-informative"></div>
<h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
<p>The editor would like to thank
Alexey Feldgendler,
Björn Höhrmann,
Christian Krebs,
Daniel Glazman,
David Baron,
<i>fantasai</i>,
Hallvord R. M. Steen,
Ian Hickson,
Lachlan Hunt,
Morten Stenshorne,
Philip Taylor,
Robert O'Callahan,
Sjoerd Visscher,
Simon Pieters,
Sylvain Galineau, and
Tarquin Wilton-Jones
for contributing to this specification.</p>
<p>And additional bonus thanks to Ian Hickson for writing up the the
initial version of the alternative style sheets API and canonicalization
(now serialization) rules for CSS values.</p>
<!-- XXX NOTES
<style type=text/css;charset=utf-8> does create a StyleSheet in Firefox
and Opera, but does not create a StyleSheet in IE. I prefer IE.
<style type=TEXT/CSS> sets the style sheet type to text/css in Firefox and
TEXT/CSS in Opera and IE. I prefer Firefox.
<style> sets the style sheet location to the document location Firefox,
the empty string in IE, and null in Opera. I prefer Opera
<style media="x"> invokes .sheet.media.mediaText = "x"
<style title=""> does not "have" a title
.cascadedStyle that returns less keywords than currentStyle, no inherit,
etc.
Markup style: http://krijnhoetmer.nl/irc-logs/whatwg/20100204#l-529
-->