Skip to content

Commit ce7944f

Browse files
author
Simon Pieters
committed
[cssom] Make parentRule and parentStyleSheet not have seemingly conflicting requirements.
1 parent c2853a1 commit ce7944f

2 files changed

Lines changed: 22 additions & 20 deletions

File tree

cssom/Overview.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ <h4 id="the-cssstylesheet-interface"><span class="secno">6.1.2 </span>The <code
995995
//
996996
-->
997997

998-
<p>The <code><a href="#cssstylesheet">CSSStyleSheet</a></code> interface represents a CSS <a href="#css-style-sheet">CSS style sheet</a> rule.</p>
998+
<p>The <code><a href="#cssstylesheet">CSSStyleSheet</a></code> interface represents a <a href="#css-style-sheet">CSS style sheet</a>.</p>
999999
<pre class="idl">interface <dfn id="cssstylesheet">CSSStyleSheet</dfn> : <a href="#stylesheet">StyleSheet</a> {
10001000
readonly attribute <a href="#cssrule">CSSRule</a>? <a href="#dom-cssstylesheet-ownerrule" title="dom-CSSStyleSheet-ownerRule">ownerRule</a>;
10011001
readonly attribute <a href="#cssrulelist">CSSRuleList</a> <a href="#dom-cssstylesheet-cssrules" title="dom-CSSStyleSheet-cssRules">cssRules</a>;
@@ -1004,7 +1004,7 @@ <h4 id="the-cssstylesheet-interface"><span class="secno">6.1.2 </span>The <code
10041004
};</pre>
10051005

10061006
<p>The <dfn id="dom-cssstylesheet-ownerrule" title="dom-CSSStyleSheet-ownerRule"><code>ownerRule</code></dfn> attribute must return the <a href="#concept-css-style-sheet-owner-css-rule" title="concept-css-style-sheet-owner-css-rule">owner
1007-
CSS rule</a> or null if none. If a value other than null is ever returned, than that same value must always be returned on each get access.</p>
1007+
CSS rule</a>. If a value other than null is ever returned, then that same value must always be returned on each get access.</p>
10081008

10091009
<p>The <dfn id="dom-cssstylesheet-cssrules" title="dom-CSSStyleSheet-cssRules"><code>cssRules</code></dfn> attribute must follow these steps:
10101010

@@ -1725,12 +1725,12 @@ <h3 id="css-rules"><span class="secno">6.4 </span>CSS Rules</h3>
17251725
This item is initialized when a rule is created, and may change over the lifetime of the rule.</dd>
17261726

17271727
<dt><dfn id="concept-css-rule-parent-css-rule" title="concept-css-rule-parent-css-rule">parent CSS rule</dfn></dt>
1728-
<dd><p>An optional reference to another, enclosing <a href="#css-rule">CSS rule</a>.
1728+
<dd><p>A reference to an enclosing <a href="#css-rule">CSS rule</a> or null.
17291729
If the rule has an enclosing rule when it is created, then this item is initialized to the enclosing rule; otherwise it is null.
17301730
Subsequent to initialization, this item is reset to null if the rule becomes non-enclosed. Once reset to null, it must never change.</dd>
17311731

17321732
<dt><dfn id="concept-css-rule-parent-css-style-sheet" title="concept-css-rule-parent-css-style-sheet">parent CSS style sheet</dfn></dt>
1733-
<dd><p>An optional reference to an associated <a href="#css-style-sheet">CSS style sheet</a>.
1733+
<dd><p>A reference to a parent <a href="#css-style-sheet">CSS style sheet</a> or null.
17341734
This item is initialized to reference an associated style sheet when the rule is created. Subsequent to initialization, this item
17351735
is reset to null if the rule becomes disassociated from its initial style sheet. Once reset to null, it must never change.</dd>
17361736

@@ -1932,13 +1932,13 @@ <h4 id="the-cssrule-interface"><span class="secno">6.4.2 </span>The <code title=
19321932
<li><p>Replace the current object with <var>new rule</var>.</li>
19331933
</ol>
19341934

