Skip to content

Commit 60761d9

Browse files
author
Simon Pieters
committed
[cssom] Cleanup around the properties of CSS style sheet
1 parent 5fb3697 commit 60761d9

2 files changed

Lines changed: 46 additions & 88 deletions

File tree

cssom/Overview.html

Lines changed: 23 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -864,39 +864,35 @@ <h3 id="css-style-sheets"><span class="secno">6.1 </span>CSS Style Sheets</h3>
864864
<dd><p>The literal string "<code title="">text/css</code>".</dd>
865865

866866
<dt><dfn id="concept-css-style-sheet-location" title="concept-css-style-sheet-location">location</dfn></dt>
867-
<dd><p>The <a class="external" href="http://url.spec.whatwg.org/#concept-absolute-url" title="concept-absolute-url">absolute URL</a> of the first request of the
867+
<dd><p>Specified when created. The <a class="external" href="http://url.spec.whatwg.org/#concept-absolute-url" title="concept-absolute-url">absolute URL</a> of the first request of the
868868
<a href="#css-style-sheet">CSS style sheet</a> or null if the <a href="#css-style-sheet">CSS style sheet</a> was
869-
embedded.</dd>
869+
embedded. Does not change during the lifetime of the <a href="#css-style-sheet">CSS style sheet</a>.</dd>
870870

871871
<dt><dfn id="concept-css-style-sheet-parent" title="concept-css-style-sheet-parent">parent</dfn></dt>
872-
<dd><p>The <a href="#css-style-sheet">CSS style sheet</a> that is the parent of the
872+
<dd><p>Specified when created. The <a href="#css-style-sheet">CSS style sheet</a> that is the parent of the
873873
<a href="#css-style-sheet">CSS style sheet</a> or null if there is no associated parent.</dd>
874874

875875
<dt><dfn id="concept-css-style-sheet-owner-node" title="concept-css-style-sheet-owner-node">owner node</dfn></dt>
876-
<dd><p>The DOM node associated with the <a href="#css-style-sheet">CSS style sheet</a> or
876+
<dd><p>Specified when created. The DOM node associated with the <a href="#css-style-sheet">CSS style sheet</a> or
877877
null if there is no associated DOM node.</dd>
878878

879879
<dt><dfn id="concept-css-style-sheet-owner-css-rule" title="concept-css-style-sheet-owner-css-rule">owner CSS rule</dfn></dt>
880-
<dd><p>The <a href="#css-rule">CSS rule</a> in the <a href="#concept-css-style-sheet-parent" title="concept-css-style-sheet-parent">parent</a>
880+
<dd><p>Specified when created. The <a href="#css-rule">CSS rule</a> in the <a href="#concept-css-style-sheet-parent" title="concept-css-style-sheet-parent">parent</a>
881881
that caused the inclusion of the <a href="#css-style-sheet">CSS style sheet</a> or null if
882882
there is no associated rule.</dd>
883883

884884
<dt><dfn id="concept-css-style-sheet-media" title="concept-css-style-sheet-media">media</dfn></dt>
885885
<dd>
886-
<p>The <code><a href="#medialist">MediaList</a></code> object associated with the
886+
<p>Specified when created. The <code><a href="#medialist">MediaList</a></code> object associated with the
887887
<a href="#css-style-sheet">CSS style sheet</a>.</p>
888888

889-
<p>If this property is set to a string run the
890-
<a href="#create-a-medialist-object">create a <code>MediaList</code> object</a> steps for that
891-
string and associate the returned object with the
892-
<a href="#css-style-sheet">CSS style sheet</a>.</p>
889+
<p>If this property is specified to a string, the <a href="#concept-css-style-sheet-media" title="concept-css-style-sheet-media">media</a> must be set to the return value of invoking
890+
<a href="#create-a-medialist-object">create a <code>MediaList</code> object</a> steps for that string.</p>
893891
</dd>
894892

