Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cssom] Application of existing stylesheet when href is modified #954

Open
ghost opened this issue Jan 18, 2017 · 0 comments
Open

[cssom] Application of existing stylesheet when href is modified #954

ghost opened this issue Jan 18, 2017 · 0 comments
Assignees
Labels
cssom-1 Current Work

Comments

@ghost
Copy link

ghost commented Jan 18, 2017

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

@ghost ghost assigned zcorpan Jan 18, 2017
@ghost ghost added the cssom-1 Current Work label Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cssom-1 Current Work
Projects
None yet
Development

No branches or pull requests

1 participant