[html5] r8390 - [giow] (3) Update how the interaction with CSS style sheets and CSSOM is defined [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Jan 13 14:45:41 PST 2014


Author: ianh
Date: 2014-01-13 14:45:39 -0800 (Mon, 13 Jan 2014)
New Revision: 8390

Modified:
   complete.html
   index
   source
Log:
[giow] (3) Update how the interaction with CSS style sheets and CSSOM is defined.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=14703
Affected topics: CSS, DOM APIs, HTML

Modified: complete.html
===================================================================
--- complete.html	2014-01-09 19:19:21 UTC (rev 8389)
+++ complete.html	2014-01-13 22:45:39 UTC (rev 8390)
@@ -298,7 +298,7 @@
 
   <header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 9 January 2014</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 13 January 2014</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -504,8 +504,10 @@
        <li><a href=#pragma-directives><span class=secno>4.2.5.3 </span>Pragma directives</a></li>
        <li><a href=#other-pragma-directives><span class=secno>4.2.5.4 </span>Other pragma directives</a></li>
        <li><a href=#charset><span class=secno>4.2.5.5 </span>Specifying the document's character encoding</a></ol></li>
-     <li><a href=#the-style-element><span class=secno>4.2.6 </span>The <code>style</code> element</a></li>
-     <li><a href=#styling><span class=secno>4.2.7 </span>Styling</a></ol></li>
+     <li><a href=#the-style-element><span class=secno>4.2.6 </span>The <code>style</code> element</a>
+      <ol>
+       <li><a href=#the- at global-rule><span class=secno>4.2.6.1 </span>The <code title="">@global</code> rule</a></ol></li>
+     <li><a href=#interactions-of-styling-and-scripting><span class=secno>4.2.7 </span>Interactions of styling and scripting</a></ol></li>
    <li><a href=#sections><span class=secno>4.3 </span>Sections</a>
     <ol>
      <li><a href=#the-body-element><span class=secno>4.3.1 </span>The <code>body</code> element</a></li>
@@ -3921,8 +3923,20 @@
      <li><dfn id=cssstyledeclaration><code>CSSStyleDeclaration</code></dfn></li>
      <li><dfn id=dom-cssstyledeclaration-csstext title=dom-CSSStyleDeclaration-cssText><code>cssText</code></dfn> attribute of <code><a href=#cssstyledeclaration>CSSStyleDeclaration</a></code></li>
      <li><dfn id=stylesheet><code>StyleSheet</code></dfn></li>
-     <li><dfn id=dom-linkstyle-sheet title=dom-linkstyle-sheet><code>sheet</code></dfn></li>
-     <li><dfn id=dom-stylesheet-disabled title=dom-stylesheet-disabled><code>disabled</code></dfn></li>
+     <li>The terms <dfn id=create-a-css-style-sheet>create a CSS style sheet</dfn>, <dfn id=remove-a-css-style-sheet>remove a CSS style sheet</dfn>, and <dfn id=associated-css-style-sheet>associated CSS style sheet</dfn></li>
+     <li><dfn id=css-style-sheet title="CSS style sheet">CSS style sheets</dfn> and their properties:
+         <dfn id=concept-css-style-sheet-type title=concept-css-style-sheet-type>type</dfn>,
+         <dfn id=concept-css-style-sheet-location title=concept-css-style-sheet-location>location</dfn>,
+         <dfn id=concept-css-style-sheet-parent-css-style-sheet title=concept-css-style-sheet-parent-CSS-style-sheet>parent CSS style sheet</dfn>,
+         <dfn id=concept-css-style-sheet-owner-node title=concept-css-style-sheet-owner-node>owner node</dfn>,
+         <dfn id=concept-css-style-sheet-owner-css-rule title=concept-css-style-sheet-owner-CSS-rule>owner CSS rule</dfn>,
+         <dfn id=concept-css-style-sheet-media title=concept-css-style-sheet-media>media</dfn>,
+         <dfn id=concept-css-style-sheet-title title=concept-css-style-sheet-title>title</dfn>,
+         <dfn id=concept-css-style-sheet-alternate-flag title=concept-css-style-sheet-alternate-flag>alternate flag</dfn>,
+         <dfn id=concept-css-style-sheet-disabeld-flag title=concept-css-style-sheet-disabeld-flag>disabled flag</dfn>,
+         <dfn id=concept-css-style-sheet-css-rules title=concept-css-style-sheet-CSS-rules>CSS rules</dfn>,
+         <dfn id=concept-css-style-sheet-origin-clean-flag title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</dfn>
+     </li>
      <li><dfn id=alternative-style-sheet-sets>Alternative style sheet sets</dfn> and the <dfn id=preferred-style-sheet-set>preferred style sheet set</dfn></li>
      <li><dfn id=serializing-a-css-value>Serializing a CSS value</dfn></li>
      <li><dfn id=scroll-an-element-into-view>Scroll an element into view</dfn></li>
@@ -12536,7 +12550,6 @@
    <dt><a href=#element-dfn-dom title=element-dfn-dom>DOM interface</a>:</dt><!--TOPIC:DOM APIs-->
    <dd>
 <pre class=idl>interface <dfn id=htmllinkelement>HTMLLinkElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
-           attribute boolean <a href=#dom-link-disabled title=dom-link-disabled>disabled</a>;
            attribute DOMString <a href=#dom-link-href title=dom-link-href>href</a>;
            attribute DOMString <a href=#dom-link-crossorigin title=dom-link-crossOrigin>crossOrigin</a>;
            attribute DOMString <a href=#dom-link-rel title=dom-link-rel>rel</a>;
@@ -12830,14 +12843,8 @@
 
   </div>
 
-  <p>The IDL attribute <dfn id=dom-link-disabled title=dom-link-disabled><code>disabled</code></dfn> only applies to
-  style sheet links. When the <code><a href=#the-link-element>link</a></code> element defines a style sheet link, then the <code title=dom-link-disabled><a href=#dom-link-disabled>disabled</a></code> attribute behaves as defined <a href=#dom-linkstyle-disabled title=dom-linkstyle-disabled>for the alternative style sheets DOM</a>. For all other
-  <code><a href=#the-link-element>link</a></code> elements it always return false and does nothing on setting.</p> <!-- that is
-  normatively required in the definition of dom-linkstyle-disabled -->
+  <p>The <code><a href=#linkstyle>LinkStyle</a></code> interface is also implemented by this element. <a href=#refsCSSOM>[CSSOM]</a></p>
 
-  <p>The <code><a href=#linkstyle>LinkStyle</a></code> interface is also implemented by this element; the <a href=#styling>styling
-  processing model</a> defines how. <a href=#refsCSSOM>[CSSOM]</a></p>
-
   <div class=example>
 
    <p>Here, a set of <code><a href=#the-link-element>link</a></code> elements provide some style sheets:</p>
@@ -13756,7 +13763,6 @@
    <dt><a href=#element-dfn-dom title=element-dfn-dom>DOM interface</a>:</dt><!--TOPIC:DOM APIs-->
    <dd>
 <pre class=idl>interface <dfn id=htmlstyleelement>HTMLStyleElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
-           attribute boolean <a href=#dom-style-disabled title=dom-style-disabled>disabled</a>;
            attribute DOMString <a href=#dom-style-media title=dom-style-media>media</a>;
            attribute DOMString <a href=#dom-style-type title=dom-style-type>type</a>;
            attribute boolean <a href=#dom-style-scoped title=dom-style-scoped>scoped</a>;
@@ -13764,8 +13770,8 @@
 <a href=#htmlstyleelement>HTMLStyleElement</a> implements <a href=#linkstyle>LinkStyle</a>;</pre>
    </dd>
   </dl><!--TOPIC:HTML--><p>The <code><a href=#the-style-element>style</a></code> element allows authors to embed style information in their documents.
-  The <code><a href=#the-style-element>style</a></code> element is one of several inputs to the <a href=#styling>styling processing
-  model</a>. The element does not <a href=#represents title=represents>represent</a> content for the
+  The <code><a href=#the-style-element>style</a></code> element is one of several inputs to the styling processing
+  model. The element does not <a href=#represents title=represents>represent</a> content for the
   user.</p>
 
   <p>The <dfn id=attr-style-type title=attr-style-type><code>type</code></dfn> attribute gives the styling language.
@@ -13818,41 +13824,12 @@
   <p class=note>A <code><a href=#the-style-element>style</a></code> element <em>without</em> a <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is restricted to appearing in the
   <code><a href=#the-head-element>head</a></code> of the document.</p>
 
-  <div class=impl>
-
-<!--ADD-TOPIC:CSS-->
-
   <p>A style sheet declared by a <code><a href=#the-style-element>style</a></code> element that has a <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute and has a parent node that is an element is
   <i>scoped</i>, with the <i>scoping element</i> being the <code><a href=#the-style-element>style</a></code> element's parent
   element. <a href=#refsCSSSCOPED>[CSSSCOPED]</a></p>
 
-  <p class=critical>The following will eventually be moved to a CSS specification; it is specified
-  here only on an interim basis until an editor can be found to own this.</p>
+  <!-- <p class="note">Currently, this is only defined for CSS.</p> -->
 
-  <p>Within scoped CSS resources, authors may use an <code title="">@global</code> @-rule. The
-  syntax of this rule is defined as follows.</p>
-
-  <p>The following production is added to the grammar:</p>
-
-  <pre>global
-  : GLOBAL_SYM S* ruleset
-  ;</pre>
-
-  <p>The following rules are added to the Flex tokenizer:</p>
-
-  <pre>B                     b|\\0{0,4}(42|62)(\r\n|[ \t\r\n\f])?
-@{G}{L}{O}{B}{A}{L}   {return GLOBAL_SYM;}</pre>
-
-  <p>Simple selectors in rule sets prefixed by the <code title="">@global</code> @-rule in scoped
-  CSS resources must be processed in the same way as normal rule sets in non-scoped CSS
-  resources.</p>
-
-  <p>Simple selectors in scoped CSS resources that are not prefixed by an <code title="">@global</code> @-rule must only match the <code><a href=#the-style-element>style</a></code> element's parent element (if
-  any), and that element's descendants.</p>
-<!--REMOVE-TOPIC:CSS-->
-
-  <hr></div>
-
   <p id=title-on-style>The <dfn id=attr-style-title title=attr-style-title><code>title</code></dfn> attribute on
   <code><a href=#the-style-element>style</a></code> elements defines <a href=#alternative-style-sheet-sets>alternative style sheet sets</a>. If the
   <code><a href=#the-style-element>style</a></code> element has no <code title=attr-style-title><a href=#attr-style-title>title</a></code> attribute, then it
@@ -13882,21 +13859,99 @@
        requirement.
   -->
 
-  <div class=impl>
+  <hr><div class=impl>
 
-  <p>All descendant elements must be processed, according to their semantics, before the
-  <code><a href=#the-style-element>style</a></code> element itself is evaluated. For styling languages that consist of pure text
-  (as opposed to XML), user agents must evaluate <code><a href=#the-style-element>style</a></code> elements by passing the
-  concatenation of the contents of all the <code><a href=#text>Text</a></code> nodes that are children of the
-  <code><a href=#the-style-element>style</a></code> element (not any other nodes such as comments or elements), in <a href=#tree-order>tree
-  order</a>, to the style system. For XML-based styling languages, user agents must pass all the
-  child nodes of the <code><a href=#the-style-element>style</a></code> element to the style system.</p>
+  <p>Whenever one of the following conditions occur:</p>
 
-  <p>All <a href=#url title=URL>URLs</a> found by the styling language's processor must be <a href=#resolve-a-url title="resolve a url">resolved</a>, relative to the element (or as defined by the styling
-  language), when the processor is invoked.<!-- so dynamic changes to the base URL don't affect the
-  CSS --></p>
+  <ul><li>the element is popped off the <a href=#stack-of-open-elements>stack of open elements</a> of an <a href=#html-parser>HTML
+   parser</a> or <a href=#xml-parser>XML parser</a>,
 
