Changeset 252689 in webkit


Ignore:
Timestamp:
Nov 20, 2019 9:12:08 AM (4 years ago)
Author:
Simon Fraser
Message:

REGRESSION (r252161): box-shadow with inset and rounded borders is clipped
https://bugs.webkit.org/show_bug.cgi?id=204348

Reviewed by Zalan Bujtas.

Source/WebCore:

r252161 introduced a bug for inset shadows where we passed the wrong rect to areaCastingShadowInHole().
Clean the code up a little, and make the xOffset stuff more similar to the outset shadow path.
We could still do a better job of pixel snapping here.

Test: fast/box-shadow/inset-box-shadow.html

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::paintBoxShadow):

LayoutTests:

  • fast/box-shadow/inset-box-shadow-expected.html: Added.
  • fast/box-shadow/inset-box-shadow.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r252688 r252689  
     12019-11-20  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r252161): box-shadow with inset and rounded borders is clipped
     4        https://bugs.webkit.org/show_bug.cgi?id=204348
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        * fast/box-shadow/inset-box-shadow-expected.html: Added.
     9        * fast/box-shadow/inset-box-shadow.html: Added.
     10
    1112019-11-20  Per Arne Vollan  <pvollan@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r252686 r252689  
     12019-11-20  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r252161): box-shadow with inset and rounded borders is clipped
     4        https://bugs.webkit.org/show_bug.cgi?id=204348
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        r252161 introduced a bug for inset shadows where we passed the wrong rect to areaCastingShadowInHole().
     9        Clean the code up a little, and make the xOffset stuff more similar to the outset shadow path.
     10        We could still do a better job of pixel snapping here.
     11
     12        Test: fast/box-shadow/inset-box-shadow.html
     13
     14        * rendering/RenderBoxModelObject.cpp:
     15        (WebCore::RenderBoxModelObject::paintBoxShadow):
     16
    1172019-11-20  Zalan Bujtas  <zalan@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r252161 r252689  
    24752475            Color fillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), 255);
    24762476
    2477             FloatRect pixelSnappedOuterRect = snapRectToDevicePixels(areaCastingShadowInHole(holeRect, shadowPaintingExtent, shadowSpread, shadowOffset), deviceScaleFactor);
     2477            LayoutRect shadowCastingRect = areaCastingShadowInHole(border.rect(), shadowPaintingExtent, shadowSpread, shadowOffset);
    24782478            RoundedRect roundedHoleRect(holeRect, border.radii());
     2479
     2480            FloatRect pixelSnappedOuterRect = snapRectToDevicePixels(shadowCastingRect, deviceScaleFactor);
    24792481            FloatRoundedRect pixelSnappedRoundedHole = roundedHoleRect.pixelSnappedRoundedRectForPainting(deviceScaleFactor);
    24802482
     
    24862488                context.clip(pixelSnappedBorderRect.rect());
    24872489
    2488             IntSize extraOffset(2 * roundToInt(paintRect.width()) + std::max<LayoutUnit>(0, shadowOffset.width()) + shadowPaintingExtent - 2 * shadowSpread + 1, 0);
     2490            LayoutUnit xOffset = 2 * paintRect.width() + std::max<LayoutUnit>(0, shadowOffset.width()) + shadowPaintingExtent + 2 * shadowSpread + LayoutUnit(1);
     2491            LayoutSize extraOffset(xOffset.ceil(), 0);
     2492
    24892493            context.translate(extraOffset);
    24902494            shadowOffset -= extraOffset;
Note: See TracChangeset for help on using the changeset viewer.