Skip to content

Commit

Permalink
[] (0) Browsers can't delay alt style sheets and remain Web compatibl…
Browse files Browse the repository at this point in the history
…e, apparently.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=23621
Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@8244 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 28, 2013
1 parent 254d6fd commit 452697b
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 23 deletions.
55 changes: 46 additions & 9 deletions complete.html
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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 &mdash; Last Updated 25 October 2013</h2>
<h2 class="no-num no-toc">Living Standard &mdash; 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>
Expand Down Expand Up @@ -32766,12 +32808,7 @@ <h5 id=link-type-stylesheet><span class=secno>4.8.5.14 </span>Link type "<dfn ti
<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>
Expand Down
55 changes: 46 additions & 9 deletions index
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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 &mdash; Last Updated 25 October 2013</h2>
<h2 class="no-num no-toc">Living Standard &mdash; 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>
Expand Down Expand Up @@ -32766,12 +32808,7 @@ dictionary <dfn id=trackeventinit>TrackEventInit</dfn> : <a href=#eventinit>Even
<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>
Expand Down
5 changes: 0 additions & 5 deletions source
Expand Up @@ -35614,11 +35614,6 @@ dictionary <dfn>TrackEventInit</dfn> : <span>EventInit</span> {

</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
Expand Down

0 comments on commit 452697b

Please sign in to comment.