-  <!-- the next few paragraph are similar to text in the <style> section -->
+   <li>the element is not on the <a href=#stack-of-open-elements>stack of open elements</a> of an <a href=#html-parser>HTML parser</a>
+   or <a href=#xml-parser>XML parser</a>, and it is <a href=#insert-an-element-into-a-document title="insert an element into a
+   document">inserted into a document</a> or <a href=#remove-an-element-from-a-document title="remove an element from a
+   document">removed from a document</a>,
+
+   <li>the element is not on the <a href=#stack-of-open-elements>stack of open elements</a> of an <a href=#html-parser>HTML parser</a>
+   or <a href=#xml-parser>XML parser</a>, and one of its child nodes is modified by a script,
+
+  </ul><p>...the user agent must <a href=#queue-a-task>queue a task</a> to invoke the <dfn id=update-a-style-block>update a <code>style</code>
+  block</dfn> algorithm that applies for the style sheet language specified by the element's <code title=attr-style-type><a href=#attr-style-type>type</a></code> attribute, passing it the element's <dfn id=style-data>style
+  data</dfn>.</p>
+
+  <p>For styling languages that consist of pure text (as opposed to XML), a <code><a href=#the-style-element>style</a></code>
+  element's <a href=#style-data>style data</a> is the concatenation of the contents of all the
+  <code><a href=#text>Text</a></code> nodes that are children of the <code><a href=#the-style-element>style</a></code> element (not any other nodes
+  such as comments or elements), in <a href=#tree-order>tree order</a>. For XML-based styling languages, the
+  <a href=#style-data>style data</a> consists of all the child nodes of the <code><a href=#the-style-element>style</a></code> element.</p>
+
+  <p>The <a href=#update-a-style-block>update a <code>style</code> block</a> algorithm for CSS (<code>text/css</code>) is
+  as follows:</p>
+
+  <ol><li><p>Let <var title="">element</var> be the <code><a href=#the-style-element>style</a></code> element.</li>
+
+   <li><p>If <var title="">element</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 the CSS style sheet</a> in question.</li>
+
+   <li><p>If <var title="">element</var> is not <a href=#in-a-document>in a <code>Document</code></a>, then abort
+   these steps.</li>
+
+   <li>
+
+    <p><a href=#create-a-css-style-sheet>Create a CSS style sheet</a> with the following properties:</p>
+
+    <dl><dt><a href=#concept-css-style-sheet-type title=concept-css-style-sheet-type>type</a></dt>
+     <dd><p><code title="">text/css</code></dd>
+
+     <dt><a href=#concept-css-style-sheet-owner-node title=concept-css-style-sheet-owner-node>owner node</a></dt>
+     <dd><p><var title="">element</var></dd>
+
+     <dt><a href=#concept-css-style-sheet-media title=concept-css-style-sheet-media>media</a></dt>
+
+     <dd>
+
+      <p>The <code title=attr-style-media><a href=#attr-style-media>media</a></code> attribute of <var title="">element</var>.</p>
+
+      <p class=note>This is a reference to the (possibly absent at this time) attribute, rather
+      than a copy of the attribute's current value. The CSSOM specification defines what happens
+      when the attribute is dynamically set, changed, or removed.</p>
+
+     </dd>
+
+     <dt><a href=#concept-css-style-sheet-title title=concept-css-style-sheet-title>title</a></dt>
+
+     <dd>
+
+      <p>The <code title=attr-style-title><a href=#attr-style-title>title</a></code> attribute of <var title="">element</var>.</p>
+
+      <p class=note>Again, this is a <em>reference</em> to the attribute.</p>
+
+     </dd>
+
+     <dt><a href=#concept-css-style-sheet-alternate-flag title=concept-css-style-sheet-alternate-flag>alternate flag</a></dt>
+     <dd><p>Unset.</dd>
+
+     <dt><a href=#concept-css-style-sheet-origin-clean-flag title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</a></dt>
+     <dd><p>Set.</dd>
+
+     <dt><a href=#concept-css-style-sheet-location title=concept-css-style-sheet-location>location</a></dt>
+     <dt><a href=#concept-css-style-sheet-parent-css-style-sheet title=concept-css-style-sheet-parent-CSS-style-sheet>parent CSS style sheet</a></dt>
+     <dt><a href=#concept-css-style-sheet-owner-css-rule title=concept-css-style-sheet-owner-CSS-rule>owner CSS rule</a></dt>
+     <dd><p>null</dd>
+
+     <dt><a href=#concept-css-style-sheet-disabeld-flag title=concept-css-style-sheet-disabeld-flag>disabled flag</a></dt>
+     <dd><p>Left at its default value.</dd>
+
+     <dt><a href=#concept-css-style-sheet-css-rules title=concept-css-style-sheet-CSS-rules>CSS rules</a></dt>
+     <dd><p>Left uninitialized.</dd>
+
+    </dl><!-- <p>All <span title="URL">URLs</span> found by the styling language's processor must be
+    <span title="resolve a url">resolved</span>, relative to the element (or as defined by the
+    styling language), when the processor is invoked.</p>--><!-- so dynamic changes to the base URL
+    don't affect the CSS --></li>
+
+  </ol><p>This specification does not define any other styling language's <i><a href=#update-a-style-block>update a <code>style</code>
+  block</a></i> algorithm.</p>
+
+  <!-- the next few paragraph are similar to text in the <link> section -->
   <p>Once the attempts to obtain the style sheet's <a href=#critical-subresources>critical subresources</a>, if any, are
   complete, or, if the style sheet has no <a href=#critical-subresources>critical subresources</a>, once the style sheet
   has been parsed and processed, the user agent must, if the loads were successful or there were
@@ -13926,12 +13981,8 @@
 
   </div>
 
-  <p>The <dfn id=dom-style-disabled title=dom-style-disabled><code>disabled</code></dfn> IDL attribute behaves as
-  defined <a href=#dom-linkstyle-disabled title=dom-linkstyle-disabled>for the alternative style sheets DOM</a>.</p>
+  <p>The <code><a href=#linkstyle>LinkStyle</a></code> interface is also implemented by this element. <a href=#refsCSSOM>[CSSOM]</a></p>
 
-  <p>The <code><a href=#linkstyle>LinkStyle</a></code> interface is also implemented by this element; the <a href=#styling>styling
-  processing model</a> defines how. <a href=#refsCSSOM>[CSSOM]</a></p>
-
   <div class=example>
 
    <p>The following document has its stress emphasis styled as bright red text rather than italics
@@ -13958,91 +14009,44 @@
 
 
 
-
-  <h4 id=styling><span class=secno>4.2.7 </span><dfn title="styling processing model">Styling</dfn></h4>
-
-  <p>The <code><a href=#the-link-element>link</a></code> and <code><a href=#the-style-element>style</a></code> elements can provide styling information for the
-  user agent to use when rendering the document. The CSS and CSSOM specifications specify what
-  styling information is to be used by the user agent and how it is to be used. <a href=#refsCSS>[CSS]</a> <a href=#refsCSSOM>[CSSOM]</a></p>
-
-  <p>The <code><a href=#the-style-element>style</a></code> and <code><a href=#the-link-element>link</a></code> elements implement the <code><a href=#linkstyle>LinkStyle</a></code>
-  interface. <a href=#refsCSSOM>[CSSOM]</a></p>
-
+<!--ADD-TOPIC:CSS-->
   <div class=impl>
 
-  <p>For <code><a href=#the-style-element>style</a></code> elements, if the user agent does not support the specified styling
-  language, then the <code title=dom-LinkStyle-sheet><a href=#dom-linkstyle-sheet>sheet</a></code> attribute of the element's
-  <code><a href=#linkstyle>LinkStyle</a></code> interface must return null. Similarly, <code><a href=#the-link-element>link</a></code> elements that do
-  not represent <a href=#link-type-stylesheet title=rel-stylesheet>external resource links that contribute to the styling
-  processing model</a> (i.e. that do not have a <code title=rel-stylesheet><a href=#link-type-stylesheet>stylesheet</a></code>
-  keyword in their <code title=attr-link-rel><a href=#attr-link-rel>rel</a></code> attribute), for which <a href=#the-link-is-an-alternative-stylesheet>the link is an
-  alternative stylesheet</a> but whose <code title=dom-title><a href=#dom-title>title</a></code> content attribute is
-  absent or empty, or whose resource is <a href=#cors-cross-origin>CORS-cross-origin</a>, must have their
-  <code><a href=#linkstyle>LinkStyle</a></code> interface's <code title=dom-LinkStyle-sheet><a href=#dom-linkstyle-sheet>sheet</a></code> attribute return
-  null.</p>
+  <h5 id=the- at global-rule><span class=secno>4.2.6.1 </span>The <code title="">@global</code> rule</h5>
 
-  <p>Otherwise, the <code><a href=#linkstyle>LinkStyle</a></code> interface's <code title=dom-LinkStyle-sheet><a href=#dom-linkstyle-sheet>sheet</a></code> attribute must return null if the corresponding element
-  is not <a href=#in-a-document>in a <code>Document</code></a>,
-  <!-- link: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1934 -->
-  <!-- style: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1935 -->
-  and otherwise must return a <code><a href=#stylesheet>StyleSheet</a></code> object with the following properties: <a href=#refsCSSOM>[CSSOM]</a></p>
+  <p class=critical>The following will eventually be moved to a CSS specification; it is specified
+  here only on an interim basis until an editor can be found to own this.</p>
 
-  <dl><dt>The style sheet type</dt>
+  <p>Within scoped CSS resources, authors may use an <code title="">@global</code> @-rule. The
+  syntax of this rule is defined as follows.</p>
 
-   <dd><p>The style sheet type must be the same as the style's specified type. For
-   <code><a href=#the-style-element>style</a></code> elements, this is the same as the <code title=attr-style-type><a href=#attr-style-type>type</a></code>
-   content attribute's value, or <code title="">text/css</code> if that is omitted. For
-   <code><a href=#the-link-element>link</a></code> elements, this is the <a href=#content-type title=Content-Type>Content-Type metadata of the
-   specified resource</a>.</dd>
+  <p>The following production is added to the grammar:</p>
 
-   <dt>The style sheet location</dt>
+  <pre>global
+  : GLOBAL_SYM S* ruleset
+  ;</pre>
 
-   <dd><p>For <code><a href=#the-link-element>link</a></code> elements, the location must be the result of <a href=#resolve-a-url title="resolve a
-   url">resolving</a> the <a href=#url>URL</a> given by the element's <code title=attr-link-href><a href=#attr-link-href>href</a></code> content attribute, relative to the element, or the empty
-   string if that fails. For <code><a href=#the-style-element>style</a></code> elements, there is no location.</dd> <!-- note
-   that this might not match the style sheet URL, if the base URL has changed for instance -->
+  <p>The following rules are added to the Flex tokenizer:</p>
 
-   <dt>The style sheet media</dt>
+  <pre>B                     b|\\0{0,4}(42|62)(\r\n|[ \t\r\n\f])?
+@{G}{L}{O}{B}{A}{L}   {return GLOBAL_SYM;}</pre>
 
-   <dd><p>The media must be the same as the value of the element's <code title="">media</code>
-   content attribute, or the empty string, if the attribute is omitted.</dd>
+  <p>Simple selectors in rule sets prefixed by the <code title="">@global</code> @-rule in scoped
+  CSS resources must be processed in the same way as normal rule sets in non-scoped CSS
+  resources.</p>
 
-   <dt>The style sheet title</dt>
+  <p>Simple selectors in scoped CSS resources that are not prefixed by an <code title="">@global</code> @-rule must only match the <code><a href=#the-style-element>style</a></code> element's parent element (if
+  any), and that element's descendants.</p>
 
-   <dd><p>The title must be the same as the value of the element's <code title=dom-title><a href=#dom-title>title</a></code> content attribute, if the attribute is present and has a non-empty
-   value. If the attribute is absent or its value is the empty string, then the style sheet does not
-   have a title (it is the empty string). The title is used for defining <a href=#alternative-style-sheet-sets>alternative style
-   sheet sets</a>.</dd>
+  </div>
+<!--REMOVE-TOPIC:CSS-->
 
-   <dt>The style sheet alternate flag</dt>
 
-   <dd><p>For <code><a href=#the-link-element>link</a></code> elements, true if <a href=#the-link-is-an-alternative-stylesheet>the link is an alternative
-   stylesheet</a>. In all other cases, false.</dd>
+  <div class=impl>
 
-<!--
-   <dt>The style sheet disabled flag</dt> (not included, because I assume CSSOM will change to not
-   require this spec to initialise the value, but will instead initialise it based on the other
-   values)
--->
+  <h4 id=interactions-of-styling-and-scripting><span class=secno>4.2.7 </span>Interactions of styling and scripting</h4>
 
