-
Notifications
You must be signed in to change notification settings - Fork 791
Expand file tree
/
Copy pathOverview.html
More file actions
3233 lines (2615 loc) · 170 KB
/
Overview.html
File metadata and controls
3233 lines (2615 loc) · 170 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
<!DOCTYPE html><html lang="en-US"><head>
<meta charset="utf-8">
<title>CSS Object Model (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-ED" 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">CSS Object Model (CSSOM)</h1>
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 14 March 2012</h2>
<dl>
<dt>This Version:</dt>
<dd class="dontpublish"><a href="http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom/Overview.html">http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom/Overview.html</a></dd>
<dt class="dontpublish">Participate:</dt>
<dd class="dontpublish"><a href="mailto:www-style@w3.org?subject==%5Bcssom%5D%20">www-style@w3.org</a> (<a href="http://lists.w3.org/Archives/Public/www-style/">archives</a>)
<dd class="dontpublish"><a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=CSS&component=CSSOM">File a bug</a>
<dd class="dontpublish"><a href="http://wiki.whatwg.org/wiki/IRC">IRC: #css on Freenode</a>
<dt class="dontpublish">Previous Version:</dt>
<dd class="dontpublish"><a href="http://www.w3.org/TR/2011/WD-cssom-20110712/">http://www.w3.org/TR/2011/WD-cssom-20110712/</a></dd>
<dd class="dontpublish"><a href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/">http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/</a></dd>
<dt>Editors:</dt>
<dd><a href="http://www.w3.org/wiki/User:Gadams">Glenn Adams</a>
(<a href="http://www.cox.com/">Cox Communications, Inc.</a>)
<<a href="mailto:glenn.adams@cox.com">glenn.adams@cox.com</a>></dd>
<dd><a href="">Shane Stephens</a>
(<a href="http://www.google.com/">Google, Inc.</a>)
<<a href="mailto:shans@google.com">shans@google.com</a>></dd>
<dt>Previous 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>
<p class="dontpublish copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="http://i.creativecommons.org/p/zero/1.0/80x15.png"></a>
To the extent possible under law, the editors have waived all copyright and
related or neighboring rights to this work. In addition, as of
14 March 2012, the editors have made this specification available
under the <a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open
Web Foundation Agreement, Version 1.0</a>.</p>
</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>This is the 14 March 2012 Editor's Draft of CSSOM. Please send
comments to
<a href="mailto:www-style@w3.org?subject=%5Bcssom%5D%20">www-style@w3.org</a>
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
with <samp>[cssom]</samp> at the start of the subject line.
<p>This is the 14 March 2012 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.</p>
<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></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></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></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>DOM4</cite>,
<cite>HTML</cite>,
<cite>Associating Style Sheets with XML documents</cite>
and
<cite>XML</cite>
<a href="#refsDOM">[DOM]</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 or U+007F to
U+009F, the character
<a href="#serialize-a-character-as-code-point" title="serialize a character as code point">escaped as code point</a>.
<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>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 or U+007F to
U+009F, the character
<a href="#serialize-a-character-as-code-point" title="serialize a character as code point">escaped as code point</a>.
<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 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>Setting the <code title="dom-MediaList-mediaText"><a href="#dom-medialist-mediatext">mediaText</a></code>
attribute must run these steps:
<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 a string <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/multipage/urls.html#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 set or unset. Unset 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 set or unset. Unset by default.</p>
<p class="note">Even when unset it does not necessarily mean that the
<a href="#style-sheet">style sheet</a> is actually used for rendering.</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 return true if the <a href="#style-sheet-disabled-flag">style sheet disabled flag</a>
is set, or false otherwise.
<p>Setting the <code title="dom-StyleSheet-disabled"><a href="#dom-stylesheet-disabled">disabled</a></code>
attribute must set the <a href="#style-sheet-disabled-flag">style sheet disabled flag</a> if the new
value is true, or unset the <a href="#style-sheet-disabled-flag">style sheet disabled flag</a>
otherwise.
<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>;