Bug 124775 - background-repeat: repeat-y is imprecise for certain background-size values
Summary: background-repeat: repeat-y is imprecise for certain background-size values
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Manish Gurnaney
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-22 07:30 PST by Derek Detweiler
Modified: 2022-07-13 16:28 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Detweiler 2013-11-22 07:30:21 PST
Overview: background-size appears to incorrectly scale when repeated across background, causing it to repeat more times than it should.

Steps to reproduce:
Visit this link for a working example: http://jsfiddle.net/vwKv3/1/

Actual results:
Note that the triangles in columns 5 and 7 (CSS classes "repeater e" and "repeater g" respectively) show a portion of an additional triangle at the bottom of the column.

Expected results:
The triangle stack should repeat a precise number of times according to the background-size of the div, have an extra bit of triangle at the bottom.

Platforms:
Seems to happen on Chrome on both Win 7 and Win Vista, Safari and Chrome on Mac OSX
Comment 1 Derek Detweiler 2013-11-22 07:38:53 PST
(In reply to comment #0) Looks like column 7 (repeater g) is actually correct, whoops! But column 5 does correctly expose the behavior I noted above.
Comment 2 Manish Gurnaney 2014-03-04 00:19:35 PST
Checked the code and found the route cause of the issue. The issue is happening because of the Float point error. 
As per the given test case, When Image is drawn as per style property height of the Image should be 37.5. While doing the calculation for the height int RenderBoxModelObject::calculateFillTileSize, Float is being considered when we calculate the height. After this we create a Object for type LayoutUnit and pass the float value as a parameter,which in turn stores it as an int value has the value is reduced to 37 which creates the difference at the end.
Comment 3 Brent Fulgham 2022-07-13 16:28:58 PDT
Safari, Chrome, and Firefox all agree on rendering for this test case. I don't believe there is any remaining compatibility issue.