-  </dl><p>The same object must be returned each time.</p>
-
-  <p>The <dfn id=dom-linkstyle-disabled title=dom-LinkStyle-disabled><code>disabled</code></dfn> IDL attribute on
-  <code><a href=#the-link-element>link</a></code> and <code><a href=#the-style-element>style</a></code> elements must return false and do nothing on setting, if
-  the <code title=dom-linkstyle-sheet><a href=#dom-linkstyle-sheet>sheet</a></code> attribute of their <code><a href=#linkstyle>LinkStyle</a></code>
-  interface is null. Otherwise, it must return the value of the <code><a href=#stylesheet>StyleSheet</a></code> interface's
-  <code title=dom-stylesheet-disabled><a href=#dom-stylesheet-disabled>disabled</a></code> attribute on getting, and forward the new
-  value to that same attribute on setting.</p>
-
-  <!-- [CSSOM] covers the following: the term "alternative style sheet sets", the term "default
-  style sheet set", preferred stylesheets, alternative stylesheets, persistent stylesheets, ordering
-  of stylesheets, dynamic additions/removals, window.styleSheets, style sheets given by HTTP Link:
-  headers, and the alternative style sheet API -->
-
-  <p id=alternate-style-sheets>The rules for handling alternative style sheets are defined in the
-  CSS object model specification. <a href=#refsCSSOM>[CSSOM]</a></p>
-
-  <hr><p>Style sheets, whether added by a <code><a href=#the-link-element>link</a></code> element, a <code><a href=#the-style-element>style</a></code> element, an
+  <p>Style sheets, whether added by a <code><a href=#the-link-element>link</a></code> element, a <code><a href=#the-style-element>style</a></code> element, an
   <code><?xml-stylesheet></code> PI, an HTTP <code title=http-link>Link:</code> header, or some
   other mechanism, have a <dfn id=style-sheet-ready>style sheet ready</dfn> flag, which is initially unset.</p>
 
@@ -14086,6 +14090,7 @@
 
 
 
+
   <h3 id=sections><span class=secno>4.3 </span>Sections</h3>
 
   <h4 id=the-body-element><span class=secno>4.3.1 </span>The <dfn><code>body</code></dfn> element</h4>
@@ -32879,7 +32884,7 @@
   <h5 id=rel-icon><span class=secno>4.8.5.6 </span>Link type "<dfn title=rel-icon><code>icon</code></dfn>"</h5>
 
   <p>The <code title=rel-icon><a href=#rel-icon>icon</a></code> keyword may be used with <code><a href=#the-link-element>link</a></code> elements.
-  This keyword creates an <a href=#external-resource-link title="external resource link">external resource link</a>.</p>
+  This keyword creates an <a href=#external-resource-link>external resource link</a>.</p>
 
   <div class=impl>
 
@@ -33152,11 +33157,12 @@
   a <dfn id=rel-sidebar-hyperlink title=rel-sidebar-hyperlink>sidebar hyperlink</dfn>.</p>
 
 
+<!--ADD-TOPIC:CSS-->
   <h5 id=link-type-stylesheet><span class=secno>4.8.5.14 </span>Link type "<dfn title=rel-stylesheet><code>stylesheet</code></dfn>"</h5>
 
   <p>The <code title=rel-stylesheet><a href=#link-type-stylesheet>stylesheet</a></code> keyword may be used with <code><a href=#the-link-element>link</a></code>
   elements. This keyword creates an <a href=#external-resource-link title="external resource link">external resource
-  link</a> that contributes to the <a href=#styling>styling processing model</a>.</p>
+  link</a> that contributes to the styling processing model.</p>
 
   <p>The specified resource is a resource that describes how to present the document. Exactly how
   the resource is to be processed depends on the actual type of the resource.</p>
@@ -33173,26 +33179,121 @@
 
   <p>The appropriate times to <a href=#concept-link-obtain title=concept-link-obtain>obtain</a> the resource are:
 
-  <ul><li><p>When the <a href=#external-resource-link title="external resource link">external resource link</a>'s
-   <code><a href=#the-link-element>link</a></code> element is <a href=#insert-an-element-into-a-document title="insert an element into a document">inserted into a
-   document</a>.</li>
+  <ul><li><p>When the <a href=#external-resource-link>external resource link</a> is created, if its <code><a href=#the-link-element>link</a></code> element
+   is already <a href=#in-a-document>in a <code>Document</code></a>.</li>
+   <!-- e.g. rel="" changed, href="" set... -->
 
-   <li><p>When the <a href=#external-resource-link title="external resource link">external resource link</a> is created on
-   a <code><a href=#the-link-element>link</a></code> element that is already <a href=#in-a-document>in a <code>Document</code></a>.</li>
+   <li><p>When the <a href=#external-resource-link>external resource link</a>'s <code><a href=#the-link-element>link</a></code> element is <a href=#insert-an-element-into-a-document title="insert an element into a document">inserted into a document</a>.</li>
 
+   <li><p>When the <a href=#external-resource-link>external resource link</a> is created on a <code><a href=#the-link-element>link</a></code> element
+   that is already <a href=#in-a-document>in a <code>Document</code></a>.</li>
+
    <li><p>When the <code title=attr-link-href><a href=#attr-link-href>href</a></code> attribute of the <code><a href=#the-link-element>link</a></code>
-   element of an <a href=#external-resource-link title="external resource link">external resource link</a> that is already
-   <a href=#in-a-document>in a <code>Document</code></a> is changed.</li>
+   element of an <a href=#external-resource-link>external resource link</a> that is already <a href=#in-a-document>in a
+   <code>Document</code></a> is changed.</li>
    <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2588 -->
 
+   <li><p>When the <code title=attr-link-crossorigin><a href=#attr-link-crossorigin>crossorigin</a></code> attribute of the
+   <code><a href=#the-link-element>link</a></code> element of an <a href=#external-resource-link title="external resource link">external resource
+   link</a> that is already <a href=#in-a-document>in a <code>Document</code></a> is set, changed, or
+   removed.</li>
+
+   <li><p>When the <code title=attr-link-type><a href=#attr-link-type>type</a></code> attribute of the <code><a href=#the-link-element>link</a></code>
+   element of an <a href=#external-resource-link>external resource link</a> that is already <a href=#in-a-document>in a
+   <code>Document</code></a> is set or changed to a value that does not or no longer matches the
+   <a href=#content-type title=Content-Type>Content-Type metadata</a> of the previous obtained external
+   resource, if any.</li>
+
+   <li><p>When the <code title=attr-link-type><a href=#attr-link-type>type</a></code> attribute of the <code><a href=#the-link-element>link</a></code>
+   element of an <a href=#external-resource-link>external resource link</a> that is already <a href=#in-a-document>in a
+   <code>Document</code></a> but was previously not obtained due to the <code title=attr-link-type><a href=#attr-link-type>type</a></code> attribute specifying an unsupported type is set, removed, or
+   changed.</li>
+
+   <li><p>When the <a href=#external-resource-link>external resource link</a> changes from being <a href=#the-link-is-an-alternative-stylesheet title="the link is
+   an alternative stylesheet">an alternative stylesheet</a> to not being one, or vice
+   versa.</li>
+
   </ul><p><strong>Quirk</strong>: If the document has been set to <a href=#quirks-mode>quirks mode</a>, has the
   <a href=#same-origin>same origin</a> as the <a href=#url>URL</a> of the external resource<!-- CVE-2010-0654 -->,
   and the <a href=#content-type title=Content-Type>Content-Type metadata</a> of the external resource is not a
   supported style sheet type, the user agent must instead assume it to be <code title="">text/css</code>.</p>
 
-  </div>
+  <p>Once a resource has been <a href=#concept-link-obtain title=concept-link-obtain>obtained</a>, if its <a href=#content-type title=Content-Type>Content-Type metadata</a> is <code title="">text/css</code>, the user
+  agent must run these steps:</p>
 
+  <ol><li><p>Let <var title="">element</var> be the <code><a href=#the-link-element>link</a></code> element that created the
+   <a href=#external-resource-link>external resource link</a>.</li>
 
+   <li><p>If <var title="">element</var> no longer creates an <a href=#external-resource-link>external resource link</a>
+   that contributes to the styling processing model, or if, since the resource in question was <a href=#concept-link-obtain title=concept-link-obtain>obtained</a>, it has become appropriate to <a href=#concept-link-obtain title=concept-link-obtain>obtain</a> it again (meaning this algorithm is about to be
+   invoked again for a newly obtained resource), then abort these steps.</li>
+
+   <li><p>If <var title="">element</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 the CSS style sheet</a> in question.</li>
+
+   <li>
+
+    <p><a href=#create-a-css-style-sheet>Create a CSS style sheet</a> with the following properties:</p>
+
+    <dl><dt><a href=#concept-css-style-sheet-type title=concept-css-style-sheet-type>type</a></dt>
+     <dd><p><code title="">text/css</code></dd>
+
+     <dt><a href=#concept-css-style-sheet-location title=concept-css-style-sheet-location>location</a></dt>
+     <dd>
+
+      <p>The <a href=#resulting-absolute-url>resulting absolute URL</a> determined during the <a href=#concept-link-obtain title=concept-link-obtain>obtain</a> algorithm.</p>
+
+      <p class=note>This is before any redirects get applied.</p>
+
+     </dd>
+
+     <dt><a href=#concept-css-style-sheet-owner-node title=concept-css-style-sheet-owner-node>owner node</a></dt>
+     <dd><p><var title="">element</var></dd>
+
+     <dt><a href=#concept-css-style-sheet-media title=concept-css-style-sheet-media>media</a></dt>
+
+     <dd>
+
+      <p>The <code title=attr-link-media><a href=#attr-link-media>media</a></code> attribute of <var title="">element</var>.</p>
+
+      <p class=note>This is a reference to the (possibly absent at this time) attribute, rather
+      than a copy of the attribute's current value. The CSSOM specification defines what happens
+      when the attribute is dynamically set, changed, or removed.</p>
+
+     </dd>
+
+     <dt><a href=#concept-css-style-sheet-title title=concept-css-style-sheet-title>title</a></dt>
+
+     <dd>
+
+      <p>The <code title=attr-link-title><a href=#attr-link-title>title</a></code> attribute of <var title="">element</var>.</p>
+
+      <p class=note>This is similarly a reference to the attribute, rather than a copy of the
+      attribute's current value.</p>
+
+     </dd>
+
+     <dt><a href=#concept-css-style-sheet-alternate-flag title=concept-css-style-sheet-alternate-flag>alternate flag</a></dt>
+     <dd><p>Set if <a href=#the-link-is-an-alternative-stylesheet>the link is an alternative stylesheet</a>; unset otherwise.</dd>
+
+     <dt><a href=#concept-css-style-sheet-origin-clean-flag title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</a></dt>
+     <dd><p>Set if the resource is <a href=#cors-same-origin>CORS-same-origin</a>; unset otherwise.</dd>
+
+     <dt><a href=#concept-css-style-sheet-parent-css-style-sheet title=concept-css-style-sheet-parent-CSS-style-sheet>parent CSS style sheet</a></dt>
+     <dt><a href=#concept-css-style-sheet-owner-css-rule title=concept-css-style-sheet-owner-CSS-rule>owner CSS rule</a></dt>
+     <dd><p>null</dd>
+
+     <dt><a href=#concept-css-style-sheet-disabeld-flag title=concept-css-style-sheet-disabeld-flag>disabled flag</a></dt>
+     <dd><p>Left at its default value.</dd>
+
+     <dt><a href=#concept-css-style-sheet-css-rules title=concept-css-style-sheet-CSS-rules>CSS rules</a></dt>
+     <dd><p>Left uninitialized.</dd>
+
+    </dl></li>
+
+  </ol></div>
+<!--REMOVE-TOPIC:CSS-->
+
+
   <h5 id=link-type-tag><span class=secno>4.8.5.15 </span>Link type "<dfn title=rel-tag><code>tag</code></dfn>"</h5>
 
   <p>The <code title=rel-tag><a href=#link-type-tag>tag</a></code> keyword may be used with <code><a href=#the-a-element>a</a></code> and

Modified: index
===================================================================
--- index	2014-01-09 19:19:21 UTC (rev 8389)
+++ index	2014-01-13 22:45:39 UTC (rev 8390)
@@ -298,7 +298,7 @@
 
   <header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 9 January 2014</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 13 January 2014</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -504,8 +504,10 @@
        <li><a href=#pragma-directives><span class=secno>4.2.5.3 </span>Pragma directives</a></li>
        <li><a href=#other-pragma-directives><span class=secno>4.2.5.4 </span>Other pragma directives</a></li>
        <li><a href=#charset><span class=secno>4.2.5.5 </span>Specifying the document's character encoding</a></ol></li>
-     <li><a href=#the-style-element><span class=secno>4.2.6 </span>The <code>style</code> element</a></li>
-     <li><a href=#styling><span class=secno>4.2.7 </span>Styling</a></ol></li>
+     <li><a href=#the-style-element><span class=secno>4.2.6 </span>The <code>style</code> element</a>
+      <ol>
+       <li><a href=#the- at global-rule><span class=secno>4.2.6.1 </span>The <code title="">@global</code> rule</a></ol></li>
+     <li><a href=#interactions-of-styling-and-scripting><span class=secno>4.2.7 </span>Interactions of styling and scripting</a></ol></li>
    <li><a href=#sections><span class=secno>4.3 </span>Sections</a>
     <ol>
      <li><a href=#the-body-element><span class=secno>4.3.1 </span>The <code>body</code> element</a></li>
