Chromium Code Reviews
DescriptionFix 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 #
Messages
Total messages: 2 (1 generated)
|
|||||||||||||||||||||||||||||||||||||