8000 fix StyleSheetList.item(), StyleSheet.disabled and make some editoria… · w3c/csswg-drafts@81b53e5 · GitHub
Skip to content

Commit 81b53e5

Browse files
committed
fix StyleSheetList.item(), StyleSheet.disabled and make some editorial changes
1 parent f22d0fa commit 81b53e5

2 files changed

Lines changed: 204 additions & 170 deletions

File tree

cssom/Overview.html

Lines changed: 55 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
<div class=head>
2929
<h1 id=cssom>Cascading Style Sheets Object Model (<abbr>CSSOM</abbr>)</h1>
3030

31-
<h2 class="no-num no-toc" id="">Editor's draft <!--W3C Working Draft--> 22
32-
December 2006</h2>
31+
<h2 class="no-num no-toc" id="">Editor's draft <!--W3C Working Draft--> 15
32+
January 2007</h2>
3333

3434
<dl>
3535
<dt>This version:
3636

3737
<dd><a
38-
href="http://www.w3.org/TR/2006/WD-cssom-20061222">http://www.w3.org/TR/2006/WD-cssom-20061222/</a>
38+
href="http://www.w3.org/TR/2007/WD-cssom-20070115">http://www.w3.org/TR/2007/WD-cssom-20070115/</a>
3939

4040
<dt>Latest version:
4141

@@ -65,7 +65,8 @@ <h2 class="no-num no-toc" id=abstract>Abstract</h2>
6565

6666
<h2 class="no-num no-toc" id=sotd>Status of this Document</h2>
6767

68-
<p class=issue>This document is in its very early stages.
68+
<p class=issue>This document is in its very early stages. The intention is
69+
that this specification will in due course supercede DOM Level 2 Style.
6970

7071
<h2 class="no-num no-toc" id=toc>Table of Contents</h2>
7172
<!--begin-toc-->
@@ -286,11 +287,10 @@ <h3 id=history><span class=secno>1.1. </span>History</h3>
286287
href="http://www.w3.org/mid/Pine.LNX.4.05.10310302134070.1173-100000@lanalana.inria.fr"
287288
title="[CSSOM] CSSValue and related interfaces (message from the CSS
288289
WG)">have been obsoleted</a> because they where thought to be too akward
289-
for frequent use. This specification closes the gap by introducing
290-
interfaces for accessing values of properties that are "author-friendly."
290+
for frequent use. This specification no longer contains those features.
291291

292-
<p class=issue><code>DOMImplementationCSS</code> has been removed as well,
293-
because it doesn't seem to solve any use cases.
292+
<p>In addition, <code>DOMImplementationCSS</code> has been removed as well,
293+
because there was no use case provided in DOM Level 2 Style.
294294

295295
<h3 id=terminology><span class=secno>1.2. </span>Terminology and
296296
Conventions</h3>
@@ -302,8 +302,9 @@ <h3 id=terminology><span class=secno>1.2. </span>Terminology and
302302
<p>A <dfn id=color0>color component separator</dfn> is a literal U+002C
303303
COMMA followed by a U+0020 SPACE.
304304

305-
<p>When this specification talks about object <var>A</var> it generally
306-
means an object implementing interface <var>A</var>.</p>
305+
<p>When this specification talks about object <code><var>A</var></code>
306+
where <code><var>A</var></code> is actually an interface, it generally
307+
means an object implementing interface <code><var>A</var></code>.</p>
307308
<!--
308309
<p>The term <dfn id="whitespace">whitespace</dfn> when used in this
309310
specification refers to the U+0020 SPACE, U+0009 &lt;control>, U+000A
@@ -326,6 +327,9 @@ <h4 id=canon><span class=secno>1.2.1. </span>Canonicalization</h4>
326327
values are returned. Parsing is, after all, defined by various CSS
327328
specifications.
328329

330+
<p class=issue>This should probably be moved to the section on CSS style
331+
sheets.
332+
329333
<p>This section defines canonicalization of the various objects you
330334
typically encounter in <span>CSS style sheets</span>.
331335

@@ -640,6 +644,8 @@ <h6 id=examples0><span class=secno>1.2.1.3.1. </span>Examples</h6>
640644

641645
<h4 id=types><span class=secno>1.2.2. </span>Types of style sheets</h4>
642646

647+
<p class=issue>Move this to the document section...
648+
643649
<p>Each style sheet can have a title. A <a href="#style-sheet">style
644650
sheet</a> is said to <dfn id=style-sheet-title>have a title</dfn> if the
645651
<code>title</code> attribute on the <code><a
@@ -712,14 +718,15 @@ <h4 id=types><span class=secno>1.2.2. </span>Types of style sheets</h4>
712718
<h2 id=accessing><span class=secno>2. </span>Accessing style sheets through
713719
the DOM</h2>
714720

