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

Issue 1811943003: 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:
blink-reviews, blink-reviews-paint_chromium.org, chromium-reviews, dshwang, slimming-paint-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix for lack of cover with background-size: cover 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. R=leviw@chromium.org BUG=594580 Committed: https://crrev.com/3f65f0639cf80474313ad86ed43a9216a6991dd3 Cr-Commit-Position: refs/heads/master@{#382055}

Patch Set 1 #

Total comments: 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 1 comment Download

Messages

Total messages: 11 (4 generated)
Stephen Chennney
https://codereview.chromium.org/1811943003/diff/1/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp File third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp (right): https://codereview.chromium.org/1811943003/diff/1/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp#newcode115 third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp:115: // positioningAreaSize. Following the style guide makes the following ...
4 years, 9 months ago (2016-03-17 19:46:29 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1811943003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1811943003/1
4 years, 9 months ago (2016-03-17 19:46:49 UTC) #3
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/190609)
4 years, 9 months ago (2016-03-17 22:59:09 UTC) #5
leviw_travelin_and_unemployed
lgtm Schenney, you are my hero.
4 years, 9 months ago (2016-03-18 18:38:10 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1811943003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1811943003/1
4 years, 9 months ago (2016-03-18 18:39:02 UTC) #8
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 9 months ago (2016-03-18 19:53:31 UTC) #9
commit-bot: I haz the power
4 years, 9 months ago (2016-03-18 19:55:15 UTC) #11
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/3f65f0639cf80474313ad86ed43a9216a6991dd3
Cr-Commit-Position: refs/heads/master@{#382055}

Powered by Google App Engine
This is Rietveld 408576698