Bug 69211 - HTML document is re-requested for empty URL in background:url()
Summary: HTML document is re-requested for empty URL in background:url()
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 78377 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-01 03:59 PDT by Javier
Modified: 2015-08-04 09:40 PDT (History)
16 users (show)

See Also:


Attachments
show problem with css (476.43 KB, image/jpeg)
2011-10-01 03:59 PDT, Javier
no flags Details
add url() to background:#fff (339.56 KB, image/jpeg)
2011-10-01 04:34 PDT, Javier
no flags Details
Test case (95 bytes, text/html)
2011-10-02 02:35 PDT, Vsevolod Vlasov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Javier 2011-10-01 03:59:38 PDT
Created attachment 109404 [details]
show problem with css

The following happens to me often in Mac 10.6.8 and Windows 7:
When I modify the css data in the Developer tools> Elements panel> Styles subpanel, if I click on the link to my css, see point 1 in the image, the result is the point 2 in the Resources panel and 3 in the console of the image. If I refresh the browser it works correctly again, so I guess it's no problem of my css.
Comment 1 Javier 2011-10-01 04:34:10 PDT
Created attachment 109405 [details]
add url() to background:#fff
Comment 2 Javier 2011-10-01 04:34:55 PDT
Comment on attachment 109405 [details]
add url() to background:#fff

Finally, I have found when this problem happens. If I have a background: # 930 and I add url (image / photo.jpg) the problem appears
Comment 3 Alexey Proskuryakov 2011-10-01 22:00:07 PDT
Does the same happens if you add an empty url() in you CSS file, not in Web Inspector?
Comment 4 Ilya Tikhonovsky 2011-10-01 23:09:04 PDT
(In reply to comment #3)
> Does the same happens if you add an empty url() in you CSS file, not in Web Inspector?

I made an experiment and found that <div style="background: url()"> in html file
forces the browser to load html file second time.
The warning "Resource interpreted as Other but transferred with MIME type undefined." appears in console too.

You are right. This is not a Web Inspector specific problem.
Comment 5 Alexey Proskuryakov 2011-10-01 23:40:12 PDT
Could you please attach your test case?

This sounds like a missed case in bug 30303 and related bugs.
Comment 6 Vsevolod Vlasov 2011-10-02 02:18:50 PDT
(In reply to comment #5)
> Could you please attach your test case?
> 
> This sounds like a missed case in bug 30303 and related bugs.

http://www.w3.org/TR/CSS2/syndata.html#uri
Relative URIs (as defined in [RFC3986]) are resolved to full URIs using a base URI. RFC 3986, section 5, defines the normative algorithm for this process. For CSS style sheets, the base URI is that of the style sheet, not that of the source document.

So according to spec adding url() to css triggers another load if this stylesheet as an image, this is not a bug.

From this moment on CachedResource stored in MemoryCache for this url has Image type, and it is not possible to correctly show it in Web Inspector.

See also http://code.google.com/p/chromium/issues/detail?id=84605 for the same problem.
Comment 7 Vsevolod Vlasov 2011-10-02 02:20:30 PDT
Sorry for a typo:

So according to spec adding url() to css triggers another load OF this stylesheet as an image, this is not a bug.
Comment 8 Vsevolod Vlasov 2011-10-02 02:35:17 PDT
Created attachment 109418 [details]
Test case

Alexey, I've read this bug you mentioned, it's the same issue but for CSS.
Since I can't think of any good reason to use stylesheet as an image, I think this could be fixed the same way. 

Currently Firefox has the same behavior as WebKit. See test attached.
Comment 9 Javier 2011-10-02 02:41:02 PDT
(In reply to comment #8)
> Created an attachment (id=109418) [details]
> Test case
> 
> Alexey, I've read this bug you mentioned, it's the same issue but for CSS.
> Since I can't think of any good reason to use stylesheet as an image, I think this could be fixed the same way. 
> 
> Currently Firefox has the same behavior as WebKit. See test attached.

I do not know if this is a webkit bug but when you click on the link to the css in the Developer tools> Elements panel> Styles subpanel, you should go to the css, because the path is to the css.
Comment 10 Alexander Pavlov (apavlov) 2012-02-14 01:41:52 PST
*** Bug 78377 has been marked as a duplicate of this bug. ***