Bug 24223 - CSS downloads all background images related to element, instead of just final rule
Summary: CSS downloads all background images related to element, instead of just final...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh Intel OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL: http://www.leepowell.net/webkit/
Keywords: InRadar
: 31630 52847 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-27 04:19 PST by Lee Powell
Modified: 2011-08-03 06:36 PDT (History)
8 users (show)

See Also:


Attachments
Mostly complete patch (36.78 KB, patch)
2010-08-25 22:48 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (41.47 KB, patch)
2010-08-26 14:57 PDT, Simon Fraser (smfr)
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lee Powell 2009-02-27 04:19:22 PST
When an element is given a background image, that is later over ruled with another background image later on in the css cascade, webkit downloads both images.

Check the link for an example, and then view the Resources in the Inspector panel.
Comment 1 Dave Hyatt 2010-02-14 14:26:42 PST
*** Bug 31630 has been marked as a duplicate of this bug. ***
Comment 2 Andy Hume 2010-08-10 18:02:17 PDT
This seems to have been fixed in or before r65052?
Comment 3 Simon Fraser (smfr) 2010-08-25 12:25:38 PDT
No, this still happens if the two images are referred to by different rule blocks.
Comment 4 Simon Fraser (smfr) 2010-08-25 12:27:41 PDT
<rdar://problem/8354391>
Comment 5 Simon Fraser (smfr) 2010-08-25 22:48:27 PDT
Created attachment 65526 [details]
Mostly complete patch

This patch works pretty well, but breaks one test: fast/css-generated-content/after-order.html
Comment 6 Simon Fraser (smfr) 2010-08-26 14:57:05 PDT
Created attachment 65622 [details]
Patch
Comment 7 WebKit Review Bot 2010-08-26 14:58:55 PDT
Attachment 65622 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/css/CSSStyleSelector.cpp:6725:  A case label should not be indented, but line up with its switch statement.  [whitespace/indent] [4]
Total errors found: 1 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Dave Hyatt 2010-08-26 15:10:53 PDT
Comment on attachment 65622 [details]
Patch

r=me
Comment 9 Simon Fraser (smfr) 2010-08-26 15:17:30 PDT
http://trac.webkit.org/changeset/66141
Comment 10 Ryosuke Niwa 2010-08-26 17:16:49 PDT
http://trac.webkit.org/changeset/66141 seems to have caused fast/forms/select-style.html to fail on mac:

@@ -56,10 +56,10 @@
       RenderText {#text} at (0,160) size 498x18
         text run at (0,160) width 498: "This tests that background is white if only background-image:none is specified."
       RenderBR {BR} at (498,174) size 0x0
-      RenderMenuList {SELECT} at (2,180) size 51x18 [bgcolor=#FFFFFF]
-        RenderBlock (anonymous) at (0,0) size 51x18
-          RenderText at (8,2) size 20x13
-            text run at (8,2) width 20: "test"
+      RenderMenuList {SELECT} at (2,180) size 51x18 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
+        RenderBlock (anonymous) at (1,1) size 49x16
+          RenderText at (8,1) size 20x13
+            text run at (8,1) width 20: "test"
       RenderText {#text} at (55,179) size 4x18
         text run at (55,179) width 4: " "
       RenderBR {BR} at (59,193) size 0x0
Comment 11 Simon Fraser (smfr) 2010-08-26 17:44:28 PDT
I filed bug 44737 to investigate the test breakage.
Comment 12 Alexey Proskuryakov 2011-01-20 22:28:22 PST
*** Bug 52847 has been marked as a duplicate of this bug. ***