1935-
<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
1936-
there is none. If a value other than null is ever returned, than that same value must always be returned on each get access.</p>
1935+
<p>The <dfn id="dom-cssrule-parentrule" title="dom-CSSRule-parentRule"><code>parentRule</code></dfn> attribute must return the <a href="#concept-css-rule-parent-css-rule" title="concept-css-rule-parent-css-rule">parent CSS
1936+
rule</a>.</p>
19371937
<p class="note">For example, <code title="">@media</code> can enclose a rule, in which case <code title="dom-CSSRule-parentRule"><a href="#dom-cssrule-parentrule">parentRule</a></code> would
1938-
be non-null; in cases where there is no enclosing rule, <code title="dom-CSSRule-parentRule"><a href="#dom-cssrule-parentrule">ownerRule</a></code> will be null.</p>
1938+
be non-null; in cases where there is no enclosing rule, <code title="dom-CSSRule-parentRule"><a href="#dom-cssrule-parentrule">parentRule</a></code> will be null.</p>
19391939

1940-
<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
1941-
current rule or null if there is none.</p>
1940+
<p>The <dfn id="dom-cssrule-parentstylesheet" title="dom-CSSRule-parentStyleSheet"><code>parentStyleSheet</code></dfn> attribute must return the
1941+
<a href="#concept-css-rule-parent-css-style-sheet" title="concept-css-rule-parent-css-style-sheet">parent CSS style sheet</a>.</p>
19421942
<p class="note">The only circumstance where null is returned when a rule has been <a href="#remove-a-css-rule" title="remove a CSS rule">removed</a>.</p>
19431943
<p class="note">Removing a <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#node">Node</a></code> that implements the <code><a href="#linkstyle">LinkStyle</a></code> interface from a
19441944
<code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> instance does not (by itself) cause the <code><a href="#cssstylesheet">CSSStyleSheet</a></code> referenced by a <code><a href="#cssrule">CSSRule</a></code> to be
@@ -1961,7 +1961,8 @@ <h4 id="the-cssstylerule-interface"><span class="secno">6.4.3 </span>The <code t
19611961

19621962
<pre class="idl">interface <dfn id="cssstylerule">CSSStyleRule</dfn> : <a href="#cssrule">CSSRule</a> {
19631963
attribute DOMString <a href="#dom-cssstylerule-selectortext" title="dom-CSSStyleRule-selectorText">selectorText</a>;
1964-
[PutForwards=<a href="#dom-cssstyledeclaration-csstext" title="dom-CSSStyleDeclaration-cssText">cssText</a>] readonly attribute <a href="#cssstyledeclaration">CSSStyleDeclaration</a> <a href="#dom-cssstylerule-style" title="dom-CSSStyleRule-style">style</a>;
1964+
[PutForwards=<a href="#dom-cssstyledeclaration-csstext" title="dom-CSSStyleDeclaration-cssText">cssText</a>] readonly attribute <a href="#cssstyledeclaration">CSSStyleDeclaration</a> <!--
1965+
--><a href="#dom-cssstylerule-style" title="dom-CSSStyleRule-style">style</a>;
19651966
};</pre>
19661967

19671968
<p>The <dfn id="dom-cssstylerule-selectortext" title="dom-CSSStyleRule-selectorText"><code>selectorText</code></dfn> attribute, on getting, must return the result of

cssom/Overview.src.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ <h4>The <code title>CSSStyleSheet</code> Interface</h4>
918918
//
919919
-->
920920

921-
<p>The <code>CSSStyleSheet</code> interface represents a CSS <span>CSS style sheet</span> rule.</p>
921+
<p>The <code>CSSStyleSheet</code> interface represents a <span>CSS style sheet</span>.</p>
922922
<pre class=idl>interface <dfn>CSSStyleSheet</dfn> : <span>StyleSheet</span> {
923923
readonly attribute <span>CSSRule</span>? <span title=dom-CSSStyleSheet-ownerRule>ownerRule</span>;
924924
readonly attribute <span>CSSRuleList</span> <span title=dom-CSSStyleSheet-cssRules>cssRules</span>;
@@ -927,7 +927,7 @@ <h4>The <code title>CSSStyleSheet</code> Interface</h4>
927927
};</pre>
928928

929929
<p>The <dfn title=dom-CSSStyleSheet-ownerRule><code>ownerRule</code></dfn> attribute must return the <span title=concept-css-style-sheet-owner-css-rule>owner
930-
CSS rule</span> or null if none. If a value other than null is ever returned, than that same value must always be returned on each get access.</p>
930+
CSS rule</span>. If a value other than null is ever returned, then that same value must always be returned on each get access.</p>
931931

932932
<p>The <dfn title=dom-CSSStyleSheet-cssRules><code>cssRules</code></dfn> attribute must follow these steps:
933933