@@ -3921,8 +3923,20 @@
      <li><dfn id=cssstyledeclaration><code>CSSStyleDeclaration</code></dfn></li>
      <li><dfn id=dom-cssstyledeclaration-csstext title=dom-CSSStyleDeclaration-cssText><code>cssText</code></dfn> attribute of <code><a href=#cssstyledeclaration>CSSStyleDeclaration</a></code></li>
      <li><dfn id=stylesheet><code>StyleSheet</code></dfn></li>
-     <li><dfn id=dom-linkstyle-sheet title=dom-linkstyle-sheet><code>sheet</code></dfn></li>
-     <li><dfn id=dom-stylesheet-disabled title=dom-stylesheet-disabled><code>disabled</code></dfn></li>
+     <li>The terms <dfn id=create-a-css-style-sheet>create a CSS style sheet</dfn>, <dfn id=remove-a-css-style-sheet>remove a CSS style sheet</dfn>, and <dfn id=associated-css-style-sheet>associated CSS style sheet</dfn></li>
+     <li><dfn id=css-style-sheet title="CSS style sheet">CSS style sheets</dfn> and their properties:
+         <dfn id=concept-css-style-sheet-type title=concept-css-style-sheet-type>type</dfn>,
+         <dfn id=concept-css-style-sheet-location title=concept-css-style-sheet-location>location</dfn>,
+         <dfn id=concept-css-style-sheet-parent-css-style-sheet title=concept-css-style-sheet-parent-CSS-style-sheet>parent CSS style sheet</dfn>,
+         <dfn id=concept-css-style-sheet-owner-node title=concept-css-style-sheet-owner-node>owner node</dfn>,
+         <dfn id=concept-css-style-sheet-owner-css-rule title=concept-css-style-sheet-owner-CSS-rule>owner CSS rule</dfn>,
+         <dfn id=concept-css-style-sheet-media title=concept-css-style-sheet-media>media</dfn>,
+         <dfn id=concept-css-style-sheet-title title=concept-css-style-sheet-title>title</dfn>,
+         <dfn id=concept-css-style-sheet-alternate-flag title=concept-css-style-sheet-alternate-flag>alternate flag</dfn>,
+         <dfn id=concept-css-style-sheet-disabeld-flag title=concept-css-style-sheet-disabeld-flag>disabled flag</dfn>,
+         <dfn id=concept-css-style-sheet-css-rules title=concept-css-style-sheet-CSS-rules>CSS rules</dfn>,
+         <dfn id=concept-css-style-sheet-origin-clean-flag title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</dfn>
+     </li>
      <li><dfn id=alternative-style-sheet-sets>Alternative style sheet sets</dfn> and the <dfn id=preferred-style-sheet-set>preferred style sheet set</dfn></li>
      <li><dfn id=serializing-a-css-value>Serializing a CSS value</dfn></li>
      <li><dfn id=scroll-an-element-into-view>Scroll an element into view</dfn></li>
@@ -12536,7 +12550,6 @@
    <dt><a href=#element-dfn-dom title=element-dfn-dom>DOM interface</a>:</dt><!--TOPIC:DOM APIs-->
    <dd>
 <pre class=idl>interface <dfn id=htmllinkelement>HTMLLinkElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
-           attribute boolean <a href=#dom-link-disabled title=dom-link-disabled>disabled</a>;
            attribute DOMString <a href=#dom-link-href title=dom-link-href>href</a>;
            attribute DOMString <a href=#dom-link-crossorigin title=dom-link-crossOrigin>crossOrigin</a>;
            attribute DOMString <a href=#dom-link-rel title=dom-link-rel>rel</a>;
@@ -12830,14 +12843,8 @@
 
   </div>
 
-  <p>The IDL attribute <dfn id=dom-link-disabled title=dom-link-disabled><code>disabled</code></dfn> only applies to
-  style sheet links. When the <code><a href=#the-link-element>link</a></code> element defines a style sheet link, then the <code title=dom-link-disabled><a href=#dom-link-disabled>disabled</a></code> attribute behaves as defined <a href=#dom-linkstyle-disabled title=dom-linkstyle-disabled>for the alternative style sheets DOM</a>. For all other
-  <code><a href=#the-link-element>link</a></code> elements it always return false and does nothing on setting.</p> <!-- that is
-  normatively required in the definition of dom-linkstyle-disabled -->
+  <p>The <code><a href=#linkstyle>LinkStyle</a></code> interface is also implemented by this element. <a href=#refsCSSOM>[CSSOM]</a></p>
 
-  <p>The <code><a href=#linkstyle>LinkStyle</a></code> interface is also implemented by this element; the <a href=#styling>styling
-  processing model</a> defines how. <a href=#refsCSSOM>[CSSOM]</a></p>
-
   <div class=example>
 
    <p>Here, a set of <code><a href=#the-link-element>link</a></code> elements provide some style sheets:</p>
@@ -13756,7 +13763,6 @@
    <dt><a href=#element-dfn-dom title=element-dfn-dom>DOM interface</a>:</dt><!--TOPIC:DOM APIs-->
    <dd>
 <pre class=idl>interface <dfn id=htmlstyleelement>HTMLStyleElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
-           attribute boolean <a href=#dom-style-disabled title=dom-style-disabled>disabled</a>;
            attribute DOMString <a href=#dom-style-media title=dom-style-media>media</a>;
            attribute DOMString <a href=#dom-style-type title=dom-style-type>type</a>;
            attribute boolean <a href=#dom-style-scoped title=dom-style-scoped>scoped</a>;
@@ -13764,8 +13770,8 @@
 <a href=#htmlstyleelement>HTMLStyleElement</a> implements <a href=#linkstyle>LinkStyle</a>;</pre>
    </dd>
   </dl><!--TOPIC:HTML--><p>The <code><a href=#the-style-element>style</a></code> element allows authors to embed style information in their documents.
-  The <code><a href=#the-style-element>style</a></code> element is one of several inputs to the <a href=#styling>styling processing
-  model</a>. The element does not <a href=#represents title=represents>represent</a> content for the
+  The <code><a href=#the-style-element>style</a></code> element is one of several inputs to the styling processing
+  model. The element does not <a href=#represents title=represents>represent</a> content for the
   user.</p>
 
   <p>The <dfn id=attr-style-type title=attr-style-type><code>type</code></dfn> attribute gives the styling language.
@@ -13818,41 +13824,12 @@
   <p class=note>A <code><a href=#the-style-element>style</a></code> element <em>without</em> a <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute is restricted to appearing in the
   <code><a href=#the-head-element>head</a></code> of the document.</p>
 
-  <div class=impl>
-
-<!--ADD-TOPIC:CSS-->
-
   <p>A style sheet declared by a <code><a href=#the-style-element>style</a></code> element that has a <code title=attr-style-scoped><a href=#attr-style-scoped>scoped</a></code> attribute and has a parent node that is an element is
   <i>scoped</i>, with the <i>scoping element</i> being the <code><a href=#the-style-element>style</a></code> element's parent
   element. <a href=#refsCSSSCOPED>[CSSSCOPED]</a></p>
 
-  <p class=critical>The following will eventually be moved to a CSS specification; it is specified
-  here only on an interim basis until an editor can be found to own this.</p>
+  <!-- <p class="note">Currently, this is only defined for CSS.</p> -->
 
-  <p>Within scoped CSS resources, authors may use an <code title="">@global</code> @-rule. The
-  syntax of this rule is defined as follows.</p>
-
-  <p>The following production is added to the grammar:</p>
-
-  <pre>global
-  : GLOBAL_SYM S* ruleset
-  ;</pre>
-
-  <p>The following rules are added to the Flex tokenizer:</p>
-
-  <pre>B                     b|\\0{0,4}(42|62)(\r\n|[ \t\r\n\f])?
-@{G}{L}{O}{B}{A}{L}   {return GLOBAL_SYM;}</pre>
-
-  <p>Simple selectors in rule sets prefixed by the <code title="">@global</code> @-rule in scoped
-  CSS resources must be processed in the same way as normal rule sets in non-scoped CSS
-  resources.</p>
-
-  <p>Simple selectors in scoped CSS resources that are not prefixed by an <code title="">@global</code> @-rule must only match the <code><a href=#the-style-element>style</a></code> element's parent element (if
-  any), and that element's descendants.</p>
-<!--REMOVE-TOPIC:CSS-->
-
-  <hr></div>
-
   <p id=title-on-style>The <dfn id=attr-style-title title=attr-style-title><code>title</code></dfn> attribute on
   <code><a href=#the-style-element>style</a></code> elements defines <a href=#alternative-style-sheet-sets>alternative style sheet sets</a>. If the
   <code><a href=#the-style-element>style</a></code> element has no <code title=attr-style-title><a href=#attr-style-title>title</a></code> attribute, then it
@@ -13882,21 +13859,99 @@
        requirement.
   -->
 
-  <div class=impl>
+  <hr><div class=impl>
 
-  <p>All descendant elements must be processed, according to their semantics, before the
-  <code><a href=#the-style-element>style</a></code> element itself is evaluated. For styling languages that consist of pure text
-  (as opposed to XML), user agents must evaluate <code><a href=#the-style-element>style</a></code> elements by passing the
-  concatenation of the contents of all the <code><a href=#text>Text</a></code> nodes that are children of the
-  <code><a href=#the-style-element>style</a></code> element (not any other nodes such as comments or elements), in <a href=#tree-order>tree
-  order</a>, to the style system. For XML-based styling languages, user agents must pass all the
-  child nodes of the <code><a href=#the-style-element>style</a></code> element to the style system.</p>
+  <p>Whenever one of the following conditions occur:</p>
 
-  <p>All <a href=#url title=URL>URLs</a> found by the styling language's processor must be <a href=#resolve-a-url title="resolve a url">resolved</a>, relative to the element (or as defined by the styling
-  language), when the processor is invoked.<!-- so dynamic changes to the base URL don't affect the
-  CSS --></p>
+  <ul><li>the element is popped off the <a href=#stack-of-open-elements>stack of open elements</a> of an <a href=#html-parser>HTML
+   parser</a> or <a href=#xml-parser>XML parser</a>,
 