895893
<dt><dfn id="concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</dfn></dt>
896894
<dd>
897-
<p>The title of the <a href="#css-style-sheet">CSS style sheet</a> or null if no title
898-
is specified or is the empty string, in which case the title is referred to
899-
as an empty title.</p>
895+
<p>Specified when created. The title of the <a href="#css-style-sheet">CSS style sheet</a>, which can be the empty string.</p>
900896

901897
<div class="example">
902898
<p>In the following, the <a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> is non-empty
@@ -915,7 +911,7 @@ <h3 id="css-style-sheets"><span class="secno">6.1 </span>CSS Style Sheets</h3>
915911

916912
<dt><dfn id="concept-css-style-sheet-alternate-flag" title="concept-css-style-sheet-alternate-flag">alternate flag</dfn></dt>
917913
<dd>
918-
<p>Either set or clear. Clear by default.</p>
914+
<p>Specified when created. Either set or clear. Clear by default.</p>
919915

920916
<div class="example">
921917
<p>The following <a href="#css-style-sheet" title="CSS style sheet">CSS style sheets</a> have
@@ -941,16 +937,10 @@ <h3 id="css-style-sheets"><span class="secno">6.1 </span>CSS Style Sheets</h3>
941937
<a href="#css-style-sheet">CSS style sheet</a>.</dd>
942938

943939
<dt><dfn id="concept-css-style-sheet-origin-clean-flag" title="concept-css-style-sheet-origin-clean-flag">origin-clean flag</dfn>
944-
<dd><p>Either set or clear. If it is set, the API allows reading and modifying of the <a href="#concept-css-style-sheet-css-rules" title="concept-css-style-sheet-css-rules">CSS rules</a>.
940+
<dd><p>Specified when created. Either set or clear. If it is set, the API allows reading and modifying of the <a href="#concept-css-style-sheet-css-rules" title="concept-css-style-sheet-css-rules">CSS
941+
rules</a>.
945942
</dl>
946943

947-
<p>When you are to <a href="#create-a-css-style-sheet">create a CSS style sheet</a> the above properties,
948-
with the exception of <a href="#concept-css-style-sheet-type" title="concept-css-style-sheet-type">type</a> and
949-
<a href="#concept-css-style-sheet-css-rules" title="concept-css-style-sheet-css-rules">CSS rules</a>, are to be set to
950-
their proper values.</p>
951-
952-
<!-- same-origin restrictions -->
953-
954944

955945
<h4 id="the-stylesheet-interface"><span class="secno">6.1.1 </span>The <code title="">StyleSheet</code> Interface</h4>
956946

@@ -979,7 +969,6 @@ <h4 id="the-stylesheet-interface"><span class="secno">6.1.1 </span>The <code tit
979969

980970
<p>The <dfn id="dom-stylesheet-href" title="dom-StyleSheet-href"><code>href</code></dfn> attribute must return the <a href="#concept-css-style-sheet-location" title="concept-css-style-sheet-location">location</a> or null if
981971
none.</p>
982-
<p class="XXX">What should the default value be if not known or specified upon creation? an empty string or null?</p>
983972

984973
<p>The <dfn id="dom-stylesheet-ownernode" title="dom-StyleSheet-ownerNode"><code>ownerNode</code></dfn> attribute must return the <a href="#concept-css-style-sheet-owner-node" title="concept-css-style-sheet-owner-node">owner
985974
node</a> or null if there is none.</p>
@@ -988,12 +977,9 @@ <h4 id="the-stylesheet-interface"><span class="secno">6.1.1 </span>The <code tit
988977
<a href="#concept-css-style-sheet-parent" title="concept-css-style-sheet-parent">parent</a> or null if there is none.</p>
989978

990979
<p>The <dfn id="dom-stylesheet-title" title="dom-StyleSheet-title"><code>title</code></dfn> attribute must return the <a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> or null if
991-
none.</p>
992-
<p class="XXX">What should the default value be if not known or specified upon creation? an empty string or null?</p>
980+
<a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> is the empty string.</p>
993981