@@ -1648,12 +1648,12 @@ <h3>CSS Rules</h3>
16481648
This item is initialized when a rule is created, and may change over the lifetime of the rule.</p></dd>
16491649

16501650
<dt><dfn title=concept-css-rule-parent-css-rule>parent CSS rule</dfn></dt>
1651-
<dd><p>An optional reference to another, enclosing <span>CSS rule</span>.
1651+
<dd><p>A reference to an enclosing <span>CSS rule</span> or null.
16521652
If the rule has an enclosing rule when it is created, then this item is initialized to the enclosing rule; otherwise it is null.
16531653
Subsequent to initialization, this item is reset to null if the rule becomes non-enclosed. Once reset to null, it must never change.</p></dd>
16541654

16551655
<dt><dfn title=concept-css-rule-parent-css-style-sheet>parent CSS style sheet</dfn></dt>
1656-
<dd><p>An optional reference to an associated <span>CSS style sheet</span>.
1656+
<dd><p>A reference to a parent <span>CSS style sheet</span> or null.
16571657
This item is initialized to reference an associated style sheet when the rule is created. Subsequent to initialization, this item
16581658
is reset to null if the rule becomes disassociated from its initial style sheet. Once reset to null, it must never change.</p></dd>
16591659

@@ -1855,13 +1855,13 @@ <h4>The <code title>CSSRule</code> Interface</h4>
18551855
<li><p>Replace the current object with <var>new rule</var>.</p></li>
18561856
</ol>
18571857

1858-
<p>The <dfn title=dom-CSSRule-parentRule><code>parentRule</code></dfn> attribute must return the nearest enclosing rule of the current rule or null if
1859-
there is none. If a value other than null is ever returned, than that same value must always be returned on each get access.</p>
1858+
<p>The <dfn title=dom-CSSRule-parentRule><code>parentRule</code></dfn> attribute must return the <span title=concept-css-rule-parent-css-rule>parent CSS
1859+
rule</span>.</p>
18601860
<p class='note'>For example, <code title>@media</code> can enclose a rule, in which case <code title=dom-CSSRule-parentRule>parentRule</code> would
1861-
be non-null; in cases where there is no enclosing rule, <code title=dom-CSSRule-parentRule>ownerRule</code> will be null.</p>
1861+
be non-null; in cases where there is no enclosing rule, <code title=dom-CSSRule-parentRule>parentRule</code> will be null.</p>
18621862

1863-
<p>The <dfn title=dom-CSSRule-parentStyleSheet><code>parentStyleSheet</code></dfn> attribute must return the <code>CSSStyleSheet</code> object that contains the
1864-
current rule or null if there is none.</p>
1863+
<p>The <dfn title=dom-CSSRule-parentStyleSheet><code>parentStyleSheet</code></dfn> attribute must return the
1864+
<span title=concept-css-rule-parent-css-style-sheet>parent CSS style sheet</span>.</p>
18651865
<p class='note'>The only circumstance where null is returned when a rule has been <span title="remove a CSS rule">removed</span>.</p>
18661866
<p class='note'>Removing a <code data-anolis-spec=dom>Node</code> that implements the <code>LinkStyle</code> interface from a
18671867
<code data-anolis-spec=dom>Document</code> instance does not (by itself) cause the <code>CSSStyleSheet</code> referenced by a <code>CSSRule</code> to be
@@ -1884,7 +1884,8 @@ <h4>The <code title>CSSStyleRule</code> Interface</h4>
18841884

18851885
<pre class=idl>interface <dfn>CSSStyleRule</dfn> : <span>CSSRule</span> {
18861886
attribute DOMString <span title=dom-CSSStyleRule-selectorText>selectorText</span>;
1887-
[PutForwards=<span title=dom-CSSStyleDeclaration-cssText>cssText</span>] readonly attribute <span>CSSStyleDeclaration</span> <span title=dom-CSSStyleRule-style>style</span>;
1887+
[PutForwards=<span title=dom-CSSStyleDeclaration-cssText>cssText</span>] readonly attribute <span>CSSStyleDeclaration</span> <!--
1888+
--><span title=dom-CSSStyleRule-style>style</span>;
18881889
};</pre>
18891890

18901891
<p>The <dfn title=dom-CSSStyleRule-selectorText><code>selectorText</code></dfn> attribute, on getting, must return the result of

0 commit comments

Comments
 (0)