[html5] r8244 - [] (0) Browsers can't delay alt style sheets and remain Web compatible, apparent [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Oct 28 14:45:16 PDT 2013


Author: ianh
Date: 2013-10-28 14:45:14 -0700 (Mon, 28 Oct 2013)
New Revision: 8244

Modified:
   complete.html
   index
   source
Log:
[] (0) Browsers can't delay alt style sheets and remain Web compatible, apparently.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=23621
Affected topics: HTML

Modified: complete.html
===================================================================
--- complete.html	2013-10-25 23:05:30 UTC (rev 8243)
+++ complete.html	2013-10-28 21:45:14 UTC (rev 8244)
@@ -3,6 +3,47 @@
    var current_revision = "r" + "$Revision$".substr(11);
    current_revision = current_revision.substr(0, current_revision.length - 2);
    var last_known_revision = current_revision;
+   function F( /* varargs... */) {
+     var fragment = document.createDocumentFragment();
+     for (var index = 0; index < arguments.length; index += 1) {
+       if (arguments[index] instanceof Array) {
+         fragment.appendChild(F.apply(this, arguments[index]));
+       } else if (typeof arguments[index] == 'string') {
+         fragment.appendChild(document.createTextNode(arguments[index]));
+       } else {
+         fragment.appendChild(arguments[index]);
+       }
+     }
+     return fragment;
+   }
+   function E(name, /* optional */ attributes /*, varargs... */) {
+     var element = document.createElement(name);
+     var index = 1;
+     if ((arguments.length > 1) && (typeof attributes != 'string') &&
+         (!(attributes instanceof Node)) && (!(attributes instanceof Array))) {
+       for (var attName in attributes) {
+         if (typeof attributes[attName] == 'boolean') {
+           if (attributes[attName])
+             element.setAttribute(attName, '');
+         } else if (typeof attributes[attName] == 'function') {
+           element[attName] = attributes[attName];
+         } else {
+           element.setAttribute(attName, attributes[attName]);
+         }
+       }
+       index = 2;
+     }
+     for (; index < arguments.length; index += 1) {
+       if (arguments[index] instanceof Array) {
+         element.appendChild(F.apply(this, arguments[index]));
+       } else if (typeof arguments[index] == 'string') {
+         element.appendChild(document.createTextNode(arguments[index]));
+       } else {
+         element.appendChild(arguments[index]);
+       }
+     }
+     return element;
+   }
    function getCookie(name) {
      var params = location.search.substr(1).split("&");
      for (var index = 0; index < params.length; index++) {
@@ -41,12 +82,13 @@
        clearTimeout(currentAlertTimeout);
        currentAlert.className = '';
      }
-     currentAlert.lastChild.textContent = s + ' ';
+     currentAlert.lastChild.textContent = '';
+     currentAlert.lastChild.appendChild(F(s));
      if (href) {
        var link = document.createElement('a');
        link.href = href;
        link.textContent = href;
-       currentAlert.lastChild.appendChild(link);
+       currentAlert.lastChild.appendChild(F(' ', link));
      }
      currentAlertTimeout = setTimeout(closeAlert, 10000);
    }
@@ -256,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 25 October 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 28 October 2013</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>
@@ -32766,12 +32808,7 @@
    <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 -->
 
-  </ul><p>If the resource is <a href=#the-link-is-an-alternative-stylesheet title="the link is an alternative stylesheet">an alternative
-  stylesheet</a> then the user agent may defer obtaining the resource until it is part of the
-  <a href=#preferred-style-sheet-set>preferred style sheet set</a>. <a href=#refsCSSOM>[CSSOM]</a></p> <!-- what about DOM
-  access of alt style sheets? -->
-
-  <p><strong>Quirk</strong>: If the document has been set to <a href=#quirks-mode>quirks mode</a>, has the
+  </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>

Modified: index
===================================================================
--- index	2013-10-25 23:05:30 UTC (rev 8243)
+++ index	2013-10-28 21:45:14 UTC (rev 8244)
@@ -3,6 +3,47 @@
    var current_revision = "r" + "$Revision$".substr(11);
    current_revision = current_revision.substr(0, current_revision.length - 2);
    var last_known_revision = current_revision;
