This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23233 - Remove race condition for things that cause a download
Summary: Remove race condition for things that cause a download
Status: RESOLVED WONTFIX
Alias: None
Product: CSS
Classification: Unclassified
Component: Variables (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Tab Atkins Jr.
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-13 09:00 UTC by Simon Pieters
Modified: 2013-09-13 09:57 UTC (History)
0 users

See Also:


Attachments

Description Simon Pieters 2013-09-13 09:00:49 UTC
Consider

<link rel=stylesheet href=foo.css>
<style>
html { background-image: var(foo, "fallback.jpg"); }
</style>

/* foo.css */
html { var-foo: "bar.jpg"; }


Now, if foo.css doesn't load quickly enough, the inline style will start downloading fallback.jpg, and then when foo.css has loaded, the inline style will instead start downloading bar.jpg, as far as I can tell. If foo.css does load quickly enough, only bar.jpg will be downloaded.

I think this is a bad situation that we shouldn't allow. Maybe the fallback should be ignored for properties that download something, like background-image?
Comment 1 Tab Atkins Jr. 2013-09-13 09:57:39 UTC
We can't remove this network race, as it exists without any variables at all:

<link rel=stylesheet href=foo.css>
<style>
html { background-image: url("fallback.jpg"); }
</style>

/* foo.css */
html { background-image: url("bar.jpg"); }

Since variables don't make this any worse, and as far as I can tell don't block any plans to fix this (since I don't think there are any such plans), I'm not going to do anything about this.