Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Issue 1823593003: Fix for lack of cover with background-size: cover (Closed)

Created:
4 years, 9 months ago by Stephen Chennney
Modified:
4 years, 9 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@2661
Target Ref:
refs/pending/branch-heads/2661
Project:
chromium
Visibility:
Public.

Description

Fix for lack of cover with background-size: cover Merge for m50. We were sizing images for background-size:cover using floating point computations, then putting the result into a LayoutUnit then rounding down to align to pixels. The floating point approximation might give 99.997 instead of 100.0, then the conversion to LayoutUnit would make that 99.825 or something, which would then be rounded to 99, leaving a 1 pixel gap when the image should fill a 100 pixels wide space. The result is the background color appearing behind the image. This patch re-arranges the computation to avoid any rounding, making the dimension of interest exactly match the target rect. TBR=leviw@chromium.org BUG=594580 Review URL: https://codereview.chromium.org/1811943003 Cr-Commit-Position: refs/heads/master@{#382055} (cherry picked from commit 3f65f0639cf80474313ad86ed43a9216a6991dd3) Committed: https://chromium.googlesource.com/chromium/src/+/ecc5e56ebccf2a0f4f1dea476b3a9d46194d52e7

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -3 lines) Patch
A third_party/WebKit/LayoutTests/fast/backgrounds/background-cover-rounding.html View 1 chunk +24 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/backgrounds/background-cover-rounding-expected.html View 1 chunk +31 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp View 1 chunk +12 lines, -3 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
Stephen Chennney
4 years, 9 months ago (2016-03-21 15:18:29 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
ecc5e56ebccf2a0f4f1dea476b3a9d46194d52e7.

Powered by Google App Engine
This is Rietveld 408576698