+   function F( /* varargs... */) {
+     var fragment = document.createDocumentFragment();
+     for (var index = 0; index < arguments.length; index += 1) {
+       if (arguments[index] instanceof Array) {
+         fragment.appendChild(F.apply(this, arguments[index]));
+       } else if (typeof arguments[index] == 'string') {
+         fragment.appendChild(document.createTextNode(arguments[index]));
+       } else {
+         fragment.appendChild(arguments[index]);
+       }
+     }
+     return fragment;
+   }
+   function E(name, /* optional */ attributes /*, varargs... */) {
+     var element = document.createElement(name);
+     var index = 1;
+     if ((arguments.length > 1) && (typeof attributes != 'string') &&
+         (!(attributes instanceof Node)) && (!(attributes instanceof Array))) {
+       for (var attName in attributes) {
+         if (typeof attributes[attName] == 'boolean') {
+           if (attributes[attName])
+             element.setAttribute(attName, '');
+         } else if (typeof attributes[attName] == 'function') {
+           element[attName] = attributes[attName];
+         } else {
+           element.setAttribute(attName, attributes[attName]);
+         }
+       }
+       index = 2;
+     }
+     for (; index < arguments.length; index += 1) {
+       if (arguments[index] instanceof Array) {
+         element.appendChild(F.apply(this, arguments[index]));
+       } else if (typeof arguments[index] == 'string') {
+         element.appendChild(document.createTextNode(arguments[index]));
+       } else {
+         element.appendChild(arguments[index]);
+       }
+     }
+     return element;
+   }
    function getCookie(name) {
      var params = location.search.substr(1).split("&");
      for (var index = 0; index < params.length; index++) {
@@ -41,12 +82,13 @@
        clearTimeout(currentAlertTimeout);
        currentAlert.className = '';
      }
-     currentAlert.lastChild.textContent = s + ' ';
+     currentAlert.lastChild.textContent = '';
+     currentAlert.lastChild.appendChild(F(s));
      if (href) {
        var link = document.createElement('a');
        link.href = href;
        link.textContent = href;
-       currentAlert.lastChild.appendChild(link);
+       currentAlert.lastChild.appendChild(F(' ', link));
      }
      currentAlertTimeout = setTimeout(closeAlert, 10000);
    }
@@ -256,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 25 October 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 28 October 2013</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>
@@ -32766,12 +32808,7 @@
    <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 -->
 
-  </ul><p>If the resource is <a href=#the-link-is-an-alternative-stylesheet title="the link is an alternative stylesheet">an alternative
-  stylesheet</a> then the user agent may defer obtaining the resource until it is part of the
-  <a href=#preferred-style-sheet-set>preferred style sheet set</a>. <a href=#refsCSSOM>[CSSOM]</a></p> <!-- what about DOM
-  access of alt style sheets? -->
-
-  <p><strong>Quirk</strong>: If the document has been set to <a href=#quirks-mode>quirks mode</a>, has the
+  </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>

Modified: source
===================================================================
--- source	2013-10-25 23:05:30 UTC (rev 8243)
+++ source	2013-10-28 21:45:14 UTC (rev 8244)
@@ -35614,11 +35614,6 @@
 
   </ul>
 
-  <p>If the resource is <span data-x="the link is an alternative stylesheet">an alternative
-  stylesheet</span> then the user agent may defer obtaining the resource until it is part of the
-  <span>preferred style sheet set</span>. <a href="#refsCSSOM">[CSSOM]</a></p> <!-- what about DOM
-  access of alt style sheets? -->
-
   <p><strong>Quirk</strong>: If the document has been set to <span>quirks mode</span>, has the
   <span>same origin</span> as the <span>URL</span> of the external resource<!-- CVE-2010-0654 -->,
   and the <span data-x="Content-Type">Content-Type metadata</span> of the external resource is not a




More information about the Commit-Watchers mailing list