Skip to content

Commit a7784ef

Browse files
committed
[cssom] Make LinkStyle.style nullable; editorial clean up.
1 parent a7f9f97 commit a7784ef

3 files changed

Lines changed: 26 additions & 18 deletions

File tree

cssom/Overview.html

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,26 +1328,30 @@ <h4 id="the-linkstyle-interface"><span class="secno">6.3.1 </span>The <code>Link
13281328
<p>The <dfn id="associated-style-sheet">associated style sheet</dfn> of a node is the <span>style sheet</span> 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>LinkStyle</code> interface.</p>
13291329
<pre class="idl"><span class="idlInterface" id="widl-def-LinkStyle">[NoInterfaceObject]
13301330
interface <span class="idlInterfaceID">LinkStyle</span> {
1331-
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>StyleSheet</a></span> <span class="idlAttrName"><a href="#widl-LinkStyle-sheet">sheet</a></span>;</span>
1331+
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>StyleSheet</a>?</span> <span class="idlAttrName"><a href="#widl-LinkStyle-sheet">sheet</a></span>;</span>
13321332
};</span></pre>
13331333
<dl class="attributes">
13341334
<dt class="attribute" id="widl-LinkStyle-sheet">
1335-
<code>sheet</code> of type <span class="idlAttrType"><a>StyleSheet</a></span>, readonly</dt>
1335+
<code>sheet</code> of type <span class="idlAttrType"><a>StyleSheet</a>?</span>, readonly</dt>
13361336
<dd>
1337-
<p>The <code>sheet</code> attribute must return the <a href="#associated-style-sheet">associated style sheet</a> for the node, or <code>null</code>, if there is no <a href="#associated-style-sheet">associated style sheet</a>.</dd>
1337+
<p>The <code>sheet</code> attribute must return the <a href="#associated-style-sheet">associated style sheet</a> for the node or <code>null</code> if there is no <a href="#associated-style-sheet">associated style sheet</a>.</dd>
13381338
</dl>
13391339

13401340

13411341
<div class="example">
1342-
<p>In the following HTML snippet the first HTML <code>style</code>
1342+
<p>In the following fragment, the first <code>style</code>
13431343
element has a <code>sheet</code> attribute that returns a
13441344
<code>StyleSheet</code> object representing the style sheet, but for
1345-
the second <code>style</code> attribute it returns <code>null</code>.
1346-
(Assuming the user agent supports CSS (<code>text/css</code>) and does
1347-
not support ExampleSheets (<code>text/example-sheets</code>).</p>
1345+
the second <code>style</code> element, the <code>style</code> attribute returns <code>null</code>,
1346+
assuming the user agent supports CSS (<code>text/css</code>), but does
1347+
not support the (hypothetical) ExampleSheets (<code>text/example-sheets</code>).</p>
13481348

1349-
<pre>&lt;style type=text/css&gt; body { background:lime } &lt;/style&gt;
1350-
&lt;style type=text/example-sheets&gt; $(body).background := lime &lt;/style&gt;</pre>
1349+
<pre>&lt;style type="text/css"&gt;
1350+
body { background:lime }
1351+
&lt;/style&gt;</pre>
1352+
<pre>&lt;style type="text/example-sheets"&gt;
1353+
$(body).background := lime
1354+
&lt;/style&gt;</pre>
13511355
</div>
13521356

13531357
<p class="note">Whether or not the node refers to a style sheet is defined

cssom/cssom-source

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,15 +1112,19 @@
11121112
<!--{@idl(LinkStyle)}-->
11131113

11141114
<div class="example">
1115-
<p>In the following HTML snippet the first HTML <code>style</code>
1115+
<p>In the following fragment, the first <code>style</code>
11161116
element has a <code>sheet</code> attribute that returns a
11171117
<code>StyleSheet</code> object representing the style sheet, but for
1118-
the second <code>style</code> attribute it returns <code>null</code>.
1119-
(Assuming the user agent supports CSS (<code>text/css</code>) and does
1120-
not support ExampleSheets (<code>text/example-sheets</code>).</p>
1121-
1122-
<pre>&lt;style type=text/css> body { background:lime } &lt;/style>
1123-
&lt;style type=text/example-sheets> $(body).background := lime &lt;/style></pre>
1118+
the second <code>style</code> element, the <code>style</code> attribute returns <code>null</code>,
1119+
assuming the user agent supports CSS (<code>text/css</code>), but does
1120+
not support the (hypothetical) ExampleSheets (<code>text/example-sheets</code>).</p>
1121+
1122+
<pre>&lt;style type="text/css"&gt;
1123+
body { background:lime }
1124+
&lt;/style&gt;</pre>
1125+
<pre>&lt;style type="text/example-sheets"&gt;
1126+
$(body).background := lime
1127+
&lt;/style&gt;</pre>
11241128
</div>
11251129

11261130
<p class="note">Whether or not the node refers to a style sheet is defined

cssom/idl/LinkStyle.idl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
interface LinkStyle {
77

88
[Documentation=
9-
"<p>The {@name} {@type} must return the <span>associated style sheet</span> for the node, or <code>null</code>,\
9+
"<p>The {@name} {@type} must return the <span>associated style sheet</span> for the node or <code>null</code>\
1010
if there is no <span>associated style sheet</span>.</p>"
1111
]
12-
readonly attribute StyleSheet sheet;
12+
readonly attribute StyleSheet? sheet;
1313

1414
};
1515

0 commit comments

Comments
 (0)