Skip to content

Commit 799721b

Browse files
author
Simon Pieters
committed
[cssom] Specify what to do for dynamic changes to xml-stylesheet PIs
--HG-- extra : rebase_source : 757bd2b981c8dc20218a47129fa9a567ccbb0863
1 parent 2ac49ea commit 799721b

2 files changed

Lines changed: 65 additions & 23 deletions

File tree

cssom/Overview.html

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ <h2 class="no-num no-toc" id="toc">Table of Contents</h2>
159159
<ol>
160160
<li><a href="#the-linkstyle-interface"><span class="secno">6.3.1 </span>The <code title="">LinkStyle</code> Interface</a></li>
161161
<li><a href="#requirements-on-specifications"><span class="secno">6.3.2 </span>Requirements on specifications</a></li>
162-
<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 <code title="">xml-stylesheet</code> processing instruction</a></li>
162+
<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 xml-stylesheet processing instruction</a></li>
163163
<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
164164
<code title="">Link</code> Header</a></ol></li>
165165
<li><a href="#css-rules"><span class="secno">6.4 </span>CSS Rules</a>
@@ -1059,6 +1059,18 @@ <h3 id="css-style-sheet-collections"><span class="secno">6.2 </span>CSS Style Sh
10591059
<li><p>Set the <a href="#concept-css-style-sheet-disabled-flag" title="concept-css-style-sheet-disabled-flag">disabled flag</a>.</li>
10601060
</ol>
10611061

1062+
<p>To <dfn id="remove-a-css-style-sheet">remove a CSS style sheet</dfn>, run these steps:</p>
1063+
1064+
<ol>
1065+
<li><p>Remove the <a href="#css-style-sheet">CSS style sheet</a> from the list of <a href="#document-css-style-sheets">document CSS style sheets</a>.
1066+
1067+
<li><p>Set the <a href="#css-style-sheet">CSS style sheet</a>'s <a href="#concept-css-style-sheet-owner-node" title="concept-css-style-sheet-owner-node">owner node</a> to null.
1068+
1069+
<!-- "associated CSS style sheet" is defined in terms of owner node, so we don't need to set it to null explicitly -->
1070+
1071+
<!-- XXX does anything need to happen wrt alternate style sheets? what if the last style sheet with the preferred style sheet set name is removed? -->
1072+
</ol>
1073+
10621074
<p>A <dfn id="persistent-css-style-sheet">persistent CSS style sheet</dfn> is a
10631075
<a href="#css-style-sheet">CSS style sheet</a> from the <a href="#document-css-style-sheets">document CSS style sheets</a>
10641076
whose <a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a> is the empty string and whose
@@ -1476,21 +1488,32 @@ <h4 id="requirements-on-specifications"><span class="secno">6.3.2 </span>Require
14761488

14771489

14781490

1479-
<h4 id="requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction"><span class="secno">6.3.3 </span>Requirements on User Agents Implementing the <code title="">xml-stylesheet</code> processing instruction</h4>
1491+
<h4 id="requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction"><span class="secno">6.3.3 </span>Requirements on User Agents Implementing the xml-stylesheet processing instruction</h4>
14801492

1481-
<!-- XXX load/error events, reparse -->
1493+
<!-- XXX load/error events -->
14821494

14831495
<pre class="idl"><a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#processinginstruction">ProcessingInstruction</a> implements <a href="#linkstyle">LinkStyle</a>;</pre>
14841496

1485-
<p>For each
1486-
<a class="external" data-anolis-spec="xmlss" href="http://www.w3.org/TR/xml-stylesheet/#dt-xml-stylesheet"><code title="">xml-stylesheet</code> processing instruction</a>
1487-
that is not part of the
1488-
<a class="external" data-anolis-spec="xml" href="http://www.w3.org/TR/xml/#dt-doctype">document type declaration</a> and has an
1489-
<code title="">href</code>
1490-
<a class="external" data-anolis-spec="xmlss" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a> these steps must
1491-
(unless otherwise stated) be run:</p>
1497+
<p>The <dfn id="prolog">prolog</dfn> refers to <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-node" title="concept-node">nodes</a> that are children of the
1498+
<a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-document" title="concept-document">document</a> and are not <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-tree-following" title="concept-tree-following">following</a> the
1499+
<code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#element">Element</a></code> child of the <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-document" title="concept-document">document</a>, if any.
1500+
1501+
<p>When a <code class="external" data-anolis-spec="dom"><a href="http://dom.spec.whatwg.org/#processinginstruction">ProcessingInstruction</a></code> <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-node" title="concept-node">node</a> <var>node</var> is inserted to a
1502+
document, removed from a document, becomes part of the <a href="#prolog">prolog</a>, is no longer part of the <a href="#prolog">prolog</a>, or has its
1503+
<a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-cd-data" title="concept-cd-data">data</a> changed, these steps must be run:
14921504

