[cssom] Disallow reading and modifying of cross-origin sheets. Integrate with URL and Fetch specs for xml-stylesheet and Link:. Only expose pre-redirect URL of a sheet.
authorSimon Pieters <simonp@opera.com>
Fri, 07 Jun 2013 14:43:47 +0200
changeset 8372b3a214e224d7
parent 8371 ca20cc414744
child 8373 37cd62aced08
[cssom] Disallow reading and modifying of cross-origin sheets. Integrate with URL and Fetch specs for xml-stylesheet and Link:. Only expose pre-redirect URL of a sheet.
cssom/Overview.html
cssom/Overview.src.html
     1.1 --- a/cssom/Overview.html	Fri Jun 07 10:32:38 2013 +0200
     1.2 +++ b/cssom/Overview.html	Fri Jun 07 14:43:47 2013 +0200
     1.3 @@ -265,14 +265,14 @@
     1.4  <cite>DOM</cite>,
     1.5  <cite>HTML</cite>,
     1.6  <cite>URL</cite>,
     1.7 -<!--<cite>Fetch</cite>,-->
     1.8 +<cite>Fetch</cite>,
     1.9  <cite>Associating Style Sheets with XML documents</cite>
    1.10  and
    1.11  <cite>XML</cite>.
    1.12  <a href="#refsDOM">[DOM]</a>
    1.13  <a href="#refsHTML">[HTML]</a>
    1.14  <a href="#refsURL">[URL]</a>
    1.15 -<!--<span data-anolis-ref>CORS</span>-->
    1.16 +<a href="#refsFETCH">[FETCH]</a>
    1.17  <a href="#refsXMLSS">[XMLSS]</a>
    1.18  <a href="#refsXML">[XML]</a>
    1.19  
    1.20 @@ -864,7 +864,7 @@
    1.21   <dd><p>The literal string "<code title="">text/css</code>".</dd>
    1.22  
    1.23   <dt><dfn id="concept-css-style-sheet-location" title="concept-css-style-sheet-location">location</dfn></dt>
    1.24 - <dd><p>The <a class="external" href="http://url.spec.whatwg.org/#concept-url" title="concept-url">URL</a> of the
    1.25 + <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
    1.26   <a href="#css-style-sheet">CSS style sheet</a> or null if the <a href="#css-style-sheet">CSS style sheet</a> was
    1.27   embedded.</dd>
    1.28  
    1.29 @@ -939,6 +939,9 @@
    1.30   <dt><dfn id="concept-css-style-sheet-css-rules" title="concept-css-style-sheet-css-rules">CSS rules</dfn></dt>
    1.31   <dd><p>The <a href="#css-rule" title="CSS rule">CSS rules</a> associated with the
    1.32   <a href="#css-style-sheet">CSS style sheet</a>.</dd>
    1.33 + 
    1.34 + <dt><dfn id="concept-css-style-sheet-origin-clean-flag" title="concept-css-style-sheet-origin-clean-flag">origin-clean flag</dfn>
    1.35 + <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>.
    1.36  </dl>
    1.37  
    1.38  <p>When you are to <a href="#create-a-css-style-sheet">create a CSS style sheet</a> the above properties,
    1.39 @@ -1020,19 +1023,35 @@
    1.40  <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
    1.41  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>
    1.42  
    1.43 -<p>The <dfn id="dom-cssstylesheet-cssrules" title="dom-CSSStyleSheet-cssRules"><code>cssRules</code></dfn> attribute must return a read-only, live <code><a href="#cssrulelist">CSSRuleList</a></code> object representing
    1.44 -the <a href="#concept-css-style-sheet-css-rules" title="concept-css-style-sheet-css-rules">CSS rules</a>. The same object must be returned on each get access.</p>
    1.45 -<p class="note">Even though the returned <code><a href="#cssrulelist">CSSRuleList</a></code> object is read-only (from the perspective of
    1.46 -client-authored script), it can nevertheless change over time due to its liveness status. For example, invoking
    1.47 -the <code title="dom-CSSStyleSheet-insertRule"><a href="#dom-cssstylesheet-insertrule">insertRule()</a></code> or <code title="dom-CSSStyleSheet-deleteRule"><a href="#dom-cssstylesheet-deleterule">deleteRule()</a></code> methods can result in mutations
    1.48 -reflected in the returned object.</p>
    1.49 -
    1.50 -<p>The <dfn id="dom-cssstylesheet-insertrule" title="dom-CSSStyleSheet-insertRule"><code>insertRule(<var title="">rule</var>, <var title="">index</var>)</code></dfn> method must <a href="#insert-a-css-rule">insert a CSS
    1.51 -rule</a> <var title="">rule</var> in the CSS rule list returned by <code title="dom-CSSStyleSheet-cssRules"><a href="#dom-cssstylesheet-cssrules">cssRules</a></code> at <var title="">index</var>, and return
    1.52 -<var title="">index</var>.
    1.53 -
    1.54 -<p>The <dfn id="dom-cssstylesheet-deleterule" title="dom-CSSStyleSheet-deleteRule"><code>deleteRule(<var title="">index</var>)</code></dfn> method must <a href="#remove-a-css-rule">remove a CSS rule</a> in the CSS rule
    1.55 -list returned by <code title="dom-CSSStyleSheet-cssRules"><a href="#dom-cssstylesheet-cssrules">cssRules</a></code> at <var title="">index</var>.
    1.56 +<p>The <dfn id="dom-cssstylesheet-cssrules" title="dom-CSSStyleSheet-cssRules"><code>cssRules</code></dfn> attribute must follow these steps:
    1.57 +
    1.58 +<ol>
    1.59 + <li><p>If the <a href="#concept-css-style-sheet-origin-clean-flag" title="concept-css-style-sheet-origin-clean-flag">origin-clean flag</a> is clear,
    1.60 + <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> a <code class="external"><a href="http://dom.spec.whatwg.org/#securityerror">SecurityError</a></code> exception.
    1.61 + <li><p>Return a read-only, live <code><a href="#cssrulelist">CSSRuleList</a></code> object representing
    1.62 + the <a href="#concept-css-style-sheet-css-rules" title="concept-css-style-sheet-css-rules">CSS rules</a>. The same object must be returned on each get access.</p>
    1.63 + <p class="note">Even though the returned <code><a href="#cssrulelist">CSSRuleList</a></code> object is read-only (from the perspective of
    1.64 + client-authored script), it can nevertheless change over time due to its liveness status. For example, invoking
    1.65 + the <code title="dom-CSSStyleSheet-insertRule"><a href="#dom-cssstylesheet-insertrule">insertRule()</a></code> or <code title="dom-CSSStyleSheet-deleteRule"><a href="#dom-cssstylesheet-deleterule">deleteRule()</a></code> methods can result in
    1.66 + mutations reflected in the returned object.</p>
    1.67 +</ol>
    1.68 +
    1.69 +<p>The <dfn id="dom-cssstylesheet-insertrule" title="dom-CSSStyleSheet-insertRule"><code>insertRule(<var title="">rule</var>, <var title="">index</var>)</code></dfn> method must run the following steps:
    1.70 +
    1.71 +<ol>
    1.72 + <li><p>If the <a href="#concept-css-style-sheet-origin-clean-flag" title="concept-css-style-sheet-origin-clean-flag">origin-clean flag</a> is clear,
    1.73 + <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> a <code class="external"><a href="http://dom.spec.whatwg.org/#securityerror">SecurityError</a></code> exception.
    1.74 + <li><p>Return the result of invoking <a href="#insert-a-css-rule">insert a CSS rule</a> <var title="">rule</var> in the <a href="#concept-css-style-sheet-css-rules" title="concept-css-style-sheet-css-rules">CSS rules</a>
    1.75 + at <var title="">index</var>.
    1.76 +</ol>
    1.77 +
    1.78 +<p>The <dfn id="dom-cssstylesheet-deleterule" title="dom-CSSStyleSheet-deleteRule"><code>deleteRule(<var title="">index</var>)</code></dfn> method must run the following steps:
    1.79 +
    1.80 +<ol>
    1.81 + <li><p>If the <a href="#concept-css-style-sheet-origin-clean-flag" title="concept-css-style-sheet-origin-clean-flag">origin-clean flag</a> is clear,
    1.82 + <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> a <code class="external"><a href="http://dom.spec.whatwg.org/#securityerror">SecurityError</a></code> exception.
    1.83 + <li><p><a href="#remove-a-css-rule">Remove a CSS rule</a> in the <a href="#concept-css-style-sheet-css-rules" title="concept-css-style-sheet-css-rules">CSS rules</a> at <var title="">index</var>.
    1.84 +</ol>
    1.85  
    1.86  <h3 id="css-style-sheet-collections"><span class="secno">6.2 </span>CSS Style Sheet Collections</h3>
    1.87  
    1.88 @@ -1543,22 +1562,38 @@
    1.89   value is not a <a href="#supported-styling-language">supported styling language</a> the user agent
    1.90   may terminate these steps.</li>
    1.91  
    1.92 - <li><p><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#resolve-a-url" title="Resolve a URL">Resolve</a>
    1.93 - the <a class="external" href="http://url.spec.whatwg.org/#concept-url" title="concept-url">URL</a> specified by the
    1.94 - <code title="">href</code> <a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a> and then
    1.95 - <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch">fetch</a> it.</li>
    1.96 -
    1.97 - <li>
    1.98 -  <p>When the resource is available, the document is in
    1.99 -  <a class="external" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>
   1.100 -  and the
   1.101 -  <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type metadata</a> of
   1.102 -  the resource is not a <a href="#supported-styling-language">supported styling language</a> change the
   1.103 -  <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type metadata</a> of the resource
   1.104 -  to <code title="">text/css</code>.</p>
   1.105 - </li>
   1.106 -
   1.107 - <li><p>If the resource is not in a
   1.108 + <li><p>Let <var title="">input URL</var> be the value specified by the
   1.109 + <code title="">href</code> <a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a>.
   1.110 + 
   1.111 + <li><p>Let <var title="">base URL</var> be the processing instruction's <a class="external" href="http://dom.spec.whatwg.org/#concept-node-document" title="concept-node-document">node document</a>'s
   1.112 + <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#document-base-url">document base URL</a>.
   1.113 + 
   1.114 + <li><p>Let <var title="">origin</var> be the processing instruction's <a class="external" href="http://dom.spec.whatwg.org/#concept-node-document" title="concept-node-document">node document</a>'s
   1.115 + <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a>.
   1.116 +
   1.117 + <li><p>Let <var title="">parsed URL</var> be the return value of invoking the <a class="external" href="http://url.spec.whatwg.org/#concept-url-parser" title="concept-url-parser">URL parser</a> with the
   1.118 + string <var title="">input URL</var> and the base URL <var title="">base URL</var>.
   1.119 + 
   1.120 + <li><p>If <var title="">parsed URL</var> is failure, terminate these steps.
   1.121 + 
   1.122 + <li><p>Let <var title="">request</var> be a new <a class="external" href="http://fetch.spec.whatwg.org/#concept-request" title="concept-request">request</a>, with the
   1.123 + <a class="external" href="http://fetch.spec.whatwg.org/#concept-request-url" title="concept-request-url">url</a> <var title="">parsed URL</var>,
   1.124 + <a class="external" href="http://fetch.spec.whatwg.org/#concept-request-origin" title="concept-request-origin">origin</a> <var title="">origin</var> and
   1.125 + <a class="external" href="http://fetch.spec.whatwg.org/#concept-request-referrer" title="concept-request-referrer">referrer</a> <var title="">base URL</var>.
   1.126 +
   1.127 + <li><p>Let <var title="">response</var> be the result of <a class="external" href="http://fetch.spec.whatwg.org/#concept-fetch" title="concept-fetch">fetching</a> <var title="">request</var>.</li>
   1.128 +
   1.129 + <li><p>Wait until <var title="">response</var> is available.
   1.130 + 
   1.131 + <li><p>If <var title="">response</var> is a <a class="external" href="http://fetch.spec.whatwg.org/#concept-network-error" title="concept-network-error">network error</a>, terminate these steps.
   1.132 + 
   1.133 + <li><p>If the processing instruction's <a class="external" href="http://dom.spec.whatwg.org/#concept-node-document" title="concept-node-document">node document</a> is
   1.134 + in <a class="external" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, <var title="">response</var> is
   1.135 + <a class="external" href="http://fetch.spec.whatwg.org/#cors-same-origin">CORS-same-origin</a> and the <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type metadata</a> of <var title="">response</var> is not a
   1.136 + <a href="#supported-styling-language">supported styling language</a> change the <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type metadata</a> of <var title="">response</var> to
   1.137 + <code title="">text/css</code>.
   1.138 +
   1.139 + <li><p>If <var title="">response</var> is not in a
   1.140   <a href="#supported-styling-language">supported styling language</a> terminate these steps.</li>
   1.141  
   1.142   <li>
   1.143 @@ -1566,29 +1601,31 @@
   1.144  
   1.145    <dl>
   1.146     <dt><a href="#concept-css-style-sheet-location" title="concept-css-style-sheet-location">location</a></dt>
   1.147 -   <dd><p>The <a class="external" href="http://url.spec.whatwg.org/#concept-absolute-url" title="concept-absolute-url">absolute URL</a> of the
   1.148 -   resource.</dd>
   1.149 +   <dd><p>The result of invoking the <a class="external" href="http://url.spec.whatwg.org/#concept-url-serializer" title="concept-url-serializer">URL serializer</a> with <var title="">parsed URL</var>.</dd>
   1.150  
   1.151     <dt><a href="#concept-css-style-sheet-parent" title="concept-css-style-sheet-parent">parent</a></dt>
   1.152 -   <dd><p>null</dd>
   1.153 +   <dd><p>null.</dd>
   1.154  
   1.155     <dt><a href="#concept-css-style-sheet-owner-node" title="concept-css-style-sheet-owner-node">owner node</a></dt>
   1.156 -   <dd><p>The node.</dd>
   1.157 +   <dd><p>The processing instruction.</dd>
   1.158  
   1.159     <dt><a href="#concept-css-style-sheet-owner-css-rule" title="concept-css-style-sheet-owner-css-rule">owner CSS rule</a></dt>
   1.160 -   <dd><p>null</dd>
   1.161 +   <dd><p>null.</dd>
   1.162  
   1.163     <dt><a href="#concept-css-style-sheet-media" title="concept-css-style-sheet-media">media</a></dt>
   1.164     <dd><p>The value of the <code title="">media</code> <a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a>
   1.165     if any, or the empty string otherwise.</dd>
   1.166  
   1.167     <dt><a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a></dt>
   1.168 -   <dd><p><var title="">title</var></dd>
   1.169 +   <dd><p><var title="">title</var>.</dd>
   1.170  
   1.171     <dt><a href="#concept-css-style-sheet-alternate-flag" title="concept-css-style-sheet-alternate-flag">alternate flag</a></dt>
   1.172     <dd><p>Set if the <code title="">alternate</code> <a class="external" href="http://www.w3.org/TR/xml-stylesheet/#dt-pseudo-attribute">pseudo-attribute</a>
   1.173     value is a <a class="external" href="http://dom.spec.whatwg.org/#case-sensitive">case-sensitive</a> match for
   1.174     "<code title="">yes</code>", or clear otherwise.
   1.175 +   
   1.176 +   <dt><a href="#concept-css-style-sheet-origin-clean-flag" title="concept-css-style-sheet-origin-clean-flag">origin-clean flag</a>
   1.177 +   <dd><p>Set if <var title="">response</var> is <a class="external" href="http://fetch.spec.whatwg.org/#cors-same-origin">CORS-same-origin</a>, or clear otherwise.
   1.178    </dl>
   1.179   </li>
   1.180  </ol>
   1.181 @@ -1619,18 +1656,36 @@
   1.182   "<code title="">alternate</code>" and <var title="">title</var> is the
   1.183   empty string terminate these steps.</li>
   1.184  
   1.185 - <li><p><a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#resolve-a-url" title="Resolve a URL">Resolve</a>
   1.186 - the specified <a class="external" href="http://url.spec.whatwg.org/#concept-url" title="concept-url">URL</a> and
   1.187 - <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch">fetch</a> it.</li>
   1.188 -
   1.189 - <li><p>When the resource is available, the document is in
   1.190 - <a class="external" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>
   1.191 - and the <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type metadata</a> of
   1.192 - the resource is not a <a href="#supported-styling-language">supported styling language</a> change the
   1.193 - <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type metadata</a> of the resource
   1.194 - to <code title="">text/css</code>.</li>
   1.195 -
   1.196 - <li><p>If the resource is not in a
   1.197 + <li><p>Let <var title="">input URL</var> be the value specified. <span class="XXX">Be more specific</span>
   1.198 + 
   1.199 + <li><p>Let <var title="">base URL</var> be the document's <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#document-base-url">document base URL</a>. <span class="XXX">Is there a document at this
   1.200 + point?</span>
   1.201 + 
   1.202 + <li><p>Let <var title="">origin</var> be the document's <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a>.
   1.203 +
   1.204 + <li><p>Let <var title="">parsed URL</var> be the return value of invoking the <a class="external" href="http://url.spec.whatwg.org/#concept-url-parser" title="concept-url-parser">URL parser</a> with the
   1.205 + string <var title="">input URL</var> and the base URL <var title="">base URL</var>.
   1.206 + 
   1.207 + <li><p>If <var title="">parsed URL</var> is failure, terminate these steps.
   1.208 + 
   1.209 + <li><p>Let <var title="">request</var> be a new <a class="external" href="http://fetch.spec.whatwg.org/#concept-request" title="concept-request">request</a>, with the
   1.210 + <a class="external" href="http://fetch.spec.whatwg.org/#concept-request-url" title="concept-request-url">url</a> <var title="">parsed URL</var>,
   1.211 + <a class="external" href="http://fetch.spec.whatwg.org/#concept-request-origin" title="concept-request-origin">origin</a> <var title="">origin</var> and
   1.212 + <a class="external" href="http://fetch.spec.whatwg.org/#concept-request-referrer" title="concept-request-referrer">referrer</a> <var title="">base URL</var>.
   1.213 +
   1.214 + <li><p>Let <var title="">response</var> be the result of <a class="external" href="http://fetch.spec.whatwg.org/#concept-fetch" title="concept-fetch">fetching</a> <var title="">request</var>.</li>
   1.215 +
   1.216 + <li><p>Wait until <var title="">response</var> is available.
   1.217 + 
   1.218 + <li><p>If <var title="">response</var> is a <a class="external" href="http://fetch.spec.whatwg.org/#concept-network-error" title="concept-network-error">network error</a>, terminate these steps.
   1.219 + 
   1.220 + <li><p>If the processing instruction's <a class="external" href="http://dom.spec.whatwg.org/#concept-node-document" title="concept-node-document">node document</a> is
   1.221 + in <a class="external" href="http://dom.spec.whatwg.org/#concept-document-quirks" title="concept-document-quirks">quirks mode</a>, <var title="">response</var> is
   1.222 + <a class="external" href="http://fetch.spec.whatwg.org/#cors-same-origin">CORS-same-origin</a> and the <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type metadata</a> of <var title="">response</var> is not a
   1.223 + <a href="#supported-styling-language">supported styling language</a> change the <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#content-type">Content-Type metadata</a> of <var title="">response</var> to
   1.224 + <code title="">text/css</code>.
   1.225 +
   1.226 + <li><p>If <var title="">response</var> is not in a
   1.227   <a href="#supported-styling-language">supported styling language</a> terminate these steps.</li>
   1.228  
   1.229   <li>
   1.230 @@ -1638,30 +1693,32 @@
   1.231  
   1.232    <dl>
   1.233     <dt><a href="#concept-css-style-sheet-location" title="concept-css-style-sheet-location">location</a></dt>
   1.234 -   <dd><p>The <a class="external" href="http://url.spec.whatwg.org/#concept-absolute-url" title="concept-absolute-url">absolute URL</a> of the
   1.235 -   resource.</dd>
   1.236 +   <dd><p>The result of invoking the <a class="external" href="http://url.spec.whatwg.org/#concept-url-serializer" title="concept-url-serializer">URL serializer</a> with <var title="">parsed URL</var>.</dd>
   1.237  
   1.238     <dt><a href="#concept-css-style-sheet-owner-node" title="concept-css-style-sheet-owner-node">owner node</a></dt>
   1.239 -   <dd><p>null</dd>
   1.240 +   <dd><p>null.</dd>
   1.241  
   1.242     <dt><a href="#concept-css-style-sheet-parent" title="concept-css-style-sheet-parent">parent</a></dt>
   1.243 -   <dd><p>null</dd>
   1.244 +   <dd><p>null.</dd>
   1.245  
   1.246     <dt><a href="#concept-css-style-sheet-owner-css-rule" title="concept-css-style-sheet-owner-css-rule">owner CSS rule</a></dt>
   1.247 -   <dd><p>null</dd>
   1.248 +   <dd><p>null.</dd>
   1.249  
   1.250     <dt><a href="#concept-css-style-sheet-media" title="concept-css-style-sheet-media">media</a></dt>
   1.251     <dd><p>The value of the first <code title="">media</code> parameter.</dd>
   1.252     <!-- XXX register media parameter? bah -->
   1.253  
   1.254     <dt><a href="#concept-css-style-sheet-title" title="concept-css-style-sheet-title">title</a></dt>
   1.255 -   <dd><p><var title="">title</var></dd>
   1.256 +   <dd><p><var title="">title</var>.</dd>
   1.257  
   1.258     <dt><a href="#concept-css-style-sheet-alternate-flag" title="concept-css-style-sheet-alternate-flag">alternate flag</a></dt>
   1.259     <dd><p>Set if one of the specified link relation type for this HTTP
   1.260     <code title="http-link">Link</code> header is an
   1.261     <a class="external" href="http://dom.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> match for
   1.262     "<code title="">alternate</code>", or false otherwise.
   1.263 +   
   1.264 +   <dt><a href="#concept-css-style-sheet-origin-clean-flag" title="concept-css-style-sheet-origin-clean-flag">origin-clean flag</a>
   1.265 +   <dd><p>Set if <var title="">response</var> is <a class="external" href="http://fetch.spec.whatwg.org/#cors-same-origin">CORS-same-origin</a>, or clear otherwise.
   1.266    </dl>
   1.267   </li>
   1.268  </ol>
   1.269 @@ -1693,6 +1750,9 @@
   1.270  <dd><p>An optional reference to an associated <a href="#css-style-sheet">CSS style sheet</a>.
   1.271  This item is initialized to reference an associated style sheet when the rule is created. Subsequent to initialization, this item
   1.272  is reset to null if the rule becomes disassociated from its initial style sheet. Once reset to null, it must never change.</dd>
   1.273 +
   1.274 +<dt><dfn id="concept-css-rule-nested-css-rules" title="concept-css-rule-nested-css-rules">child CSS rules</dfn>
   1.275 +<dd><p>A list of child <a href="#css-rule" title="CSS rule">CSS rules</a>.
   1.276  </dl>
   1.277  
   1.278  <p>In addition to the above state, each <a href="#css-rule">CSS rule</a> may be associated
   1.279 @@ -1786,6 +1846,7 @@
   1.280   <code title="">@charset</code> at-rules, <code title="">@import</code> at-rules, and <code title="">@namespace</code> at-rules,
   1.281   <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> an <code class="external"><a href="http://dom.spec.whatwg.org/#invalidstateerror">InvalidStateError</a></code> exception.
   1.282   <li><p>Insert <var title="">new rule</var> into <var title="">list</var> at the zero-indexed position <var title="">index</var>.<p></li>
   1.283 + <li><p>Return <var title="">index</var>.
   1.284  </ol>
   1.285  <p class="XXX">DOM-2 CSS specifies that a <code>NO_MODIFICATION_ALLOWED_ERR</code> exception is thrown
   1.286  if the style sheet is read-only. Are there any read-only style sheets?</p>
   1.287 @@ -1964,7 +2025,7 @@
   1.288  attribute of the associated <a href="#css-style-sheet">CSS style sheet</a>.</p>
   1.289  
   1.290  <p>The <dfn id="dom-cssimportrule-stylesheet" title="dom-CSSImportRule-styleSheet"><code>styleSheet</code></dfn> attribute must return the associated <a href="#css-style-sheet">CSS style sheet</a>.</p>
   1.291 -<p class="note">If loading of the style sheet fails its <code title="dom-CSSStyleSheet-cssRules"><a href="#dom-cssstylesheet-cssrules">cssRules</a></code>
   1.292 +<p class="note">If loading of the style sheet fails its <a href="#concept-css-style-sheet-css-rules" title="concept-css-style-sheet-css-rules">CSS rules</a>
   1.293  list is simply empty, i.e., an <code title="">@import</code> at-rule always has an associated <a href="#css-style-sheet">CSS style sheet</a>.</p>
   1.294  
   1.295  
   1.296 @@ -1982,15 +2043,15 @@
   1.297  <p>The <dfn id="dom-cssmediarule-media" title="dom-CSSMediaRule-media"><code>media</code></dfn> attribute must return a <code><a href="#medialist">MediaList</a></code> object for the list of media queries specified
   1.298  with the <code title="">@media</code> at-rule.</p>
   1.299  
   1.300 -<p>The <dfn id="dom-cssmediarule-cssrules" title="dom-CSSMediaRule-cssRules"><code>cssRules</code></dfn> attribute must return a <code><a href="#cssrulelist">CSSRuleList</a></code> object for the list of CSS rules 
   1.301 -specified with the <code title="">@media</code> at-rule.</p>
   1.302 -
   1.303 -<p>The <dfn id="dom-cssmediarule-insertrule" title="dom-CSSMediaRule-insertRule"><code>insertRule(<var title="">rule</var>, <var title="">index</var>)</code></dfn> method must <a href="#insert-a-css-rule">insert a CSS
   1.304 -rule</a> <var title="">rule</var> into the CSS rule list returned by <code title="dom-CSSMediaRule-cssRules"><a href="#dom-cssmediarule-cssrules">cssRules</a></code> at <var title="">index</var>, and
   1.305 -return <var title="">index</var>.</p>
   1.306 -
   1.307 -<p>The <dfn id="dom-cssmediarule-deleterule" title="dom-CSSMediaRule-deleteRule"><code>deleteRule(<var title="">index</var>)</code></dfn> method must <a href="#remove-a-css-rule">remove a CSS rule</a> from the CSS rule
   1.308 -list returned by <code title="dom-CSSMediaRule-cssRules"><a href="#dom-cssmediarule-cssrules">cssRules</a></code> at <var title="">index</var>.</p>
   1.309 +<p>The <dfn id="dom-cssmediarule-cssrules" title="dom-CSSMediaRule-cssRules"><code>cssRules</code></dfn> attribute must return a <code><a href="#cssrulelist">CSSRuleList</a></code> object for the
   1.310 +<span title="concept-css-rule-child-css-rules">child CSS rules</span> specified with the <code title="">@media</code> at-rule.</p>
   1.311 +
   1.312 +<p>The <dfn id="dom-cssmediarule-insertrule" title="dom-CSSMediaRule-insertRule"><code>insertRule(<var title="">rule</var>, <var title="">index</var>)</code></dfn> method must return the result of
   1.313 +invoking <a href="#insert-a-css-rule">insert a CSS rule</a> <var title="">rule</var> into the <span title="concept-css-rule-child-css-rules">child CSS rules</span> at
   1.314 +<var title="">index</var>.</p>
   1.315 +
   1.316 +<p>The <dfn id="dom-cssmediarule-deleterule" title="dom-CSSMediaRule-deleteRule"><code>deleteRule(<var title="">index</var>)</code></dfn> method must <a href="#remove-a-css-rule">remove a CSS rule</a> from the
   1.317 +<span title="concept-css-rule-child-css-rules">child CSS rules</span> at <var title="">index</var>.</p>
   1.318  
   1.319  
   1.320  <h4 id="the-cssfontfacerule-interface"><span class="secno">6.4.7 </span>The <code title="">CSSFontFaceRule</code> Interface</h4>
   1.321 @@ -2045,9 +2106,9 @@
   1.322  <p>On setting, the <code title="dom-CSSNamespaceRule-namespaceURI"><a href="#dom-cssnamespacerule-namespaceuri">namespaceURI</a></code> attribute must run the following steps:</p>
   1.323  
   1.324  <ol>
   1.325 - <li><p>Let <var title="">CSS style sheet</var> be the value returned by <code title="dom-CSSRule-parentStyleSheet"><a href="#dom-cssrule-parentstylesheet">parentStyleSheet</a></code>.
   1.326 - <li><p>Let <var title="">list</var> be the value returned by <code title="dom-CSSStyleSheet-cssRules"><a href="#dom-cssstylesheet-cssrules">cssRules</a></code> of <var title="">CSS style sheet</var>, or
   1.327 - null if <var title="">CSS style sheet</var> is null.
   1.328 + <li><p>Let <var title="">parent</var> be the <a href="#concept-css-rule-parent-css-style-sheet" title="concept-css-rule-parent-css-style-sheet">parent CSS style sheet</a>.
   1.329 + <li><p>Let <var title="">list</var> be the <a href="#concept-css-style-sheet-css-rules" title="concept-css-style-sheet-css-rules">CSS rules</a> of <var title="">parent</var>, or
   1.330 + null if <var title="">parent</var> is null.
   1.331   <li><p>If <var title="">list</var> is not null and contains anything other than
   1.332   <code title="">@charset</code> at-rules, <code title="">@import</code> at-rules, and <code title="">@namespace</code> at-rules,
   1.333   <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> an <code class="external"><a href="http://dom.spec.whatwg.org/#invalidstateerror">InvalidStateError</a></code> exception.
   1.334 @@ -2060,9 +2121,9 @@
   1.335  <p>On setting, the <code title="dom-CSSNamespaceRule-prefix"><a href="#dom-cssnamespacerule-prefix">prefix</a></code> attribute must run the following steps:</p>
   1.336  
   1.337  <ol>
   1.338 - <li><p>Let <var title="">CSS style sheet</var> be the value returned by <code title="dom-CSSRule-parentStyleSheet"><a href="#dom-cssrule-parentstylesheet">parentStyleSheet</a></code>.
   1.339 - <li><p>Let <var title="">list</var> be the value returned by <code title="dom-CSSStyleSheet-cssRules"><a href="#dom-cssstylesheet-cssrules">cssRules</a></code> of <var title="">CSS style sheet</var>, or
   1.340 - null if <var title="">CSS style sheet</var> is null.
   1.341 + <li><p>Let <var title="">parent</var> be the <a href="#concept-css-rule-parent-css-style-sheet" title="concept-css-rule-parent-css-style-sheet">parent CSS style sheet</a>.
   1.342 + <li><p>Let <var title="">list</var> be the <a href="#concept-css-style-sheet-css-rules" title="concept-css-style-sheet-css-rules">CSS rules</a> of <var title="">parent</var>, or
   1.343 + null if <var title="">parent</var> is null.
   1.344   <li><p>If <var title="">list</var> is not null and contains anything other than
   1.345   <code title="">@charset</code> at-rules, <code title="">@import</code> at-rules, and <code title="">@namespace</code> at-rules,
   1.346   <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> an <code class="external"><a href="http://dom.spec.whatwg.org/#invalidstateerror">InvalidStateError</a></code> exception.
   1.347 @@ -2920,6 +2981,9 @@
   1.348  <dt id="refsDOM2STYLE">[DOM2STYLE]
   1.349  <dd>(Non-normative) <cite><a href="http://www.w3.org/TR/DOM-Level-2-Style/">Document Object Model (DOM) Level 2 Style Specification</a></cite>, Chris Wilson, Philippe Le H├ęgaret and Vidur Apparao. W3C.
   1.350  
   1.351 +<dt id="refsFETCH">[FETCH]
   1.352 +<dd><cite><a href="http://fetch.spec.whatwg.org/">Fetch</a></cite>, Anne van Kesteren. WHATWG.
   1.353 +
   1.354  <dt id="refsHTML">[HTML]
   1.355  <dd><cite><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">HTML</a></cite>, Ian Hickson. WHATWG.
   1.356  
     2.1 --- a/cssom/Overview.src.html	Fri Jun 07 10:32:38 2013 +0200
     2.2 +++ b/cssom/Overview.src.html	Fri Jun 07 14:43:47 2013 +0200
     2.3 @@ -196,14 +196,14 @@
     2.4  <cite>DOM</cite>,
     2.5  <cite>HTML</cite>,
     2.6  <cite>URL</cite>,
     2.7 -<!--<cite>Fetch</cite>,-->
     2.8 +<cite>Fetch</cite>,
     2.9  <cite>Associating Style Sheets with XML documents</cite>
    2.10  and
    2.11  <cite>XML</cite>.
    2.12  <span data-anolis-ref>DOM</span>
    2.13  <span data-anolis-ref>HTML</span>
    2.14  <span data-anolis-ref>URL</span>
    2.15 -<!--<span data-anolis-ref>CORS</span>-->
    2.16 +<span data-anolis-ref>FETCH</span>
    2.17  <span data-anolis-ref>XMLSS</span>
    2.18  <span data-anolis-ref>XML</span>
    2.19  
    2.20 @@ -795,7 +795,7 @@
    2.21   <dd><p>The literal string "<code title>text/css</code>".</p></dd>
    2.22  
    2.23   <dt><dfn title=concept-css-style-sheet-location>location</dfn></dt>
    2.24 - <dd><p>The <span data-anolis-spec=url title=concept-url>URL</span> of the
    2.25 + <dd><p>The <span data-anolis-spec=url title=concept-absolute-url>absolute URL</span> of the first request of the
    2.26   <span>CSS style sheet</span> or null if the <span>CSS style sheet</span> was
    2.27   embedded.</p></dd>
    2.28  
    2.29 @@ -870,6 +870,9 @@
    2.30   <dt><dfn title=concept-css-style-sheet-css-rules>CSS rules</dfn></dt>
    2.31   <dd><p>The <span title="CSS rule">CSS rules</span> associated with the
    2.32   <span>CSS style sheet</span>.</p></dd>
    2.33 + 
    2.34 + <dt><dfn title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</dfn>
    2.35 + <dd><p>Either set or clear. If it is set, the API allows reading and modifying of the <span title=concept-css-style-sheet-css-rules>CSS rules</span>.
    2.36  </dl>
    2.37  
    2.38  <p>When you are to <span>create a CSS style sheet</span> the above properties,
    2.39 @@ -951,19 +954,35 @@
    2.40  <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
    2.41  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>
    2.42  
    2.43 -<p>The <dfn title=dom-CSSStyleSheet-cssRules><code>cssRules</code></dfn> attribute must return a read-only, live <code>CSSRuleList</code> object representing
    2.44 -the <span title=concept-css-style-sheet-css-rules>CSS rules</span>. The same object must be returned on each get access.</p>
    2.45 -<p class='note'>Even though the returned <code>CSSRuleList</code> object is read-only (from the perspective of
    2.46 -client-authored script), it can nevertheless change over time due to its liveness status. For example, invoking
    2.47 -the <code title=dom-CSSStyleSheet-insertRule>insertRule()</code> or <code title=dom-CSSStyleSheet-deleteRule>deleteRule()</code> methods can result in mutations
    2.48 -reflected in the returned object.</p>
    2.49 -
    2.50 -<p>The <dfn title=dom-CSSStyleSheet-insertRule><code>insertRule(<var title>rule</var>, <var title>index</var>)</code></dfn> method must <span>insert a CSS
    2.51 -rule</span> <var title>rule</var> in the CSS rule list returned by <code title=dom-CSSStyleSheet-cssRules>cssRules</code> at <var title>index</var>, and return
    2.52 -<var title>index</var>.
    2.53 -
    2.54 -<p>The <dfn title=dom-CSSStyleSheet-deleteRule><code>deleteRule(<var title>index</var>)</code></dfn> method must <span>remove a CSS rule</span> in the CSS rule
    2.55 -list returned by <code title=dom-CSSStyleSheet-cssRules>cssRules</code> at <var title>index</var>.
    2.56 +<p>The <dfn title=dom-CSSStyleSheet-cssRules><code>cssRules</code></dfn> attribute must follow these steps:
    2.57 +
    2.58 +<ol>
    2.59 + <li><p>If the <span title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</span> is clear,
    2.60 + <span title=concept-throw data-anolis-spec=dom>throw</span> a <code data-anolis-spec=dom>SecurityError</code> exception.
    2.61 + <li><p>Return a read-only, live <code>CSSRuleList</code> object representing
    2.62 + the <span title=concept-css-style-sheet-css-rules>CSS rules</span>. The same object must be returned on each get access.</p>
    2.63 + <p class='note'>Even though the returned <code>CSSRuleList</code> object is read-only (from the perspective of
    2.64 + client-authored script), it can nevertheless change over time due to its liveness status. For example, invoking
    2.65 + the <code title=dom-CSSStyleSheet-insertRule>insertRule()</code> or <code title=dom-CSSStyleSheet-deleteRule>deleteRule()</code> methods can result in
    2.66 + mutations reflected in the returned object.</p>
    2.67 +</ol>
    2.68 +
    2.69 +<p>The <dfn title=dom-CSSStyleSheet-insertRule><code>insertRule(<var title>rule</var>, <var title>index</var>)</code></dfn> method must run the following steps:
    2.70 +
    2.71 +<ol>
    2.72 + <li><p>If the <span title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</span> is clear,
    2.73 + <span title=concept-throw data-anolis-spec=dom>throw</span> a <code data-anolis-spec=dom>SecurityError</code> exception.
    2.74 + <li><p>Return the result of invoking <span>insert a CSS rule</span> <var title>rule</var> in the <span title=concept-css-style-sheet-css-rules>CSS rules</span>
    2.75 + at <var title>index</var>.
    2.76 +</ol>
    2.77 +
    2.78 +<p>The <dfn title=dom-CSSStyleSheet-deleteRule><code>deleteRule(<var title>index</var>)</code></dfn> method must run the following steps:
    2.79 +
    2.80 +<ol>
    2.81 + <li><p>If the <span title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</span> is clear,
    2.82 + <span title=concept-throw data-anolis-spec=dom>throw</span> a <code data-anolis-spec=dom>SecurityError</code> exception.
    2.83 + <li><p><span>Remove a CSS rule</span> in the <span title=concept-css-style-sheet-css-rules>CSS rules</span> at <var title>index</var>.
    2.84 +</ol>
    2.85  
    2.86  <h3>CSS Style Sheet Collections</h3>
    2.87  
    2.88 @@ -1474,22 +1493,38 @@
    2.89   value is not a <span>supported styling language</span> the user agent
    2.90   may terminate these steps.</p></li>
    2.91  
    2.92 - <li><p><span data-anolis-spec=html title="Resolve a URL">Resolve</span>
    2.93 - the <span data-anolis-spec=url title=concept-url>URL</span> specified by the
    2.94 - <code title>href</code> <span data-anolis-spec=xmlss>pseudo-attribute</span> and then
    2.95 - <span data-anolis-spec=html>fetch</span> it.</p></li>
    2.96 -
    2.97 - <li>
    2.98 -  <p>When the resource is available, the document is in
    2.99 -  <span data-anolis-spec=dom title=concept-document-quirks>quirks mode</span>
   2.100 -  and the
   2.101 -  <span data-anolis-spec=html>Content-Type metadata</span> of
   2.102 -  the resource is not a <span>supported styling language</span> change the
   2.103 -  <span data-anolis-spec=html>Content-Type metadata</span> of the resource
   2.104 -  to <code title>text/css</code>.</p>
   2.105 - </li>
   2.106 -
   2.107 - <li><p>If the resource is not in a
   2.108 + <li><p>Let <var title>input URL</var> be the value specified by the
   2.109 + <code title>href</code> <span data-anolis-spec=xmlss>pseudo-attribute</span>.
   2.110 + 
   2.111 + <li><p>Let <var title>base URL</var> be the processing instruction's <span data-anolis-spec=dom title=concept-node-document>node document</span>'s
   2.112 + <span data-anolis-spec=html>document base URL</span>.
   2.113 + 
   2.114 + <li><p>Let <var title>origin</var> be the processing instruction's <span data-anolis-spec=dom title=concept-node-document>node document</span>'s
   2.115 + <span data-anolis-spec=html>origin</span>.
   2.116 +
   2.117 + <li><p>Let <var title>parsed URL</var> be the return value of invoking the <span data-anolis-spec=url title=concept-url-parser>URL parser</span> with the
   2.118 + string <var title>input URL</var> and the base URL <var title>base URL</var>.
   2.119 + 
   2.120 + <li><p>If <var title>parsed URL</var> is failure, terminate these steps.
   2.121 + 
   2.122 + <li><p>Let <var title>request</var> be a new <span data-anolis-spec=fetch title=concept-request>request</span>, with the
   2.123 + <span data-anolis-spec=fetch title=concept-request-url>url</span> <var title>parsed URL</var>,
   2.124 + <span data-anolis-spec=fetch title=concept-request-origin>origin</span> <var title>origin</var> and
   2.125 + <span data-anolis-spec=fetch title=concept-request-referrer>referrer</span> <var title>base URL</var>.
   2.126 +
   2.127 + <li><p>Let <var title>response</var> be the result of <span data-anolis-spec=fetch title=concept-fetch>fetching</span> <var title>request</var>.</p></li>
   2.128 +
   2.129 + <li><p>Wait until <var title>response</var> is available.
   2.130 + 
   2.131 + <li><p>If <var title>response</var> is a <span data-anolis-spec=fetch title=concept-network-error>network error</span>, terminate these steps.
   2.132 + 
   2.133 + <li><p>If the processing instruction's <span data-anolis-spec=dom title=concept-node-document>node document</span> is
   2.134 + in <span data-anolis-spec=dom title=concept-document-quirks>quirks mode</span>, <var title>response</var> is
   2.135 + <span data-anolis-spec=fetch>CORS-same-origin</span> and the <span data-anolis-spec=html>Content-Type metadata</span> of <var title>response</var> is not a
   2.136 + <span>supported styling language</span> change the <span data-anolis-spec=html>Content-Type metadata</span> of <var title>response</var> to
   2.137 + <code title>text/css</code>.
   2.138 +
   2.139 + <li><p>If <var title>response</var> is not in a
   2.140   <span>supported styling language</span> terminate these steps.</p></li>
   2.141  
   2.142   <li>
   2.143 @@ -1497,29 +1532,31 @@
   2.144  
   2.145    <dl>
   2.146     <dt><span title=concept-css-style-sheet-location>location</span></dt>
   2.147 -   <dd><p>The <span data-anolis-spec=url title=concept-absolute-url>absolute URL</span> of the
   2.148 -   resource.</p></dd>
   2.149 +   <dd><p>The result of invoking the <span data-anolis-spec=url title=concept-url-serializer>URL serializer</span> with <var title>parsed URL</var>.</p></dd>
   2.150  
   2.151     <dt><span title=concept-css-style-sheet-parent>parent</span></dt>
   2.152 -   <dd><p>null</p></dd>
   2.153 +   <dd><p>null.</p></dd>
   2.154  
   2.155     <dt><span title=concept-css-style-sheet-owner-node>owner node</span></dt>
   2.156 -   <dd><p>The node.</p></dd>
   2.157 +   <dd><p>The processing instruction.</p></dd>
   2.158  
   2.159     <dt><span title=concept-css-style-sheet-owner-css-rule>owner CSS rule</span></dt>
   2.160 -   <dd><p>null</p></dd>
   2.161 +   <dd><p>null.</p></dd>
   2.162  
   2.163     <dt><span title=concept-css-style-sheet-media>media</span></dt>
   2.164     <dd><p>The value of the <code title>media</code> <span data-anolis-spec=xmlss>pseudo-attribute</span>
   2.165     if any, or the empty string otherwise.</p></dd>
   2.166  
   2.167     <dt><span title=concept-css-style-sheet-title>title</span></dt>
   2.168 -   <dd><p><var title>title</var></p></dd>
   2.169 +   <dd><p><var title>title</var>.</p></dd>
   2.170  
   2.171     <dt><span title=concept-css-style-sheet-alternate-flag>alternate flag</span></dt>
   2.172     <dd><p>Set if the <code title>alternate</code> <span data-anolis-spec=xmlss>pseudo-attribute</span>
   2.173     value is a <span data-anolis-spec=dom>case-sensitive</span> match for
   2.174     "<code title>yes</code>", or clear otherwise.
   2.175 +   
   2.176 +   <dt><span title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</span>
   2.177 +   <dd><p>Set if <var title>response</var> is <span data-anolis-spec=fetch>CORS-same-origin</span>, or clear otherwise.
   2.178    </dl>
   2.179   </li>
   2.180  </ol>
   2.181 @@ -1550,18 +1587,36 @@
   2.182   "<code title>alternate</code>" and <var title>title</var> is the
   2.183   empty string terminate these steps.</p></li>
   2.184  
   2.185 - <li><p><span data-anolis-spec=html title="Resolve a URL">Resolve</span>
   2.186 - the specified <span data-anolis-spec=url title=concept-url>URL</span> and
   2.187 - <span data-anolis-spec=html>fetch</span> it.</p></li>
   2.188 -
   2.189 - <li><p>When the resource is available, the document is in
   2.190 - <span data-anolis-spec=dom title=concept-document-quirks>quirks mode</span>
   2.191 - and the <span data-anolis-spec=html>Content-Type metadata</span> of
   2.192 - the resource is not a <span>supported styling language</span> change the
   2.193 - <span data-anolis-spec=html>Content-Type metadata</span> of the resource
   2.194 - to <code title>text/css</code>.</p></li>
   2.195 -
   2.196 - <li><p>If the resource is not in a
   2.197 + <li><p>Let <var title>input URL</var> be the value specified. <span class=XXX>Be more specific</span>
   2.198 + 
   2.199 + <li><p>Let <var title>base URL</var> be the document's <span data-anolis-spec=html>document base URL</span>. <span class=XXX>Is there a document at this
   2.200 + point?</span>
   2.201 + 
   2.202 + <li><p>Let <var title>origin</var> be the document's <span data-anolis-spec=html>origin</span>.
   2.203 +
   2.204 + <li><p>Let <var title>parsed URL</var> be the return value of invoking the <span data-anolis-spec=url title=concept-url-parser>URL parser</span> with the
   2.205 + string <var title>input URL</var> and the base URL <var title>base URL</var>.
   2.206 + 
   2.207 + <li><p>If <var title>parsed URL</var> is failure, terminate these steps.
   2.208 + 
   2.209 + <li><p>Let <var title>request</var> be a new <span data-anolis-spec=fetch title=concept-request>request</span>, with the
   2.210 + <span data-anolis-spec=fetch title=concept-request-url>url</span> <var title>parsed URL</var>,
   2.211 + <span data-anolis-spec=fetch title=concept-request-origin>origin</span> <var title>origin</var> and
   2.212 + <span data-anolis-spec=fetch title=concept-request-referrer>referrer</span> <var title>base URL</var>.
   2.213 +
   2.214 + <li><p>Let <var title>response</var> be the result of <span data-anolis-spec=fetch title=concept-fetch>fetching</span> <var title>request</var>.</p></li>
   2.215 +
   2.216 + <li><p>Wait until <var title>response</var> is available.
   2.217 + 
   2.218 + <li><p>If <var title>response</var> is a <span data-anolis-spec=fetch title=concept-network-error>network error</span>, terminate these steps.
   2.219 + 
   2.220 + <li><p>If the processing instruction's <span data-anolis-spec=dom title=concept-node-document>node document</span> is
   2.221 + in <span data-anolis-spec=dom title=concept-document-quirks>quirks mode</span>, <var title>response</var> is
   2.222 + <span data-anolis-spec=fetch>CORS-same-origin</span> and the <span data-anolis-spec=html>Content-Type metadata</span> of <var title>response</var> is not a
   2.223 + <span>supported styling language</span> change the <span data-anolis-spec=html>Content-Type metadata</span> of <var title>response</var> to
   2.224 + <code title>text/css</code>.
   2.225 +
   2.226 + <li><p>If <var title>response</var> is not in a
   2.227   <span>supported styling language</span> terminate these steps.</p></li>
   2.228  
   2.229   <li>
   2.230 @@ -1569,30 +1624,32 @@
   2.231  
   2.232    <dl>
   2.233     <dt><span title=concept-css-style-sheet-location>location</span></dt>
   2.234 -   <dd><p>The <span data-anolis-spec=url title=concept-absolute-url>absolute URL</span> of the
   2.235 -   resource.</p></dd>
   2.236 +   <dd><p>The result of invoking the <span data-anolis-spec=url title=concept-url-serializer>URL serializer</span> with <var title>parsed URL</var>.</p></dd>
   2.237  
   2.238     <dt><span title=concept-css-style-sheet-owner-node>owner node</span></dt>
   2.239 -   <dd><p>null</p></dd>
   2.240 +   <dd><p>null.</p></dd>
   2.241  
   2.242     <dt><span title=concept-css-style-sheet-parent>parent</span></dt>
   2.243 -   <dd><p>null</p></dd>
   2.244 +   <dd><p>null.</p></dd>
   2.245  
   2.246     <dt><span title=concept-css-style-sheet-owner-css-rule>owner CSS rule</span></dt>
   2.247 -   <dd><p>null</p></dd>
   2.248 +   <dd><p>null.</p></dd>
   2.249  
   2.250     <dt><span title=concept-css-style-sheet-media>media</span></dt>
   2.251     <dd><p>The value of the first <code title>media</code> parameter.</p></dd>
   2.252     <!-- XXX register media parameter? bah -->
   2.253  
   2.254     <dt><span title=concept-css-style-sheet-title>title</span></dt>
   2.255 -   <dd><p><var title>title</var></p></dd>
   2.256 +   <dd><p><var title>title</var>.</p></dd>
   2.257  
   2.258     <dt><span title=concept-css-style-sheet-alternate-flag>alternate flag</span></dt>
   2.259     <dd><p>Set if one of the specified link relation type for this HTTP
   2.260     <code title="http-link">Link</code> header is an
   2.261     <span data-anolis-spec=dom>ASCII case-insensitive</span> match for
   2.262     "<code title>alternate</code>", or false otherwise.
   2.263 +   
   2.264 +   <dt><span title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</span>
   2.265 +   <dd><p>Set if <var title>response</var> is <span data-anolis-spec=fetch>CORS-same-origin</span>, or clear otherwise.
   2.266    </dl>
   2.267   </li>
   2.268  </ol>
   2.269 @@ -1624,6 +1681,9 @@
   2.270  <dd><p>An optional reference to an associated <span>CSS style sheet</span>.
   2.271  This item is initialized to reference an associated style sheet when the rule is created. Subsequent to initialization, this item
   2.272  is reset to null if the rule becomes disassociated from its initial style sheet. Once reset to null, it must never change.</p></dd>
   2.273 +
   2.274 +<dt><dfn title=concept-css-rule-nested-css-rules>child CSS rules</dfn>
   2.275 +<dd><p>A list of child <span title="CSS rule">CSS rules</span>.
   2.276  </dl>
   2.277  
   2.278  <p>In addition to the above state, each <span>CSS rule</span> may be associated
   2.279 @@ -1717,6 +1777,7 @@
   2.280   <code title>@charset</code> at-rules, <code title>@import</code> at-rules, and <code title>@namespace</code> at-rules,
   2.281   <span data-anolis-spec='dom' title='concept-throw'>throw</span> an <code data-anolis-spec=dom>InvalidStateError</code> exception.
   2.282   <li><p>Insert <var title>new rule</var> into <var title>list</var> at the zero-indexed position <var title>index</var>.<p></li>
   2.283 + <li><p>Return <var title>index</var>.
   2.284  </ol>
   2.285  <p class='XXX'>DOM-2 CSS specifies that a <code>NO_MODIFICATION_ALLOWED_ERR</code> exception is thrown
   2.286  if the style sheet is read-only. Are there any read-only style sheets?</p>
   2.287 @@ -1895,7 +1956,7 @@
   2.288  attribute of the associated <span>CSS style sheet</span>.</p>
   2.289  
   2.290  <p>The <dfn title=dom-CSSImportRule-styleSheet><code>styleSheet</code></dfn> attribute must return the associated <span>CSS style sheet</span>.</p>
   2.291 -<p class='note'>If loading of the style sheet fails its <code title='dom-CSSStyleSheet-cssRules'>cssRules</code>
   2.292 +<p class='note'>If loading of the style sheet fails its <span title=concept-css-style-sheet-css-rules>CSS rules</span>
   2.293  list is simply empty, i.e., an <code title>@import</code> at-rule always has an associated <span>CSS style sheet</span>.</p>
   2.294  
   2.295  
   2.296 @@ -1913,15 +1974,15 @@
   2.297  <p>The <dfn title=dom-CSSMediaRule-media><code>media</code></dfn> attribute must return a <code>MediaList</code> object for the list of media queries specified
   2.298  with the <code title>@media</code> at-rule.</p>
   2.299  
   2.300 -<p>The <dfn title=dom-CSSMediaRule-cssRules><code>cssRules</code></dfn> attribute must return a <code>CSSRuleList</code> object for the list of CSS rules 
   2.301 -specified with the <code title>@media</code> at-rule.</p>
   2.302 -
   2.303 -<p>The <dfn title=dom-CSSMediaRule-insertRule><code>insertRule(<var title>rule</var>, <var title>index</var>)</code></dfn> method must <span>insert a CSS
   2.304 -rule</span> <var title>rule</var> into the CSS rule list returned by <code title='dom-CSSMediaRule-cssRules'>cssRules</code> at <var title>index</var>, and
   2.305 -return <var title>index</var>.</p>
   2.306 -
   2.307 -<p>The <dfn title=dom-CSSMediaRule-deleteRule><code>deleteRule(<var title>index</var>)</code></dfn> method must <span>remove a CSS rule</span> from the CSS rule
   2.308 -list returned by <code title='dom-CSSMediaRule-cssRules'>cssRules</code> at <var title>index</var>.</p>
   2.309 +<p>The <dfn title=dom-CSSMediaRule-cssRules><code>cssRules</code></dfn> attribute must return a <code>CSSRuleList</code> object for the
   2.310 +<span title=concept-css-rule-child-css-rules>child CSS rules</span> specified with the <code title>@media</code> at-rule.</p>
   2.311 +
   2.312 +<p>The <dfn title=dom-CSSMediaRule-insertRule><code>insertRule(<var title>rule</var>, <var title>index</var>)</code></dfn> method must return the result of
   2.313 +invoking <span>insert a CSS rule</span> <var title>rule</var> into the <span title=concept-css-rule-child-css-rules>child CSS rules</span> at
   2.314 +<var title>index</var>.</p>
   2.315 +
   2.316 +<p>The <dfn title=dom-CSSMediaRule-deleteRule><code>deleteRule(<var title>index</var>)</code></dfn> method must <span>remove a CSS rule</span> from the
   2.317 +<span title=concept-css-rule-child-css-rules>child CSS rules</span> at <var title>index</var>.</p>
   2.318  
   2.319  
   2.320  <h4>The <code title>CSSFontFaceRule</code> Interface</h4>
   2.321 @@ -1976,9 +2037,9 @@
   2.322  <p>On setting, the <code title=dom-CSSNamespaceRule-namespaceURI>namespaceURI</code> attribute must run the following steps:</p>
   2.323  
   2.324  <ol>
   2.325 - <li><p>Let <var title>CSS style sheet</var> be the value returned by <code title=dom-CSSRule-parentStyleSheet>parentStyleSheet</code>.
   2.326 - <li><p>Let <var title>list</var> be the value returned by <code title=dom-CSSStyleSheet-cssRules>cssRules</code> of <var title>CSS style sheet</var>, or
   2.327 - null if <var title>CSS style sheet</var> is null.
   2.328 + <li><p>Let <var title>parent</var> be the <span title=concept-css-rule-parent-css-style-sheet>parent CSS style sheet</span>.
   2.329 + <li><p>Let <var title>list</var> be the <span title=concept-css-style-sheet-css-rules>CSS rules</span> of <var title>parent</var>, or
   2.330 + null if <var title>parent</var> is null.
   2.331   <li><p>If <var title>list</var> is not null and contains anything other than
   2.332   <code title>@charset</code> at-rules, <code title>@import</code> at-rules, and <code title>@namespace</code> at-rules,
   2.333   <span data-anolis-spec='dom' title='concept-throw'>throw</span> an <code data-anolis-spec=dom>InvalidStateError</code> exception.
   2.334 @@ -1991,9 +2052,9 @@
   2.335  <p>On setting, the <code title=dom-CSSNamespaceRule-prefix>prefix</code> attribute must run the following steps:</p>
   2.336  
   2.337  <ol>
   2.338 - <li><p>Let <var title>CSS style sheet</var> be the value returned by <code title=dom-CSSRule-parentStyleSheet>parentStyleSheet</code>.
   2.339 - <li><p>Let <var title>list</var> be the value returned by <code title=dom-CSSStyleSheet-cssRules>cssRules</code> of <var title>CSS style sheet</var>, or
   2.340 - null if <var title>CSS style sheet</var> is null.
   2.341 + <li><p>Let <var title>parent</var> be the <span title=concept-css-rule-parent-css-style-sheet>parent CSS style sheet</span>.
   2.342 + <li><p>Let <var title>list</var> be the <span title=concept-css-style-sheet-css-rules>CSS rules</span> of <var title>parent</var>, or
   2.343 + null if <var title>parent</var> is null.
   2.344   <li><p>If <var title>list</var> is not null and contains anything other than
   2.345   <code title>@charset</code> at-rules, <code title>@import</code> at-rules, and <code title>@namespace</code> at-rules,
   2.346   <span data-anolis-spec='dom' title='concept-throw'>throw</span> an <code data-anolis-spec=dom>InvalidStateError</code> exception.