-  <!-- the next few paragraph are similar to text in the <style> section -->
+   <li>the element is not on the <a href=#stack-of-open-elements>stack of open elements</a> of an <a href=#html-parser>HTML parser</a>
+   or <a href=#xml-parser>XML parser</a>, and it is <a href=#insert-an-element-into-a-document title="insert an element into a
+   document">inserted into a document</a> or <a href=#remove-an-element-from-a-document title="remove an element from a
+   document">removed from a document</a>,
+
+   <li>the element is not on the <a href=#stack-of-open-elements>stack of open elements</a> of an <a href=#html-parser>HTML parser</a>
+   or <a href=#xml-parser>XML parser</a>, and one of its child nodes is modified by a script,
+
+  </ul><p>...the user agent must <a href=#queue-a-task>queue a task</a> to invoke the <dfn id=update-a-style-block>update a <code>style</code>
+  block</dfn> algorithm that applies for the style sheet language specified by the element's <code title=attr-style-type><a href=#attr-style-type>type</a></code> attribute, passing it the element's <dfn id=style-data>style
+  data</dfn>.</p>
+
+  <p>For styling languages that consist of pure text (as opposed to XML), a <code><a href=#the-style-element>style</a></code>
+  element's <a href=#style-data>style data</a> is the concatenation of the contents of all the
+  <code><a href=#text>Text</a></code> nodes that are children of the <code><a href=#the-style-element>style</a></code> element (not any other nodes
+  such as comments or elements), in <a href=#tree-order>tree order</a>. For XML-based styling languages, the
+  <a href=#style-data>style data</a> consists of all the child nodes of the <code><a href=#the-style-element>style</a></code> element.</p>
+
+  <p>The <a href=#update-a-style-block>update a <code>style</code> block</a> algorithm for CSS (<code>text/css</code>) is
+  as follows:</p>
+
+  <ol><li><p>Let <var title="">element</var> be the <code><a href=#the-style-element>style</a></code> element.</li>
+
+   <li><p>If <var title="">element</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 the CSS style sheet</a> in question.</li>
+
+   <li><p>If <var title="">element</var> is not <a href=#in-a-document>in a <code>Document</code></a>, then abort
+   these steps.</li>
+
+   <li>
+
+    <p><a href=#create-a-css-style-sheet>Create a CSS style sheet</a> with the following properties:</p>
+
+    <dl><dt><a href=#concept-css-style-sheet-type title=concept-css-style-sheet-type>type</a></dt>
+     <dd><p><code title="">text/css</code></dd>
+
+     <dt><a href=#concept-css-style-sheet-owner-node title=concept-css-style-sheet-owner-node>owner node</a></dt>
+     <dd><p><var title="">element</var></dd>
+
+     <dt><a href=#concept-css-style-sheet-media title=concept-css-style-sheet-media>media</a></dt>
+
+     <dd>
+
+      <p>The <code title=attr-style-media><a href=#attr-style-media>media</a></code> attribute of <var title="">element</var>.</p>
+
+      <p class=note>This is a reference to the (possibly absent at this time) attribute, rather
+      than a copy of the attribute's current value. The CSSOM specification defines what happens
+      when the attribute is dynamically set, changed, or removed.</p>
+
+     </dd>
+
+     <dt><a href=#concept-css-style-sheet-title title=concept-css-style-sheet-title>title</a></dt>
+
+     <dd>
+
+      <p>The <code title=attr-style-title><a href=#attr-style-title>title</a></code> attribute of <var title="">element</var>.</p>
+
+      <p class=note>Again, this is a <em>reference</em> to the attribute.</p>
+
+     </dd>
+
+     <dt><a href=#concept-css-style-sheet-alternate-flag title=concept-css-style-sheet-alternate-flag>alternate flag</a></dt>
+     <dd><p>Unset.</dd>
+
+     <dt><a href=#concept-css-style-sheet-origin-clean-flag title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</a></dt>
+     <dd><p>Set.</dd>
+
+     <dt><a href=#concept-css-style-sheet-location title=concept-css-style-sheet-location>location</a></dt>
+     <dt><a href=#concept-css-style-sheet-parent-css-style-sheet title=concept-css-style-sheet-parent-CSS-style-sheet>parent CSS style sheet</a></dt>
+     <dt><a href=#concept-css-style-sheet-owner-css-rule title=concept-css-style-sheet-owner-CSS-rule>owner CSS rule</a></dt>
+     <dd><p>null</dd>
+
+     <dt><a href=#concept-css-style-sheet-disabeld-flag title=concept-css-style-sheet-disabeld-flag>disabled flag</a></dt>
+     <dd><p>Left at its default value.</dd>
+
+     <dt><a href=#concept-css-style-sheet-css-rules title=concept-css-style-sheet-CSS-rules>CSS rules</a></dt>
+     <dd><p>Left uninitialized.</dd>
+
+    </dl><!-- <p>All <span title="URL">URLs</span> found by the styling language's processor must be
+    <span title="resolve a url">resolved</span>, relative to the element (or as defined by the
+    styling language), when the processor is invoked.</p>--><!-- so dynamic changes to the base URL
+    don't affect the CSS --></li>
+
+  </ol><p>This specification does not define any other styling language's <i><a href=#update-a-style-block>update a <code>style</code>
+  block</a></i> algorithm.</p>
+
+  <!-- the next few paragraph are similar to text in the <link> section -->
   <p>Once the attempts to obtain the style sheet's <a href=#critical-subresources>critical subresources</a>, if any, are
   complete, or, if the style sheet has no <a href=#critical-subresources>critical subresources</a>, once the style sheet
   has been parsed and processed, the user agent must, if the loads were successful or there were
@@ -13926,12 +13981,8 @@
 
   </div>
 
-  <p>The <dfn id=dom-style-disabled title=dom-style-disabled><code>disabled</code></dfn> IDL attribute behaves as
-  defined <a href=#dom-linkstyle-disabled title=dom-linkstyle-disabled>for the alternative style sheets DOM</a>.</p>
+  <p>The <code><a href=#linkstyle>LinkStyle</a></code> interface is also implemented by this element. <a href=#refsCSSOM>[CSSOM]</a></p>
 
-  <p>The <code><a href=#linkstyle>LinkStyle</a></code> interface is also implemented by this element; the <a href=#styling>styling
-  processing model</a> defines how. <a href=#refsCSSOM>[CSSOM]</a></p>
-
   <div class=example>
 
    <p>The following document has its stress emphasis styled as bright red text rather than italics
@@ -13958,91 +14009,44 @@
 
 
 
-
-  <h4 id=styling><span class=secno>4.2.7 </span><dfn title="styling processing model">Styling</dfn></h4>
-
-  <p>The <code><a href=#the-link-element>link</a></code> and <code><a href=#the-style-element>style</a></code> elements can provide styling information for the
-  user agent to use when rendering the document. The CSS and CSSOM specifications specify what
-  styling information is to be used by the user agent and how it is to be used. <a href=#refsCSS>[CSS]</a> <a href=#refsCSSOM>[CSSOM]</a></p>
-
-  <p>The <code><a href=#the-style-element>style</a></code> and <code><a href=#the-link-element>link</a></code> elements implement the <code><a href=#linkstyle>LinkStyle</a></code>
-  interface. <a href=#refsCSSOM>[CSSOM]</a></p>
-
+<!--ADD-TOPIC:CSS-->
   <div class=impl>
 
-  <p>For <code><a href=#the-style-element>style</a></code> elements, if the user agent does not support the specified styling
-  language, then the <code title=dom-LinkStyle-sheet><a href=#dom-linkstyle-sheet>sheet</a></code> attribute of the element's
-  <code><a href=#linkstyle>LinkStyle</a></code> interface must return null. Similarly, <code><a href=#the-link-element>link</a></code> elements that do
-  not represent <a href=#link-type-stylesheet title=rel-stylesheet>external resource links that contribute to the styling
-  processing model</a> (i.e. that do not have a <code title=rel-stylesheet><a href=#link-type-stylesheet>stylesheet</a></code>
-  keyword in their <code title=attr-link-rel><a href=#attr-link-rel>rel</a></code> attribute), for which <a href=#the-link-is-an-alternative-stylesheet>the link is an
-  alternative stylesheet</a> but whose <code title=dom-title><a href=#dom-title>title</a></code> content attribute is
-  absent or empty, or whose resource is <a href=#cors-cross-origin>CORS-cross-origin</a>, must have their
-  <code><a href=#linkstyle>LinkStyle</a></code> interface's <code title=dom-LinkStyle-sheet><a href=#dom-linkstyle-sheet>sheet</a></code> attribute return
-  null.</p>
+  <h5 id=the- at global-rule><span class=secno>4.2.6.1 </span>The <code title="">@global</code> rule</h5>
 
-  <p>Otherwise, the <code><a href=#linkstyle>LinkStyle</a></code> interface's <code title=dom-LinkStyle-sheet><a href=#dom-linkstyle-sheet>sheet</a></code> attribute must return null if the corresponding element
-  is not <a href=#in-a-document>in a <code>Document</code></a>,
-  <!-- link: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1934 -->
-  <!-- style: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1935 -->
-  and otherwise must return a <code><a href=#stylesheet>StyleSheet</a></code> object with the following properties: <a href=#refsCSSOM>[CSSOM]</a></p>
+  <p class=critical>The following will eventually be moved to a CSS specification; it is specified
+  here only on an interim basis until an editor can be found to own this.</p>
 
-  <dl><dt>The style sheet type</dt>
+  <p>Within scoped CSS resources, authors may use an <code title="">@global</code> @-rule. The
+  syntax of this rule is defined as follows.</p>
 
-   <dd><p>The style sheet type must be the same as the style's specified type. For
-   <code><a href=#the-style-element>style</a></code> elements, this is the same as the <code title=attr-style-type><a href=#attr-style-type>type</a></code>
-   content attribute's value, or <code title="">text/css</code> if that is omitted. For
-   <code><a href=#the-link-element>link</a></code> elements, this is the <a href=#content-type title=Content-Type>Content-Type metadata of the
-   specified resource</a>.</dd>
+  <p>The following production is added to the grammar:</p>
 
-   <dt>The style sheet location</dt>
+  <pre>global
+  : GLOBAL_SYM S* ruleset
+  ;</pre>
 
-   <dd><p>For <code><a href=#the-link-element>link</a></code> elements, the location must be the result of <a href=#resolve-a-url title="resolve a
-   url">resolving</a> the <a href=#url>URL</a> given by the element's <code title=attr-link-href><a href=#attr-link-href>href</a></code> content attribute, relative to the element, or the empty
-   string if that fails. For <code><a href=#the-style-element>style</a></code> elements, there is no location.</dd> <!-- note
-   that this might not match the style sheet URL, if the base URL has changed for instance -->
+  <p>The following rules are added to the Flex tokenizer:</p>
 
-   <dt>The style sheet media</dt>
+  <pre>B                     b|\\0{0,4}(42|62)(\r\n|[ \t\r\n\f])?
+@{G}{L}{O}{B}{A}{L}   {return GLOBAL_SYM;}</pre>
 
-   <dd><p>The media must be the same as the value of the element's <code title="">media</code>
-   content attribute, or the empty string, if the attribute is omitted.</dd>
+  <p>Simple selectors in rule sets prefixed by the <code title="">@global</code> @-rule in scoped
+  CSS resources must be processed in the same way as normal rule sets in non-scoped CSS
+  resources.</p>
 
-   <dt>The style sheet title</dt>
+  <p>Simple selectors in scoped CSS resources that are not prefixed by an <code title="">@global</code> @-rule must only match the <code><a href=#the-style-element>style</a></code> element's parent element (if
+  any), and that element's descendants.</p>
 
-   <dd><p>The title must be the same as the value of the element's <code title=dom-title><a href=#dom-title>title</a></code> content attribute, if the attribute is present and has a non-empty
-   value. If the attribute is absent or its value is the empty string, then the style sheet does not
-   have a title (it is the empty string). The title is used for defining <a href=#alternative-style-sheet-sets>alternative style
-   sheet sets</a>.</dd>
+  </div>
+<!--REMOVE-TOPIC:CSS-->
 
-   <dt>The style sheet alternate flag</dt>
 
-   <dd><p>For <code><a href=#the-link-element>link</a></code> elements, true if <a href=#the-link-is-an-alternative-stylesheet>the link is an alternative
-   stylesheet</a>. In all other cases, false.</dd>
+  <div class=impl>
 
-<!--
-   <dt>The style sheet disabled flag</dt> (not included, because I assume CSSOM will change to not
-   require this spec to initialise the value, but will instead initialise it based on the other
-   values)
--->
+  <h4 id=interactions-of-styling-and-scripting><span class=secno>4.2.7 </span>Interactions of styling and scripting</h4>
 
-  </dl><p>The same object must be returned each time.</p>
-
-  <p>The <dfn id=dom-linkstyle-disabled title=dom-LinkStyle-disabled><code>disabled</code></dfn> IDL attribute on
-  <code><a href=#the-link-element>link</a></code> and <code><a href=#the-style-element>style</a></code> elements must return false and do nothing on setting, if
-  the <code title=dom-linkstyle-sheet><a href=#dom-linkstyle-sheet>sheet</a></code> attribute of their <code><a href=#linkstyle>LinkStyle</a></code>
-  interface is null. Otherwise, it must return the value of the <code><a href=#stylesheet>StyleSheet</a></code> interface's
-  <code title=dom-stylesheet-disabled><a href=#dom-stylesheet-disabled>disabled</a></code> attribute on getting, and forward the new
-  value to that same attribute on setting.</p>
-
-  <!-- [CSSOM] covers the following: the term "alternative style sheet sets", the term "default
-  style sheet set", preferred stylesheets, alternative stylesheets, persistent stylesheets, ordering
-  of stylesheets, dynamic additions/removals, window.styleSheets, style sheets given by HTTP Link:
-  headers, and the alternative style sheet API -->
-
-  <p id=alternate-style-sheets>The rules for handling alternative style sheets are defined in the
-  CSS object model specification. <a href=#refsCSSOM>[CSSOM]</a></p>
-
-  <hr><p>Style sheets, whether added by a <code><a href=#the-link-element>link</a></code> element, a <code><a href=#the-style-element>style</a></code> element, an
+  <p>Style sheets, whether added by a <code><a href=#the-link-element>link</a></code> element, a <code><a href=#the-style-element>style</a></code> element, an
   <code><?xml-stylesheet></code> PI, an HTTP <code title=http-link>Link:</code> header, or some
   other mechanism, have a <dfn id=style-sheet-ready>style sheet ready</dfn> flag, which is initially unset.</p>
 
@@ -14086,6 +14090,7 @@
 
 
 
+
   <h3 id=sections><span class=secno>4.3 </span>Sections</h3>
 
   <h4 id=the-body-element><span class=secno>4.3.1 </span>The <dfn><code>body</code></dfn> element</h4>