715-
<p>To get access to the <code><a href="#stylesheet">StyleSheet</a></code>
716-
objects representing the <a href="#associated" title="associated style
717-
sheet">associated style sheets</a> this section introduces the <code><a
718-
href="#linkstyle">LinkStyle</a></code> interface for accessing style
719-
sheets from a <code>Node</code> in the DOM and the <code><a
720-
href="#documentstyle">DocumentStyle</a></code> interface for accessing
721-
style sheets from the <code>Document</code> object. The latter also allows
722-
manipulating of style sheet sets (enabling and disabling them).
721+
<p>Each style sheet is represented by a <code><a
722+
href="#stylesheet">StyleSheet</a></code> object. These objects can be
723+
accessed through the <code><a href="#linkstyle">LinkStyle</a></code>
724+
interface implemented on individual <code>Node</code> objects or through
725+
the <code><a href="#documentstyle">DocumentStyle</a></code> interface
726+
implemented on the <code>Document</code> object. The <code><a
727+
href="#documentstyle">DocumentStyle</a></code> interface also provides an
728+
interface for enabling alternate style sheets and manipulating style sheet
729+
sets.
723730

724731
<h3 id=the-linkstyle><span class=secno>2.1. </span>The <code><a
725732
href="#linkstyle">LinkStyle</a></code> Interface</h3>
@@ -736,9 +743,10 @@ <h3 id=the-linkstyle><span class=secno>2.1. </span>The <code><a
736743
<code>HTMLStyleElement</code>. They <em class=ct>must</em> also implement
737744
it on objects implementing <code>HTMLMetaElement</code> if the
738745
<code>Link</code> HTTP header is supported. UAs supporting the
739-
<code>xml-stylesheet</code> processing instruction <em class=ct>must</em>
740-
implement <code><a href="#linkstyle">LinkStyle</a></code> on objects
741-
implementing <code>ProcessingInstruction</code>.
746+
<code>&lt;?xml-stylesheet?></code> processing instruction <em
747+
class=ct>must</em> implement <code><a
748+
href="#linkstyle">LinkStyle</a></code> on objects implementing
749+
<code>ProcessingInstruction</code>.
742750

743751
<p>Specifications introducing new ways of associating style sheets through
744752
the DOM <em class=ct>should</em> indicate which objects implement the
@@ -766,7 +774,7 @@ <h3 id=the-documentstyle><span class=secno>2.2. </span>The <code><a
766774
<p>Any object implementing the <code>Document</code> interface <em
767775
class=ct>must</em> also implement the <code><a
768776
href="#documentstyle">DocumentStyle</a></code> interface.</p>
769-
<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=200930 -->
777+
<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=200930 (FIXED) -->
770778

771779
<pre class=idl>interface <dfn id=documentstyle>DocumentStyle</dfn> {
772780
readonly attribute <a href="#stylesheetlist">StyleSheetList</a> <a href="#documentstyle-stylesheets">styleSheets</a>;
@@ -829,8 +837,8 @@ <h3 id=the-documentstyle><span class=secno>2.2. </span>The <code><a
829837

830838
<p>From the DOM's perspective, all views have the same <code><a
831839
href="#documentstyle-selectedStyleSheetSet">selectedStyleSheetSet</a></code>.
832-
If a UA supports multiple views with different selected alternate style
833-
sheets, then this attribute (and the <code><a
840+
If a user agent supports multiple views with different selected
841+
alternate style sheets, then this attribute (and the <code><a
834842
href="#stylesheet">StyleSheet</a></code> interface's
835843
<code>disabled</code> attribute) <em class=ct>must</em> return and set
836844
the value for the default view.</p>
@@ -931,24 +939,27 @@ <h3 id=the-stylesheetlist><span class=secno>2.3. </span>The <code><a
931939
<dt><dfn id=stylesheetlist-length><code>length</code></dfn>, of type
932940
<code>unsigned long</code>, readonly
933941

934-
<dd>This attribute <em class=ct>must</em> be the number of style sheets in
935-
the list.
942+
<dd>This attribute <em class=ct>must</em> be the number of style sheets
943+
currently in the list.
936944

937945
<dt><dfn id=stylesheetlist-item><code>item(<var>index</var>)</code></dfn>,
938946
method
939947

940948
<dd>When invoked, this method <em class=ct>must</em> return the <code><a
941949
href="#stylesheet">StyleSheet</a></code> in the list given by
942-
<var>index</var>. When there is no such <code><a
943-
href="#stylesheet">StyleSheet</a></code> it <em class=ct>must</em> return
944-
<code>null</code>.
950+
<var>index</var>. If <var>index</var> is less than zero then this method
951+
<em class=ct>must</em> raise an <code>INDEX_SIZE_ERR</code> exception. If
952+
<var>index</var> is greater than or equal to the number of style sheets
953+
currently in the list this method <em class=ct>must</em> return
954+
<code>null</code>.</dd>
955+
<!-- Internet Explorer throws an exception for [largevalue] as well. -->
945956
</dl>
946957

947958
<h3 id=dynamically><span class=secno>2.4. </span>Dynamically adding new
948959
style sheets</h3>
949960

950961
<p>If new style sheets <a href="#style-sheet-title" title="have a
951-
title">with titles</a> are added to the document, the UA <em
962+
title">with titles</a> are added to the document, the user agent <em
952963
class=ct>must</em> decide whether or not the style sheets should be
953964
initially enabled or not. How this happens depends on the exact state of
954965
the document at the time the style sheet is added, as follows.
@@ -964,8 +975,7 @@ <h4 id=adding><span class=secno>2.4.1. </span>Adding style sheets</h4>
964975
href="#documentstyle-preferredStyleSheetSet">preferredStyleSheetSet</a></code>
965976
attribute is set to the exact value of this style sheet's title. (This
966977
changes the preferred style sheet set, which causes further changes
967-
&mdash; see below.)</p>
968-
<!-- XXX: use a real character instead? -->
978+
&mdash; see below.)
969979

