Bug 8732 - backgrounds with background-size and background-origin do not always lay out correctly
Summary: backgrounds with background-size and background-origin do not always lay out ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Beth Dakin
URL: http://www.w3.org/TR/css3-background/...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2006-05-04 09:50 PDT by Beth Dakin
Modified: 2006-05-04 11:17 PDT (History)
0 users

See Also:


Attachments
Patch (12.99 KB, patch)
2006-05-04 09:57 PDT, Beth Dakin
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2006-05-04 09:50:54 PDT
backgrounds with background-size, background-position and/or background-origin do not always lay out correctly. This problem is covered by the following existing layout tests:

fast/background/size/backgroundSize10.html
fast/background/size/backgroundSize12.html
fast/background/size/backgroundSize18.html
fast/background/size/backgroundSize19.html
Comment 1 Beth Dakin 2006-05-04 09:57:20 PDT
Created attachment 8104 [details]
Patch

Here is a patch that fixes the problem. This patch generally re-arranges things so that the scaledImageWidth and scaledImageHeight are calculated at the beginning and taken into consideration when calculating cx, cy, cw, ch, sx, and sy. This means that we no longer have to scale the source point over in the image code and that we can remove some of the weird if-clauses that adjusted the c-values when the scale sizes were computed after the fact.
Comment 2 Dave Hyatt 2006-05-04 10:41:56 PDT
Comment on attachment 8104 [details]
Patch

r=me
Comment 3 Beth Dakin 2006-05-04 11:17:54 PDT
I committed the fix.