14931505
<ol>
1506+
<li><p>If an instance of this algorithm is currently running for <var>node</var>, abort that instance, and stop the associated
1507+
<a class="external" data-anolis-spec="fetch" href="http://fetch.spec.whatwg.org/#concept-fetch" title="concept-fetch">fetching</a> if applicable.
1508+
1509+
<li><p>If <var>node</var> has an <a href="#associated-css-style-sheet">associated CSS style sheet</a>, <a href="#remove-a-css-style-sheet" title="remove a CSS style sheet">remove</a> it.
1510+
1511+
<li><p>If <var>node</var> is not an <a class="external" data-anolis-spec="xmlss" href="http://www.w3.org/TR/xml-stylesheet/#dt-xml-stylesheet">xml-stylesheet processing instruction</a>, terminate these steps.
1512+
1513+
<li><p>If <var>node</var> is part of the <a class="external" data-anolis-spec="xml" href="http://www.w3.org/TR/xml/#dt-doctype">document type declaration</a>, terminate these steps.
1514+
1515+
<li><p>If <var>node</var> does not have an <code title="">href</code> <a class="external" data-anolis-spec="xmlss" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a>, terminate these steps.
1516+
14941517
<li><p>Let <var>title</var> be the value of the
14951518
<code title="">title</code> <a class="external" data-anolis-spec="xmlss" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a> or the empty string if the
14961519
<code title="">title</code> <a class="external" data-anolis-spec="xmlss" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a> is not specified.</li>
@@ -1573,8 +1596,6 @@ <h4 id="requirements-on-user-agents-implementing-the-xml-stylesheet-processing-i
15731596
</ol>
15741597

15751598

1576-
1577-
15781599
<h4 id="requirements-on-user-agents-implementing-the-http-link-header"><span class="secno">6.3.4 </span>Requirements on User Agents Implementing the HTTP
15791600
<code title="">Link</code> Header</h4>
15801601

cssom/Overview.src.html

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,18 @@ <h3>CSS Style Sheet Collections</h3>
982982
<li><p>Set the <span title=concept-css-style-sheet-disabled-flag>disabled flag</span>.</li>
983983
</ol>
984984

985+
<p>To <dfn>remove a CSS style sheet</dfn>, run these steps:</p>
986+
987+
<ol>
988+
<li><p>Remove the <span>CSS style sheet</span> from the list of <span>document CSS style sheets</span>.
989+
990+
<li><p>Set the <span>CSS style sheet</span>'s <span title=concept-css-style-sheet-owner-node>owner node</span> to null.
991+
992+
<!-- "associated CSS style sheet" is defined in terms of owner node, so we don't need to set it to null explicitly -->
993+
994+
<!-- XXX does anything need to happen wrt alternate style sheets? what if the last style sheet with the preferred style sheet set name is removed? -->
995+
</ol>
996+
985997
<p>A <dfn>persistent CSS style sheet</dfn> is a
986998
<span>CSS style sheet</span> from the <span>document CSS style sheets</span>
987999
whose <span title=concept-css-style-sheet-title>title</span> is the empty string and whose
@@ -1399,21 +1411,32 @@ <h4>Requirements on specifications</h4>
13991411

14001412

14011413

1402-
<h4>Requirements on User Agents Implementing the <code title>xml-stylesheet</code> processing instruction</h4>
1414+
<h4>Requirements on User Agents Implementing the xml-stylesheet processing instruction</h4>
14031415

1404-
<!-- XXX load/error events, reparse -->
1416+
<!-- XXX load/error events -->
14051417

14061418
<pre class="idl"><span data-anolis-spec=dom>ProcessingInstruction</span> implements <span>LinkStyle</span>;</pre>
14071419

1408-
<p>For each
1409-
<span data-anolis-spec=xmlss><code title>xml-stylesheet</code> processing instruction</span>
1410-
that is not part of the
1411-
<span data-anolis-spec=xml>document type declaration</span> and has an
1412-
<code title>href</code>
1413-
<span data-anolis-spec=xmlss>pseudo-attribute</span> these steps must
1414-
(unless otherwise stated) be run:</p>
1420+
<p>The <dfn>prolog</dfn> refers to <span data-anolis-spec=dom title=concept-node>nodes</span> that are children of the
1421+
<span data-anolis-spec=dom title=concept-document>document</span> and are not <span data-anolis-spec=dom title=concept-tree-following>following</span> the
1422+
<code data-anolis-spec=dom>Element</code> child of the <span data-anolis-spec=dom title=concept-document>document</span>, if any.
1423+
1424+
<p>When a <code data-anolis-spec=dom>ProcessingInstruction</code> <span data-anolis-spec=dom title=concept-node>node</span> <var>node</var> is inserted to a
1425+
document, removed from a document, becomes part of the <span>prolog</span>, is no longer part of the <span>prolog</span>, or has its
1426+
<span data-anolis-spec=dom title=concept-cd-data>data</span> changed, these steps must be run:
14151427

14161428
<ol>
1429+
<li><p>If an instance of this algorithm is currently running for <var>node</var>, abort that instance, and stop the associated
1430+
<span data-anolis-spec=fetch title=concept-fetch>fetching</span> if applicable.
1431+
1432+
<li><p>If <var>node</var> has an <span>associated CSS style sheet</span>, <span title="remove a CSS style sheet">remove</span> it.
1433+
1434+
<li><p>If <var>node</var> is not an <span data-anolis-spec=xmlss>xml-stylesheet processing instruction</span>, terminate these steps.
1435+
1436+
<li><p>If <var>node</var> is part of the <span data-anolis-spec=xml>document type declaration</span>, terminate these steps.
1437+
1438+
<li><p>If <var>node</var> does not have an <code title>href</code> <span data-anolis-spec=xmlss>pseudo-attribute</span>, terminate these steps.
1439+
14171440
<li><p>Let <var>title</var> be the value of the
14181441
<code title>title</code> <span data-anolis-spec=xmlss>pseudo-attribute</span> or the empty string if the
14191442
<code title>title</code> <span data-anolis-spec=xmlss>pseudo-attribute</span> is not specified.</p></li>
@@ -1496,8 +1519,6 @@ <h4>Requirements on User Agents Implementing the <code title>xml-stylesheet</cod
14961519
</ol>
14971520

14981521

1499-
1500-
15011522
<h4>Requirements on User Agents Implementing the HTTP
15021523
<code title>Link</code> Header</h4>
15031524

0 commit comments

Comments
 (0)