994982
<p>The <dfn id="dom-stylesheet-media" title="dom-StyleSheet-media"><code>media</code></dfn> attribute must return the <a href="#concept-css-style-sheet-media" title="concept-css-style-sheet-media">media</a>.</p>
995-
<p class="XXX">Should it be nullable?</p>
996-
<p class="XXX">Need to define a setter that implements the semantics of setting this attribute to a string representing a MediaList.</p>
997983

998984
<p>The <dfn id="dom-stylesheet-disabled" title="dom-StyleSheet-disabled"><code>disabled</code></dfn> attribute, on getting, must return true if the
999985
<a href="#concept-css-style-sheet-disabled-flag" title="concept-css-style-sheet-disabled-flag">disabled flag</a>
@@ -1092,7 +1078,7 @@ <h3 id="css-style-sheet-collections"><span class="secno">6.2 </span>CSS Style Sh
10921078
<li><p>If the <a href="#concept-css-style-sheet-disabled-flag" title="concept-css-style-sheet-disabled-flag">disabled flag</a> is set, terminate
10931079
these steps.</li>
10941080

1095-
<li><p>If the <a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> is non-empty, the
1081+
<li><p>If the <a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> is not the empty string, the
10961082
<a href="#concept-css-style-sheet-alternate-flag" title="concept-css-style-sheet-alternate-flag">alternate flag</a> is clear, and
10971083
<a href="#preferred-css-style-sheet-set-name">preferred CSS style sheet set name</a> is the empty string
10981084
<a href="#change-the-preferred-css-style-sheet-set-name">change the preferred CSS style sheet set name</a> to the
@@ -1103,7 +1089,7 @@ <h3 id="css-style-sheet-collections"><span class="secno">6.2 </span>CSS Style Sh
11031089
<a href="#concept-css-style-sheet-disabled-flag" title="concept-css-style-sheet-disabled-flag">disabled flag</a> and terminate these steps:
11041090

11051091
<ul>
1106-
<li><p>The <a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> is empty.</li>
1092+
<li><p>The <a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> is the empty string.</li>
11071093
<li><p>The <a href="#last-css-style-sheet-set-name">last CSS style sheet set name</a> is null and the
11081094
<a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> is a
11091095
<a class="external" href="http://dom.spec.whatwg.org/#case-sensitive">case-sensitive</a> match
@@ -1302,8 +1288,8 @@ <h4 id="extensions-to-the-document-interface"><span class="secno">6.2.3 </span>E
13021288
<p>The <dfn id="dom-document-selectedstylesheetset" title="dom-Document-selectedStyleSheetSet"><code>selectedStyleSheetSet</code></dfn> attribute, on getting, must run these steps:</p>
13031289
<ol>
13041290
<li><p>If there is a single <a href="#enabled-css-style-sheet-set">enabled CSS style sheet set</a> and no
1305-
other <a href="#document-css-style-sheets">document CSS style sheets</a> with a non-empty
1306-
<a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> have the
1291+
other <a href="#document-css-style-sheets">document CSS style sheets</a> with a
1292+
<a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> that is not the empty string have the
13071293
<a href="#concept-css-style-sheet-disabled-flag" title="concept-css-style-sheet-disabled-flag">disabled flag</a> unset, return the
13081294
<a href="#css-style-sheet-set-name">CSS style sheet set name</a> of the
13091295
<a href="#enabled-css-style-sheet-set">enabled CSS style sheet set</a> and terminate these steps.</li>
@@ -1317,8 +1303,8 @@ <h4 id="extensions-to-the-document-interface"><span class="secno">6.2.3 </span>E
13171303
<p>Otherwise, return the empty string.</p>
13181304

