Bug 67712 - background-size:contain and full page zoom can sometimes cause background image not to fill the container
Summary: background-size:contain and full page zoom can sometimes cause background ima...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 27569
  Show dependency treegraph
 
Reported: 2011-09-07 09:40 PDT by Adam Roben (:aroben)
Modified: 2017-04-27 10:34 PDT (History)
10 users (show)

See Also:


Attachments
image used by testcase (450 bytes, image/png)
2011-09-07 09:40 PDT, Adam Roben (:aroben)
no flags Details
testcase (383 bytes, text/html)
2011-09-07 09:41 PDT, Adam Roben (:aroben)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2011-09-07 09:40:48 PDT
Created attachment 106592 [details]
image used by testcase

To reproduce:

1. Load the attached test case
2. Zoom the page once

You'll see some red appear to the right of the grid.
Comment 1 Adam Roben (:aroben) 2011-09-07 09:41:18 PDT
Created attachment 106593 [details]
testcase
Comment 2 Adam Roben (:aroben) 2011-09-07 09:43:26 PDT
Note that the div#inner and the background-image have the same dimensions: 570x18. But after zooming once, document.getElementById('inner').getBoundingClientRect().height is 17.5! I assume this is the source of the bug.
Comment 3 Adam Roben (:aroben) 2011-09-07 09:46:38 PDT
Maybe related to bug 66256?
Comment 4 Simon Fraser (smfr) 2011-09-07 09:48:24 PDT
By "zoom" you mean command+, or gesture zoom?
Comment 5 Adam Roben (:aroben) 2011-09-07 09:54:49 PDT
Cmd-+
Comment 6 mitz 2011-09-07 09:58:25 PDT
I believe the height is rounded down to floor(18 * 1.2) = 21, and the width is 570*1.2 = 684. This allows the image to scale by a factor of 21/18, giving it a width of 665, leaving 19 horizontal pixels showing red.
Comment 7 Dave Hyatt 2011-09-07 12:26:12 PDT
I suspect the "auto" value for background-size will have similar issues.
Comment 8 Radar WebKit Bug Importer 2011-09-30 16:18:45 PDT
<rdar://problem/10218266>
Comment 9 Dominik Röttsches (drott) 2012-09-21 06:22:00 PDT
(In reply to comment #7)
> I suspect the "auto" value for background-size will have similar issues.

Yes - I see a red line below in "containt" & "auto" case.
Comment 10 Dominik Röttsches (drott) 2012-09-21 06:24:07 PDT
(In reply to comment #9)
> (In reply to comment #7)
> > I suspect the "auto" value for background-size will have similar issues.

Same for "100%".
Comment 11 Simon Fraser (smfr) 2017-04-27 10:34:43 PDT
I can't reproduce this bug in recent builds.