Bug 8732

Summary: backgrounds with background-size and background-origin do not always lay out correctly
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: CSSAssignee: Beth Dakin <bdakin>
Status: RESOLVED FIXED    
Severity: Normal Keywords: InRadar
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://www.w3.org/TR/css3-background/#the-background-size
Attachments:
Description Flags
Patch hyatt: review+

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.