13191305
<p class="note">At this point either all
1320-
<a href="#css-style-sheet" title="CSS style sheet">CSS style sheets</a> with a non-empty
1321-
<a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> have the
1306+
<a href="#css-style-sheet" title="CSS style sheet">CSS style sheets</a> with a
1307+
<a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> that is not the empty string have the
13221308
<a href="#concept-css-style-sheet-disabled-flag" title="concept-css-style-sheet-disabled-flag">disabled flag</a> set, or there are no such
13231309
<a href="#css-style-sheet" title="CSS style sheet">CSS style sheets</a>.</p>
13241310
</li>
@@ -1361,8 +1347,8 @@ <h4 id="extensions-to-the-document-interface"><span class="secno">6.2.3 </span>E
13611347
<li><p>If <var title="">name</var> is null terminate these steps.</li>
13621348
<li><p><a href="#enable-a-css-style-sheet-set">enable a CSS style sheet set</a> with name <var title="">name</var>.</li>
13631349
</ol>
1364-
<p class="note"><a href="#css-style-sheet" title="CSS style sheet">CSS style sheets</a> with an
1365-
empty <a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> are never affected by this method.
1350+
<p class="note"><a href="#css-style-sheet" title="CSS style sheet">CSS style sheets</a> with a
1351+
<a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> that is the empty string are never affected by this method.
13661352
This method does not change the values of the
13671353
<code title="dom-Document-lastStyleSheetSet"><a href="#dom-document-laststylesheetset">lastStyleSheetSet</a></code> or
13681354
<code title="dom-Document-preferredStyleSheetSet"><a href="#dom-document-preferredstylesheetset">preferredStyleSheetSet</a></code> attributes.</p>
@@ -1760,10 +1746,8 @@ <h3 id="css-rules"><span class="secno">6.4 </span>CSS Rules</h3>
17601746

17611747
<p>To <dfn id="parse-a-css-rule">parse a CSS rule</dfn> ...</p>
17621748

1763-
<p class="XXX">Should a rule be instantiated in OM if there is a parse error? To
1764-
what extent should original (but non-valid) CSS text be captured in cssText?</p>
1765-
1766-
<p>To <dfn id="serialize-a-css-rule">serialize a CSS rule</dfn>, perform one of the following in accordance with the <a href="#css-rule">CSS rule</a>'s <a href="#concept-css-rule-type" title="concept-css-rule-type">type</a>:</p>
1749+
<p>To <dfn id="serialize-a-css-rule">serialize a CSS rule</dfn>, perform one of the following in accordance with the <a href="#css-rule">CSS rule</a>'s
1750+
<a href="#concept-css-rule-type" title="concept-css-rule-type">type</a>:</p>
17671751

17681752
<dl class="switch">
17691753
<dt><code><a href="#cssstylerule">CSSStyleRule</a></code></dt>
@@ -1848,8 +1832,6 @@ <h3 id="css-rules"><span class="secno">6.4 </span>CSS Rules</h3>
18481832
<li><p>Insert <var title="">new rule</var> into <var title="">list</var> at the zero-indexed position <var title="">index</var>.<p></li>
18491833
<li><p>Return <var title="">index</var>.
18501834
</ol>
1851-
<p class="XXX">DOM-2 CSS specifies that a <code>NO_MODIFICATION_ALLOWED_ERR</code> exception is thrown
1852-
if the style sheet is read-only. Are there any read-only style sheets?</p>
18531835

18541836
<p>To <dfn id="remove-a-css-rule">remove a CSS rule</dfn> from a CSS rule list <var title="">list</var> at index <var title="">index</var>, follow these steps:</p>
18551837
<ol>
@@ -2154,9 +2136,6 @@ <h3 id="css-declaration-blocks"><span class="secno">6.5 </span>CSS Declaration B
21542136

21552137
<p>To <dfn id="parse-a-css-declaration-block">parse a CSS declaration block</dfn> ...</p>
21562138

2157-
<p class="XXX">What should be captured in the cssText of a declaration block which fails
2158-
to parse?</p>
2159-
21602139
<p>To <dfn id="serialize-a-css-declaration-block">serialize a CSS declaration block</dfn>
21612140
represented by a <code>CSSStyleDeclarations</code> instance named <var title="">d</var>,
21622141
let <var title="">s</var> be the empty string, then run the steps below:</p>

0 commit comments

Comments
 (0)