Changeset 167637 in webkit


Ignore:
Timestamp:
Apr 21, 2014 5:15:35 PM (10 years ago)
Author:
Alan Bujtas
Message:

REGRESSION (r166784): Gradient at background of iCloud login page doesn’t go all the way to the bottom
https://bugs.webkit.org/show_bug.cgi?id=131924

Computing tile dimension for contain/cover requires higher precision than what LayoutUnit has. Switching to floats.

Reviewed by Simon Fraser.

Source/WebCore:
Test: fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision.html

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::calculateFillTileSize):

LayoutTests:

  • fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision-expected.html: Added.
  • fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r167632 r167637  
     12014-04-21  Zalan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION (r166784): Gradient at background of iCloud login page doesn’t go all the way to the bottom
     4        https://bugs.webkit.org/show_bug.cgi?id=131924
     5
     6        Computing tile dimension for contain/cover requires higher precision than what LayoutUnit has. Switching to floats.
     7
     8        Reviewed by Simon Fraser.
     9
     10        * fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision-expected.html: Added.
     11        * fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision.html: Added.
     12
    1132014-04-21  Eric Carlson  <eric.carlson@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r167636 r167637  
     12014-04-21  Zalan Bujtas  <zalan@apple.com>
     2
     3        REGRESSION (r166784): Gradient at background of iCloud login page doesn’t go all the way to the bottom
     4        https://bugs.webkit.org/show_bug.cgi?id=131924
     5
     6        Computing tile dimension for contain/cover requires higher precision than what LayoutUnit has. Switching to floats.
     7
     8        Reviewed by Simon Fraser.
     9
     10        Test: fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision.html
     11
     12        * rendering/RenderBoxModelObject.cpp:
     13        (WebCore::RenderBoxModelObject::calculateFillTileSize):
     14
    1152014-04-21  Dean Jackson  <dino@apple.com>
    216
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r167351 r167637  
    978978        case Contain:
    979979        case Cover: {
    980             float horizontalScaleFactor = imageIntrinsicSize.width() ? (positioningAreaSize.width() / imageIntrinsicSize.width()).toFloat() : 1;
    981             float verticalScaleFactor = imageIntrinsicSize.height() ? (positioningAreaSize.height() / imageIntrinsicSize.height()).toFloat() : 1;
     980            // Scale computation needs higher precision than what LayoutUnit can offer.
     981            FloatSize localImageIntrinsicSize = imageIntrinsicSize;
     982            FloatSize localPositioningAreaSize = positioningAreaSize;
     983
     984            float horizontalScaleFactor = localImageIntrinsicSize.width() ? (localPositioningAreaSize.width() / localImageIntrinsicSize.width()) : 1;
     985            float verticalScaleFactor = localImageIntrinsicSize.height() ? (localPositioningAreaSize.height() / localImageIntrinsicSize.height()) : 1;
    982986            float scaleFactor = type == Contain ? std::min(horizontalScaleFactor, verticalScaleFactor) : std::max(horizontalScaleFactor, verticalScaleFactor);
    983987            float deviceScaleFactor = document().deviceScaleFactor();
    984             return LayoutSize(std::max<LayoutUnit>(1 / deviceScaleFactor, imageIntrinsicSize.width() * scaleFactor),
    985                 std::max<LayoutUnit>(1 / deviceScaleFactor, imageIntrinsicSize.height() * scaleFactor));
     988            return LayoutSize(std::max<LayoutUnit>(1 / deviceScaleFactor, localImageIntrinsicSize.width() * scaleFactor),
     989                std::max<LayoutUnit>(1 / deviceScaleFactor, localImageIntrinsicSize.height() * scaleFactor));
    986990       }
    987991    }
Note: See TracChangeset for help on using the changeset viewer.