Bug 19453 - CSS background-image property will make a request even if the selector is overriden
Summary: CSS background-image property will make a request even if the selector is ove...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 525.x (Safari 3.1)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-09 16:58 PDT by Daniel Ruspini
Modified: 2010-09-03 14:13 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Ruspini 2008-06-09 16:58:23 PDT
Using Fiddler I've found that when a CSS background-image property is overriden with another selector, the previously declared selector still initiates a request.

This does not happen in FF or IE, and became apparent when using a third-party JS library that included CSS and background images we did not want to use and thus targeted for overriding.  The 404's kept coming in though for Safari.

Example:
<html>
<body>

<style>
	.something {
		background: red url("images/foo.gif");
		width: 50px;
		height: 50px;
	}
	
	.something {
		background-image: none;
	}
</style>

<div class="something">
</div>
</body>
</html>


Fiddler says:
404 HTTP .... images/foo.gif
Comment 1 Dave Hyatt 2008-06-09 22:57:51 PDT
Yes, this is a known annoyance that i intend to fix (hopefully soon).  It applies to all image properties and not just to background-image.
Comment 2 Seth Thomas Rasmussen 2008-11-20 10:19:02 PST
I would say this bug is a bit more severe than "Normal". Any sort of plan for when a fix for this might come in?
Comment 3 Alexey Proskuryakov 2010-09-03 12:22:05 PDT
Does this still occur with WebKit nightlies?
Comment 4 Simon Fraser (smfr) 2010-09-03 14:13:33 PDT
Fixed via bug 24223.