970980
<p>Then, for all sheets, if any of the following is true, then the style
971981
sheet <em class=ct>must</em> be <a href="#enabled" title="enabled style
@@ -1004,10 +1014,10 @@ <h4 id=changing><span class=secno>2.4.2. </span>Changing the preferred
10041014
href="#documentstyle-lastStyleSheetSet">lastStyleSheetSet</a></code>
10051015
attribute.
10061016

1007-
<p>If the UA has the preferred style sheet set changed, for example if it
1008-
receives a <code>Default-Style</code> HTTP header after it receives HTTP
1009-
<code>Link</code> headers implying another preferred style sheet, then the
1010-
<code><a
1017+
<p>If the user agent has the preferred style sheet set changed, for example
1018+
if it receives a <code>Default-Style</code> HTTP header after it receives
1019+
HTTP <code>Link</code> headers implying another preferred style sheet,
1020+
then the <code><a
10111021
href="#documentstyle-preferredStyleSheetSet">preferredStyleSheetSet</a></code>
10121022
attribute's value <em class=ct>must</em> be changed appropriately, and, if
10131023
the <code><a
@@ -1138,9 +1148,8 @@ <h3 id=forward><span class=secno>2.6. </span>Forward compatibility</h3>
11381148
<h3 id=the-stylesheet><span class=secno>2.7. </span>The <code><a
11391149
href="#stylesheet">StyleSheet</a></code> Interface</h3>
11401150

1141-
<p>Each style sheet has some basic information associated with it. The
1142-
<code><a href="#stylesheet">StyleSheet</a></code> interface provides
1143-
access to that information.
1151+
<p>Each style sheet is represented by a <code><a
1152+
href="#stylesheet">StyleSheet</a></code> object.
11441153

11451154
<pre class=idl>interface <dfn id=stylesheet>StyleSheet</dfn> {
11461155
readonly attribute DOMString <a href="#stylesheet-type" title=stylesheet-type>type</a>;
@@ -1172,7 +1181,7 @@ <h3 id=the-stylesheet><span class=secno>2.7. </span>The <code><a
11721181
title="enabled style sheet">enabled</a>.</p>
11731182

11741183
<p>On getting, this attribute <em class=ct>must</em> be <code>true</code>
1175-
when the style sheet is enabled and <code>false</code> otherwise.</p>
1184+
when the style sheet is disabled and <code>false</code> otherwise.</p>
11761185

11771186
<p>On setting, a value of <code>true</code> <em class=ct>must</em>
11781187
disable the style sheet and a value of <code>false</code> enables it.</p>
@@ -2204,6 +2213,7 @@ <h5 id=determining><span class=secno>4.2.2.1. </span>Determining <code><a
22042213
<h5 id=offsetleft><span class=secno>4.2.2.2. </span><code><a
22052214
href="#offsetleft0">offsetLeft</a></code> and <code><a
22062215
href="#offsetright">offsetRight</a></code></h5>
2216+
<!--XXX add something about the assumption that nothing is scrolled here?-->
22072217

22082218
<p>The <dfn id=offsetleft0><code>offsetLeft</code></dfn> attribute of
22092219
<code>Element</code> node <var>A</var> <em class=ct>must</em> be the
@@ -2326,6 +2336,8 @@ <h2 class=no-num id=acknowledgements>Acknowledgements</h2>
23262336

23272337
<li>Björn Höhrmann
23282338

2339+
<li>David Baron
2340+
23292341
<li>Hallvord R. M. Steen
23302342

23312343
<li>Ian Hickson
@@ -2342,6 +2354,9 @@ <h2 class=no-num id=acknowledgements>Acknowledgements</h2>
23422354

23432355
<li>Tarquin Wilton-Jones
23442356
</ul>
2357+
<!-- An additional thank you to Ian Hickson for writing the initial version
2358+
of the alternate style sheets API, canonicalization rules and proposals for
2359+
"author-friendly" interfaces. -->
23452360

23462361
<p>Also many thanks to the Windows Internet Explorer team for first
23472362
shipping many of the features introduced on <code><a

0 commit comments

Comments
 (0)