@@ -32879,7 +32884,7 @@
   <h5 id=rel-icon><span class=secno>4.8.5.6 </span>Link type "<dfn title=rel-icon><code>icon</code></dfn>"</h5>
 
   <p>The <code title=rel-icon><a href=#rel-icon>icon</a></code> keyword may be used with <code><a href=#the-link-element>link</a></code> elements.
-  This keyword creates an <a href=#external-resource-link title="external resource link">external resource link</a>.</p>
+  This keyword creates an <a href=#external-resource-link>external resource link</a>.</p>
 
   <div class=impl>
 
@@ -33152,11 +33157,12 @@
   a <dfn id=rel-sidebar-hyperlink title=rel-sidebar-hyperlink>sidebar hyperlink</dfn>.</p>
 
 
+<!--ADD-TOPIC:CSS-->
   <h5 id=link-type-stylesheet><span class=secno>4.8.5.14 </span>Link type "<dfn title=rel-stylesheet><code>stylesheet</code></dfn>"</h5>
 
   <p>The <code title=rel-stylesheet><a href=#link-type-stylesheet>stylesheet</a></code> keyword may be used with <code><a href=#the-link-element>link</a></code>
   elements. This keyword creates an <a href=#external-resource-link title="external resource link">external resource
-  link</a> that contributes to the <a href=#styling>styling processing model</a>.</p>
+  link</a> that contributes to the styling processing model.</p>
 
   <p>The specified resource is a resource that describes how to present the document. Exactly how
   the resource is to be processed depends on the actual type of the resource.</p>
@@ -33173,26 +33179,121 @@
 
   <p>The appropriate times to <a href=#concept-link-obtain title=concept-link-obtain>obtain</a> the resource are:
 
-  <ul><li><p>When the <a href=#external-resource-link title="external resource link">external resource link</a>'s
-   <code><a href=#the-link-element>link</a></code> element is <a href=#insert-an-element-into-a-document title="insert an element into a document">inserted into a
-   document</a>.</li>
+  <ul><li><p>When the <a href=#external-resource-link>external resource link</a> is created, if its <code><a href=#the-link-element>link</a></code> element
+   is already <a href=#in-a-document>in a <code>Document</code></a>.</li>
+   <!-- e.g. rel="" changed, href="" set... -->
 
-   <li><p>When the <a href=#external-resource-link title="external resource link">external resource link</a> is created on
-   a <code><a href=#the-link-element>link</a></code> element that is already <a href=#in-a-document>in a <code>Document</code></a>.</li>
+   <li><p>When the <a href=#external-resource-link>external resource link</a>'s <code><a href=#the-link-element>link</a></code> element is <a href=#insert-an-element-into-a-document title="insert an element into a document">inserted into a document</a>.</li>
 
+   <li><p>When the <a href=#external-resource-link>external resource link</a> is created on a <code><a href=#the-link-element>link</a></code> element
+   that is already <a href=#in-a-document>in a <code>Document</code></a>.</li>
+
    <li><p>When the <code title=attr-link-href><a href=#attr-link-href>href</a></code> attribute of the <code><a href=#the-link-element>link</a></code>
-   element of an <a href=#external-resource-link title="external resource link">external resource link</a> that is already
-   <a href=#in-a-document>in a <code>Document</code></a> is changed.</li>
+   element of an <a href=#external-resource-link>external resource link</a> that is already <a href=#in-a-document>in a
+   <code>Document</code></a> is changed.</li>
    <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2588 -->
 
+   <li><p>When the <code title=attr-link-crossorigin><a href=#attr-link-crossorigin>crossorigin</a></code> attribute of the
+   <code><a href=#the-link-element>link</a></code> element of an <a href=#external-resource-link title="external resource link">external resource
+   link</a> that is already <a href=#in-a-document>in a <code>Document</code></a> is set, changed, or
+   removed.</li>
+
+   <li><p>When the <code title=attr-link-type><a href=#attr-link-type>type</a></code> attribute of the <code><a href=#the-link-element>link</a></code>
+   element of an <a href=#external-resource-link>external resource link</a> that is already <a href=#in-a-document>in a
+   <code>Document</code></a> is set or changed to a value that does not or no longer matches the
+   <a href=#content-type title=Content-Type>Content-Type metadata</a> of the previous obtained external
+   resource, if any.</li>
+
+   <li><p>When the <code title=attr-link-type><a href=#attr-link-type>type</a></code> attribute of the <code><a href=#the-link-element>link</a></code>
+   element of an <a href=#external-resource-link>external resource link</a> that is already <a href=#in-a-document>in a
+   <code>Document</code></a> but was previously not obtained due to the <code title=attr-link-type><a href=#attr-link-type>type</a></code> attribute specifying an unsupported type is set, removed, or
+   changed.</li>
+
+   <li><p>When the <a href=#external-resource-link>external resource link</a> changes from being <a href=#the-link-is-an-alternative-stylesheet title="the link is
+   an alternative stylesheet">an alternative stylesheet</a> to not being one, or vice
+   versa.</li>
+
   </ul><p><strong>Quirk</strong>: If the document has been set to <a href=#quirks-mode>quirks mode</a>, has the
   <a href=#same-origin>same origin</a> as the <a href=#url>URL</a> of the external resource<!-- CVE-2010-0654 -->,
   and the <a href=#content-type title=Content-Type>Content-Type metadata</a> of the external resource is not a
   supported style sheet type, the user agent must instead assume it to be <code title="">text/css</code>.</p>
 
-  </div>
+  <p>Once a resource has been <a href=#concept-link-obtain title=concept-link-obtain>obtained</a>, if its <a href=#content-type title=Content-Type>Content-Type metadata</a> is <code title="">text/css</code>, the user
+  agent must run these steps:</p>
 
+  <ol><li><p>Let <var title="">element</var> be the <code><a href=#the-link-element>link</a></code> element that created the
+   <a href=#external-resource-link>external resource link</a>.</li>
 
+   <li><p>If <var title="">element</var> no longer creates an <a href=#external-resource-link>external resource link</a>
+   that contributes to the styling processing model, or if, since the resource in question was <a href=#concept-link-obtain title=concept-link-obtain>obtained</a>, it has become appropriate to <a href=#concept-link-obtain title=concept-link-obtain>obtain</a> it again (meaning this algorithm is about to be
+   invoked again for a newly obtained resource), then abort these steps.</li>
+
+   <li><p>If <var title="">element</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 the CSS style sheet</a> in question.</li>
+
+   <li>
+
+    <p><a href=#create-a-css-style-sheet>Create a CSS style sheet</a> with the following properties:</p>
+
+    <dl><dt><a href=#concept-css-style-sheet-type title=concept-css-style-sheet-type>type</a></dt>
+     <dd><p><code title="">text/css</code></dd>
+
+     <dt><a href=#concept-css-style-sheet-location title=concept-css-style-sheet-location>location</a></dt>
+     <dd>
+
+      <p>The <a href=#resulting-absolute-url>resulting absolute URL</a> determined during the <a href=#concept-link-obtain title=concept-link-obtain>obtain</a> algorithm.</p>
+
+      <p class=note>This is before any redirects get applied.</p>
+
+     </dd>
+
+     <dt><a href=#concept-css-style-sheet-owner-node title=concept-css-style-sheet-owner-node>owner node</a></dt>
+     <dd><p><var title="">element</var></dd>
+
+     <dt><a href=#concept-css-style-sheet-media title=concept-css-style-sheet-media>media</a></dt>
+
+     <dd>
+
+      <p>The <code title=attr-link-media><a href=#attr-link-media>media</a></code> attribute of <var title="">element</var>.</p>
+
+      <p class=note>This is a reference to the (possibly absent at this time) attribute, rather
+      than a copy of the attribute's current value. The CSSOM specification defines what happens
+      when the attribute is dynamically set, changed, or removed.</p>
+
+     </dd>
+
+     <dt><a href=#concept-css-style-sheet-title title=concept-css-style-sheet-title>title</a></dt>
+
+     <dd>
+
+      <p>The <code title=attr-link-title><a href=#attr-link-title>title</a></code> attribute of <var title="">element</var>.</p>
+
+      <p class=note>This is similarly a reference to the attribute, rather than a copy of the
+      attribute's current value.</p>
+
+     </dd>
+
+     <dt><a href=#concept-css-style-sheet-alternate-flag title=concept-css-style-sheet-alternate-flag>alternate flag</a></dt>
+     <dd><p>Set if <a href=#the-link-is-an-alternative-stylesheet>the link is an alternative stylesheet</a>; unset otherwise.</dd>
+
+     <dt><a href=#concept-css-style-sheet-origin-clean-flag title=concept-css-style-sheet-origin-clean-flag>origin-clean flag</a></dt>
+     <dd><p>Set if the resource is <a href=#cors-same-origin>CORS-same-origin</a>; unset otherwise.</dd>
+
+     <dt><a href=#concept-css-style-sheet-parent-css-style-sheet title=concept-css-style-sheet-parent-CSS-style-sheet>parent CSS style sheet</a></dt>
+     <dt><a href=#concept-css-style-sheet-owner-css-rule title=concept-css-style-sheet-owner-CSS-rule>owner CSS rule</a></dt>
+     <dd><p>null</dd>
+
+     <dt><a href=#concept-css-style-sheet-disabeld-flag title=concept-css-style-sheet-disabeld-flag>disabled flag</a></dt>
+     <dd><p>Left at its default value.</dd>
+
+     <dt><a href=#concept-css-style-sheet-css-rules title=concept-css-style-sheet-CSS-rules>CSS rules</a></dt>
+     <dd><p>Left uninitialized.</dd>
+
+    </dl></li>
+
+  </ol></div>
+<!--REMOVE-TOPIC:CSS-->
+
+
   <h5 id=link-type-tag><span class=secno>4.8.5.15 </span>Link type "<dfn title=rel-tag><code>tag</code></dfn>"</h5>
 
   <p>The <code title=rel-tag><a href=#link-type-tag>tag</a></code> keyword may be used with <code><a href=#the-a-element>a</a></code> and

Modified: source
===================================================================
--- source	2014-01-09 19:19:21 UTC (rev 8389)
+++ source	2014-01-13 22:45:39 UTC (rev 8390)
@@ -2704,8 +2704,20 @@
      <li><dfn><code>CSSStyleDeclaration</code></dfn></li>
      <li><dfn data-x="dom-CSSStyleDeclaration-cssText"><code>cssText</code></dfn> attribute of <code>CSSStyleDeclaration</code></li>
      <li><dfn><code>StyleSheet</code></dfn></li>
-     <li><dfn data-x="dom-linkstyle-sheet"><code>sheet</code></dfn></li>
-     <li><dfn data-x="dom-stylesheet-disabled"><code>disabled</code></dfn></li>
+     <li>The terms <dfn>create a CSS style sheet</dfn>, <dfn>remove a CSS style sheet</dfn>, and <dfn>associated CSS style sheet</dfn></li>
+     <li><dfn data-x="CSS style sheet">CSS style sheets</dfn> and their properties:
+         <dfn data-x="concept-css-style-sheet-type">type</dfn>,
+         <dfn data-x="concept-css-style-sheet-location">location</dfn>,
+         <dfn data-x="concept-css-style-sheet-parent-CSS-style-sheet">parent CSS style sheet</dfn>,
+         <dfn data-x="concept-css-style-sheet-owner-node">owner node</dfn>,
+         <dfn data-x="concept-css-style-sheet-owner-CSS-rule">owner CSS rule</dfn>,
+         <dfn data-x="concept-css-style-sheet-media">media</dfn>,
+         <dfn data-x="concept-css-style-sheet-title">title</dfn>,
+         <dfn data-x="concept-css-style-sheet-alternate-flag">alternate flag</dfn>,
+         <dfn data-x="concept-css-style-sheet-disabeld-flag">disabled flag</dfn>,
+         <dfn data-x="concept-css-style-sheet-CSS-rules">CSS rules</dfn>,
+         <dfn data-x="concept-css-style-sheet-origin-clean-flag">origin-clean flag</dfn>
+     </li>
      <li><dfn>Alternative style sheet sets</dfn> and the <dfn>preferred style sheet set</dfn></li>
      <li><dfn>Serializing a CSS value</dfn></li>
      <li><dfn>Scroll an element into view</dfn></li>
