W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2017

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

From: Rune Lillesveen via GitHub <sysbot+gh@w3.org>
Date: Wed, 18 Jan 2017 13:19:58 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-201572085-1484745597-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:07 UTC