[csswg-drafts] [cssom] Application of existing stylesheet when href is modified

rune-opera has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [cssom] Application of existing stylesheet when href is modified ==
Should changing the href of a fully loaded and applied stylesheet to a
 slow loading url cause the current stylesheet to stop applying 
immediately?

Consider the case below. Firefox drops x-green-bg.css when the href is
 modified, while Chrome/Opera keeps the old style. That is, unless you
 also e.g. insert a new style element into the document. Then 
Chrome/Opera does the same as Firefox.

```
<!DOCTYPE html>
<link id="l" rel="stylesheet" href="x-green-bg.css">
<script>
    setTimeout(() => {
        l.href = 
"http://localhost:8000/resources/slow-image.php?sleep=3000&name=dummy.css&mimeType=text/css&expires=no";
        //var s = 
document.head.appendChild(document.createElement("style"));
        //s.innerHTML = "#x { color: red; }"
    }, 200);
</script>
<div id="x">Green background?</div>

x-green-bg.css:

#x { background:green }
```

Reported on request from @zcorpan


Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/954 using your GitHub 
account

Received on Wednesday, 18 January 2017 13:20:04 UTC