@@ -12917,7 +12929,6 @@
    <dt><span data-x="element-dfn-dom">DOM interface</span>:</dt><!--TOPIC:DOM APIs-->
    <dd>
 <pre class="idl">interface <dfn>HTMLLinkElement</dfn> : <span>HTMLElement</span> {
-           attribute boolean <span data-x="dom-link-disabled">disabled</span>;
            attribute DOMString <span data-x="dom-link-href">href</span>;
            attribute DOMString <span data-x="dom-link-crossOrigin">crossOrigin</span>;
            attribute DOMString <span data-x="dom-link-rel">rel</span>;
@@ -13255,16 +13266,8 @@
 
   </div>
 
-  <p>The IDL attribute <dfn data-x="dom-link-disabled"><code>disabled</code></dfn> only applies to
-  style sheet links. When the <code>link</code> element defines a style sheet link, then the <code
-  data-x="dom-link-disabled">disabled</code> attribute behaves as defined <span
-  data-x="dom-linkstyle-disabled">for the alternative style sheets DOM</span>. For all other
-  <code>link</code> elements it always return false and does nothing on setting.</p> <!-- that is
-  normatively required in the definition of dom-linkstyle-disabled -->
+  <p>The <code>LinkStyle</code> interface is also implemented by this element. <a href="#refsCSSOM">[CSSOM]</a></p>
 
-  <p>The <code>LinkStyle</code> interface is also implemented by this element; the <span>styling
-  processing model</span> defines how. <a href="#refsCSSOM">[CSSOM]</a></p>
-
   <div class="example">
 
    <p>Here, a set of <code>link</code> elements provide some style sheets:</p>
@@ -14310,7 +14313,6 @@
    <dt><span data-x="element-dfn-dom">DOM interface</span>:</dt><!--TOPIC:DOM APIs-->
    <dd>
 <pre class="idl">interface <dfn>HTMLStyleElement</dfn> : <span>HTMLElement</span> {
-           attribute boolean <span data-x="dom-style-disabled">disabled</span>;
            attribute DOMString <span data-x="dom-style-media">media</span>;
            attribute DOMString <span data-x="dom-style-type">type</span>;
            attribute boolean <span data-x="dom-style-scoped">scoped</span>;
@@ -14320,8 +14322,8 @@
   </dl><!--TOPIC:HTML-->
 
   <p>The <code>style</code> element allows authors to embed style information in their documents.
-  The <code>style</code> element is one of several inputs to the <span>styling processing
-  model</span>. The element does not <span data-x="represents">represent</span> content for the
+  The <code>style</code> element is one of several inputs to the styling processing
+  model. The element does not <span data-x="represents">represent</span> content for the
   user.</p>
 
   <p>The <dfn data-x="attr-style-type"><code>type</code></dfn> attribute gives the styling language.
@@ -14377,45 +14379,13 @@
   data-x="attr-style-scoped">scoped</code> attribute is restricted to appearing in the
   <code>head</code> of the document.</p>
 
-  <div class="impl">
-
-<!--ADD-TOPIC:CSS-->
-
   <p>A style sheet declared by a <code>style</code> element that has a <code
   data-x="attr-style-scoped">scoped</code> attribute and has a parent node that is an element is
   <i>scoped</i>, with the <i>scoping element</i> being the <code>style</code> element's parent
   element. <a href="#refsCSSSCOPED">[CSSSCOPED]</a></p>
 
-  <p class="critical">The following will eventually be moved to a CSS specification; it is specified
-  here only on an interim basis until an editor can be found to own this.</p>
+  <!-- <p class="note">Currently, this is only defined for CSS.</p> -->
 
-  <p>Within scoped CSS resources, authors may use an <code data-x="">@global</code> @-rule. The
-  syntax of this rule is defined as follows.</p>
-
-  <p>The following production is added to the grammar:</p>
-
-  <pre>global
-  : GLOBAL_SYM S* ruleset
-  ;</pre>
-
-  <p>The following rules are added to the Flex tokenizer:</p>
-
-  <pre>B                     b|\\0{0,4}(42|62)(\r\n|[ \t\r\n\f])?
-@{G}{L}{O}{B}{A}{L}   {return GLOBAL_SYM;}</pre>
-
-  <p>Simple selectors in rule sets prefixed by the <code data-x="">@global</code> @-rule in scoped
-  CSS resources must be processed in the same way as normal rule sets in non-scoped CSS
-  resources.</p>
-
-  <p>Simple selectors in scoped CSS resources that are not prefixed by an <code
-  data-x="">@global</code> @-rule must only match the <code>style</code> element's parent element (if
-  any), and that element's descendants.</p>
-<!--REMOVE-TOPIC:CSS-->
-
-  <hr>
-
-  </div>
-
   <p id="title-on-style">The <dfn data-x="attr-style-title"><code>title</code></dfn> attribute on
   <code>style</code> elements defines <span>alternative style sheet sets</span>. If the
   <code>style</code> element has no <code data-x="attr-style-title">title</code> attribute, then it
@@ -14447,22 +14417,117 @@
        requirement.
   -->
 
+  <hr>
+
   <div class="impl">
 
-  <p>All descendant elements must be processed, according to their semantics, before the
-  <code>style</code> element itself is evaluated. For styling languages that consist of pure text
-  (as opposed to XML), user agents must evaluate <code>style</code> elements by passing the
-  concatenation of the contents of all the <code>Text</code> nodes that are children of the
-  <code>style</code> element (not any other nodes such as comments or elements), in <span>tree
-  order</span>, to the style system. For XML-based styling languages, user agents must pass all the
-  child nodes of the <code>style</code> element to the style system.</p>
+  <p>Whenever one of the following conditions occur:</p>
 
-  <p>All <span data-x="URL">URLs</span> found by the styling language's processor must be <span
-  data-x="resolve a url">resolved</span>, relative to the element (or as defined by the styling
-  language), when the processor is invoked.<!-- so dynamic changes to the base URL don't affect the
-  CSS --></p>
+  <ul>
 
-  <!-- the next few paragraph are similar to text in the <style> section -->
+   <li>the element is popped off the <span>stack of open elements</span> of an <span>HTML
+   parser</span> or <span>XML parser</span>,
+
+   <li>the element is not on the <span>stack of open elements</span> of an <span>HTML parser</span>
+   or <span>XML parser</span>, and it is <span data-x="insert an element into a
+   document">inserted into a document</span> or <span data-x="remove an element from a
+   document">removed from a document</span>,
+
+   <li>the element is not on the <span>stack of open elements</span> of an <span>HTML parser</span>
+   or <span>XML parser</span>, and one of its child nodes is modified by a script,
+
+  </ul>
+
+  <p>...the user agent must <span>queue a task</span> to invoke the <dfn>update a <code>style</code>
+  block</dfn> algorithm that applies for the style sheet language specified by the element's <code
+  data-x="attr-style-type">type</code> attribute, passing it the element's <dfn>style
+  data</dfn>.</p>
+
+  <p>For styling languages that consist of pure text (as opposed to XML), a <code>style</code>
+  element's <span>style data</span> is the concatenation of the contents of all the
+  <code>Text</code> nodes that are children of the <code>style</code> element (not any other nodes
+  such as comments or elements), in <span>tree order</span>. For XML-based styling languages, the
+  <span>style data</span> consists of all the child nodes of the <code>style</code> element.</p>
+
+  <p>The <span>update a <code>style</code> block</span> algorithm for CSS (<code>text/css</code>) is
+  as follows:</p>
+
+  <ol>
+
+   <li><p>Let <var data-x="">element</var> be the <code>style</code> element.</p></li>
+
+   <li><p>If <var data-x="">element</var> has an <span>associated CSS style sheet</span>, <span
+   data-x="remove a CSS style sheet">remove the CSS style sheet</span> in question.</p></li>
+
+   <li><p>If <var data-x="">element</var> is not <span>in a <code>Document</code></span>, then abort
+   these steps.</p></li>
+
+   <li>
+
+    <p><span>Create a CSS style sheet</span> with the following properties:</p>
+
+    <dl>
+
+     <dt><span data-x="concept-css-style-sheet-type">type</span></dt>
+     <dd><p><code data-x="">text/css</code></p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-owner-node">owner node</span></dt>
+     <dd><p><var data-x="">element</var></p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-media">media</span></dt>
+
+     <dd>
+
+      <p>The <code data-x="attr-style-media">media</code> attribute of <var data-x="">element</var>.</p>
+
+      <p class="note">This is a reference to the (possibly absent at this time) attribute, rather
+      than a copy of the attribute's current value. The CSSOM specification defines what happens
+      when the attribute is dynamically set, changed, or removed.</p>
+
+     </dd>
+
+     <dt><span data-x="concept-css-style-sheet-title">title</span></dt>
+
+     <dd>
+
+      <p>The <code data-x="attr-style-title">title</code> attribute of <var data-x="">element</var>.</p>
+
+      <p class="note">Again, this is a <em>reference</em> to the attribute.</p>
+
+     </dd>
+
+     <dt><span data-x="concept-css-style-sheet-alternate-flag">alternate flag</span></dt>
+     <dd><p>Unset.</p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-origin-clean-flag">origin-clean flag</span></dt>
+     <dd><p>Set.</p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-location">location</span></dt>
+     <dt><span data-x="concept-css-style-sheet-parent-CSS-style-sheet">parent CSS style sheet</span></dt>
+     <dt><span data-x="concept-css-style-sheet-owner-CSS-rule">owner CSS rule</span></dt>
+     <dd><p>null</p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-disabeld-flag">disabled flag</span></dt>
+     <dd><p>Left at its default value.</p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-CSS-rules">CSS rules</span></dt>
+     <dd><p>Left uninitialized.</p></dd>
+
+    </dl>
+
+    <!-- <p>All <span data-x="URL">URLs</span> found by the styling language's processor must be
+    <span data-x="resolve a url">resolved</span>, relative to the element (or as defined by the
+    styling language), when the processor is invoked.</p>--><!-- so dynamic changes to the base URL
+    don't affect the CSS -->
+
+   </li>
+
+  </ol>
+
+  <p>This specification does not define any other styling language's <i>update a <code>style</code>
+  block</i> algorithm.</p>
+
+  <!-- the next few paragraph are similar to text in the <link> section -->
   <p>Once the attempts to obtain the style sheet's <span>critical subresources</span>, if any, are
   complete, or, if the style sheet has no <span>critical subresources</span>, once the style sheet
   has been parsed and processed, the user agent must, if the loads were successful or there were
@@ -14495,12 +14560,9 @@
 
   </div>
 
-  <p>The <dfn data-x="dom-style-disabled"><code>disabled</code></dfn> IDL attribute behaves as
-  defined <span data-x="dom-linkstyle-disabled">for the alternative style sheets DOM</span>.</p>
+  <p>The <code>LinkStyle</code> interface is also implemented by this element. <a
+  href="#refsCSSOM">[CSSOM]</a></p>
 
-  <p>The <code>LinkStyle</code> interface is also implemented by this element; the <span>styling
-  processing model</span> defines how. <a href="#refsCSSOM">[CSSOM]</a></p>
-
   <div class="example">
 
    <p>The following document has its stress emphasis styled as bright red text rather than italics
@@ -14527,101 +14589,44 @@
 
 
 
-
-  <h4 id="styling"><dfn data-x="styling processing model">Styling</dfn></h4>
-
-  <p>The <code>link</code> and <code>style</code> elements can provide styling information for the
-  user agent to use when rendering the document. The CSS and CSSOM specifications specify what
-  styling information is to be used by the user agent and how it is to be used. <a
-  href="#refsCSS">[CSS]</a> <a href="#refsCSSOM">[CSSOM]</a></p>
-
-  <p>The <code>style</code> and <code>link</code> elements implement the <code>LinkStyle</code>
-  interface. <a href="#refsCSSOM">[CSSOM]</a></p>
-
+<!--ADD-TOPIC:CSS-->
   <div class="impl">
 
-  <p>For <code>style</code> elements, if the user agent does not support the specified styling
-  language, then the <code data-x="dom-LinkStyle-sheet">sheet</code> attribute of the element's
-  <code>LinkStyle</code> interface must return null. Similarly, <code>link</code> elements that do
-  not represent <span data-x="rel-stylesheet">external resource links that contribute to the styling
-  processing model</span> (i.e. that do not have a <code data-x="rel-stylesheet">stylesheet</code>
-  keyword in their <code data-x="attr-link-rel">rel</code> attribute), for which <span>the link is an
-  alternative stylesheet</span> but whose <code data-x="dom-title">title</code> content attribute is
-  absent or empty, or whose resource is <span>CORS-cross-origin</span>, must have their
-  <code>LinkStyle</code> interface's <code data-x="dom-LinkStyle-sheet">sheet</code> attribute return
-  null.</p>
+  <h5>The <code data-x="">@global</code> rule</h5>
 
-  <p>Otherwise, the <code>LinkStyle</code> interface's <code
-  data-x="dom-LinkStyle-sheet">sheet</code> attribute must return null if the corresponding element
-  is not <span>in a <code>Document</code></span>,
-  <!-- link: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1934 -->
-  <!-- style: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1935 -->
-  and otherwise must return a <code>StyleSheet</code> object with the following properties: <a
-  href="#refsCSSOM">[CSSOM]</a></p>
+  <p class="critical">The following will eventually be moved to a CSS specification; it is specified
+  here only on an interim basis until an editor can be found to own this.</p>
 
-  <dl>
+  <p>Within scoped CSS resources, authors may use an <code data-x="">@global</code> @-rule. The
+  syntax of this rule is defined as follows.</p>
 
-   <dt>The style sheet type</dt>
+  <p>The following production is added to the grammar:</p>
 
-   <dd><p>The style sheet type must be the same as the style's specified type. For
-   <code>style</code> elements, this is the same as the <code data-x="attr-style-type">type</code>
-   content attribute's value, or <code data-x="">text/css</code> if that is omitted. For
-   <code>link</code> elements, this is the <span data-x="Content-Type">Content-Type metadata of the
-   specified resource</span>.</p></dd>
+  <pre>global
+  : GLOBAL_SYM S* ruleset
+  ;</pre>
 
-   <dt>The style sheet location</dt>
+  <p>The following rules are added to the Flex tokenizer:</p>
 
-   <dd><p>For <code>link</code> elements, the location must be the result of <span data-x="resolve a
-   url">resolving</span> the <span>URL</span> given by the element's <code
-   data-x="attr-link-href">href</code> content attribute, relative to the element, or the empty
-   string if that fails. For <code>style</code> elements, there is no location.</p></dd> <!-- note
-   that this might not match the style sheet URL, if the base URL has changed for instance -->
+  <pre>B                     b|\\0{0,4}(42|62)(\r\n|[ \t\r\n\f])?
+@{G}{L}{O}{B}{A}{L}   {return GLOBAL_SYM;}</pre>
 
-   <dt>The style sheet media</dt>
+  <p>Simple selectors in rule sets prefixed by the <code data-x="">@global</code> @-rule in scoped
+  CSS resources must be processed in the same way as normal rule sets in non-scoped CSS
+  resources.</p>
 
-   <dd><p>The media must be the same as the value of the element's <code data-x="">media</code>
-   content attribute, or the empty string, if the attribute is omitted.</p></dd>
+  <p>Simple selectors in scoped CSS resources that are not prefixed by an <code
+  data-x="">@global</code> @-rule must only match the <code>style</code> element's parent element (if
+  any), and that element's descendants.</p>
 
-   <dt>The style sheet title</dt>
+  </div>
+<!--REMOVE-TOPIC:CSS-->
 
-   <dd><p>The title must be the same as the value of the element's <code
-   data-x="dom-title">title</code> content attribute, if the attribute is present and has a non-empty
-   value. If the attribute is absent or its value is the empty string, then the style sheet does not
-   have a title (it is the empty string). The title is used for defining <span>alternative style
-   sheet sets</span>.</p></dd>
 
-   <dt>The style sheet alternate flag</dt>
+  <div class="impl">
 
-   <dd><p>For <code>link</code> elements, true if <span>the link is an alternative
-   stylesheet</span>. In all other cases, false.</p></dd>
+  <h4>Interactions of styling and scripting</h4>
 
-<!--
-   <dt>The style sheet disabled flag</dt> (not included, because I assume CSSOM will change to not
-   require this spec to initialise the value, but will instead initialise it based on the other
-   values)
--->
-
-  </dl>
-
-  <p>The same object must be returned each time.</p>
-
-  <p>The <dfn data-x="dom-LinkStyle-disabled"><code>disabled</code></dfn> IDL attribute on
-  <code>link</code> and <code>style</code> elements must return false and do nothing on setting, if
-  the <code data-x="dom-linkstyle-sheet">sheet</code> attribute of their <code>LinkStyle</code>
-  interface is null. Otherwise, it must return the value of the <code>StyleSheet</code> interface's
-  <code data-x="dom-stylesheet-disabled">disabled</code> attribute on getting, and forward the new
-  value to that same attribute on setting.</p>
-
-  <!-- [CSSOM] covers the following: the term "alternative style sheet sets", the term "default
-  style sheet set", preferred stylesheets, alternative stylesheets, persistent stylesheets, ordering
-  of stylesheets, dynamic additions/removals, window.styleSheets, style sheets given by HTTP Link:
-  headers, and the alternative style sheet API -->
-
-  <p id="alternate-style-sheets">The rules for handling alternative style sheets are defined in the
-  CSS object model specification. <a href="#refsCSSOM">[CSSOM]</a></p>
-
-  <hr>
-
   <p>Style sheets, whether added by a <code>link</code> element, a <code>style</code> element, an
   <code><?xml-stylesheet></code> PI, an HTTP <code data-x="http-link">Link:</code> header, or some
   other mechanism, have a <dfn>style sheet ready</dfn> flag, which is initially unset.</p>
@@ -14667,6 +14672,7 @@
 
 
 
+
   <h3>Sections</h3>
 
   <h4 id="the-body-element">The <dfn><code>body</code></dfn> element</h4>
@@ -35766,7 +35772,7 @@
   <h5 id=rel-icon>Link type "<dfn data-x="rel-icon"><code>icon</code></dfn>"</h5>
 
   <p>The <code data-x="rel-icon">icon</code> keyword may be used with <code>link</code> elements.
-  This keyword creates an <span data-x="external resource link">external resource link</span>.</p>
+  This keyword creates an <span>external resource link</span>.</p>
 
   <div class="impl">
 
@@ -36049,11 +36055,12 @@
   a <dfn data-x="rel-sidebar-hyperlink">sidebar hyperlink</dfn>.</p>
 
 
+<!--ADD-TOPIC:CSS-->
   <h5>Link type "<dfn data-x="rel-stylesheet"><code>stylesheet</code></dfn>"</h5>
 
   <p>The <code data-x="rel-stylesheet">stylesheet</code> keyword may be used with <code>link</code>
   elements. This keyword creates an <span data-x="external resource link">external resource
-  link</span> that contributes to the <span>styling processing model</span>.</p>
+  link</span> that contributes to the styling processing model.</p>
 
   <p>The specified resource is a resource that describes how to present the document. Exactly how
   the resource is to be processed depends on the actual type of the resource.</p>
@@ -36072,18 +36079,42 @@
 
   <ul>
 
-   <li><p>When the <span data-x="external resource link">external resource link</span>'s
-   <code>link</code> element is <span data-x="insert an element into a document">inserted into a
-   document</span>.</p></li>
+   <li><p>When the <span>external resource link</span> is created, if its <code>link</code> element
+   is already <span>in a <code>Document</code></span>.</p></li>
+   <!-- e.g. rel="" changed, href="" set... -->
 
-   <li><p>When the <span data-x="external resource link">external resource link</span> is created on
-   a <code>link</code> element that is already <span>in a <code>Document</code></span>.</p></li>
+   <li><p>When the <span>external resource link</span>'s <code>link</code> element is <span
+   data-x="insert an element into a document">inserted into a document</span>.</p></li>
 
+   <li><p>When the <span>external resource link</span> is created on a <code>link</code> element
+   that is already <span>in a <code>Document</code></span>.</p></li>
+
    <li><p>When the <code data-x="attr-link-href">href</code> attribute of the <code>link</code>
-   element of an <span data-x="external resource link">external resource link</span> that is already
-   <span>in a <code>Document</code></span> is changed.</p></li>
+   element of an <span>external resource link</span> that is already <span>in a
+   <code>Document</code></span> is changed.</p></li>
    <!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2588 -->
 
+   <li><p>When the <code data-x="attr-link-crossorigin">crossorigin</code> attribute of the
+   <code>link</code> element of an <span data-x="external resource link">external resource
+   link</span> that is already <span>in a <code>Document</code></span> is set, changed, or
+   removed.</p></li>
+
+   <li><p>When the <code data-x="attr-link-type">type</code> attribute of the <code>link</code>
+   element of an <span>external resource link</span> that is already <span>in a
+   <code>Document</code></span> is set or changed to a value that does not or no longer matches the
+   <span data-x="Content-Type">Content-Type metadata</span> of the previous obtained external
+   resource, if any.</p></li>
+
+   <li><p>When the <code data-x="attr-link-type">type</code> attribute of the <code>link</code>
+   element of an <span>external resource link</span> that is already <span>in a
+   <code>Document</code></span> but was previously not obtained due to the <code
+   data-x="attr-link-type">type</code> attribute specifying an unsupported type is set, removed, or
+   changed.</p></li>
+
+   <li><p>When the <span>external resource link</span> changes from being <span data-x="the link is
+   an alternative stylesheet">an alternative stylesheet</span> to not being one, or vice
+   versa.</p></li>
+
   </ul>
 
   <p><strong>Quirk</strong>: If the document has been set to <span>quirks mode</span>, has the
@@ -36092,7 +36123,93 @@
   supported style sheet type, the user agent must instead assume it to be <code
   data-x="">text/css</code>.</p>
 
+  <p>Once a resource has been <span data-x="concept-link-obtain">obtained</span>, if its <span
+  data-x="Content-Type">Content-Type metadata</span> is <code data-x="">text/css</code>, the user
+  agent must run these steps:</p>
+
+  <ol>
+
+   <li><p>Let <var data-x="">element</var> be the <code>link</code> element that created the
+   <span>external resource link</span>.</p></li>
+
+   <li><p>If <var data-x="">element</var> no longer creates an <span>external resource link</span>
+   that contributes to the styling processing model, or if, since the resource in question was <span
+   data-x="concept-link-obtain">obtained</span>, it has become appropriate to <span
+   data-x="concept-link-obtain">obtain</span> it again (meaning this algorithm is about to be
+   invoked again for a newly obtained resource), then abort these steps.</p></li>
+
+   <li><p>If <var data-x="">element</var> has an <span>associated CSS style sheet</span>, <span
+   data-x="remove a CSS style sheet">remove the CSS style sheet</span> in question.</p></li>
+
+   <li>
+
+    <p><span>Create a CSS style sheet</span> with the following properties:</p>
+
+    <dl>
+
+     <dt><span data-x="concept-css-style-sheet-type">type</span></dt>
+     <dd><p><code data-x="">text/css</code></p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-location">location</span></dt>
+     <dd>
+
+      <p>The <span>resulting absolute URL</span> determined during the <span
+      data-x="concept-link-obtain">obtain</span> algorithm.</p>
+
+      <p class="note">This is before any redirects get applied.</p>
+
+     </dd>
+
+     <dt><span data-x="concept-css-style-sheet-owner-node">owner node</span></dt>
+     <dd><p><var data-x="">element</var></p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-media">media</span></dt>
+
+     <dd>
+
+      <p>The <code data-x="attr-link-media">media</code> attribute of <var data-x="">element</var>.</p>
+
+      <p class="note">This is a reference to the (possibly absent at this time) attribute, rather
+      than a copy of the attribute's current value. The CSSOM specification defines what happens
+      when the attribute is dynamically set, changed, or removed.</p>
+
+     </dd>
+
+     <dt><span data-x="concept-css-style-sheet-title">title</span></dt>
+
+     <dd>
+
+      <p>The <code data-x="attr-link-title">title</code> attribute of <var data-x="">element</var>.</p>
+
+      <p class="note">This is similarly a reference to the attribute, rather than a copy of the
+      attribute's current value.</p>
+
+     </dd>
+
+     <dt><span data-x="concept-css-style-sheet-alternate-flag">alternate flag</span></dt>
+     <dd><p>Set if <span>the link is an alternative stylesheet</span>; unset otherwise.</p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-origin-clean-flag">origin-clean flag</span></dt>
+     <dd><p>Set if the resource is <span>CORS-same-origin</span>; unset otherwise.</p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-parent-CSS-style-sheet">parent CSS style sheet</span></dt>
+     <dt><span data-x="concept-css-style-sheet-owner-CSS-rule">owner CSS rule</span></dt>
+     <dd><p>null</p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-disabeld-flag">disabled flag</span></dt>
+     <dd><p>Left at its default value.</p></dd>
+
+     <dt><span data-x="concept-css-style-sheet-CSS-rules">CSS rules</span></dt>
+     <dd><p>Left uninitialized.</p></dd>
+
+    </dl>
+
+   </li>
+
+  </ol>
+
   </div>
+<!--REMOVE-TOPIC:CSS-->
 
 
   <h5>Link type "<dfn data-x="rel-tag"><code>tag</code></dfn>"</h5>




More information about the Commit-Watchers mailing list