⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 249203 in webkit


Ignore:
Timestamp:
Aug 28, 2019, 9:57:31 AM (7 years ago)
Author:
Simon Fraser
Message:

Have RenderSVGBlock compute visual overflow just like everyone else
https://bugs.webkit.org/show_bug.cgi?id=201211

Reviewed by Zalan Bujtas.

RenderSVGBlock overrode visualOverflowRect() just to account for text shadow. This prevents callers
optimizing calls to visualOverflowRect(), so instead have RenderSVGBlock implement computeOverflow()
and call addVisualOverflow().

  • rendering/svg/RenderSVGBlock.cpp:

(WebCore::RenderSVGBlock::computeOverflow):
(WebCore::RenderSVGBlock::visualOverflowRect const): Deleted.

  • rendering/svg/RenderSVGBlock.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r249198 r249203  
     12019-08-28  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have RenderSVGBlock compute visual overflow just like everyone else
     4        https://bugs.webkit.org/show_bug.cgi?id=201211
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        RenderSVGBlock overrode visualOverflowRect() just to account for text shadow. This prevents callers
     9        optimizing calls to visualOverflowRect(), so instead have RenderSVGBlock implement computeOverflow()
     10        and call addVisualOverflow().
     11
     12        * rendering/svg/RenderSVGBlock.cpp:
     13        (WebCore::RenderSVGBlock::computeOverflow):
     14        (WebCore::RenderSVGBlock::visualOverflowRect const): Deleted.
     15        * rendering/svg/RenderSVGBlock.h:
     16
    1172019-08-28  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp

    r232018 r249203  
    3535    : RenderBlockFlow(element, WTFMove(style))
    3636{
    37 }
    38 
    39 LayoutRect RenderSVGBlock::visualOverflowRect() const
    40 {
    41     LayoutRect borderRect = borderBoxRect();
    42 
    43     if (const ShadowData* textShadow = style().textShadow())
    44         textShadow->adjustRectForShadow(borderRect);
    45 
    46     return borderRect;
    4737}
    4838
     
    8676}
    8777
     78void RenderSVGBlock::computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats)
     79{
     80    RenderBlockFlow::computeOverflow(oldClientAfterEdge, recomputeFloats);
     81
     82    const auto* textShadow = style().textShadow();
     83    if (!textShadow)
     84        return;
     85
     86    LayoutRect borderRect = borderBoxRect();
     87    textShadow->adjustRectForShadow(borderRect);
     88    addVisualOverflow(snappedIntRect(borderRect));
    8889}
     90
     91}
  • trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h

    r228908 r249203  
    3030    WTF_MAKE_ISO_ALLOCATED(RenderSVGBlock);
    3131public:
    32     LayoutRect visualOverflowRect() const final;
    33 
    3432    SVGGraphicsElement& graphicsElement() const { return downcast<SVGGraphicsElement>(nodeForNonAnonymous()); }
    3533
     
    3735    RenderSVGBlock(SVGGraphicsElement&, RenderStyle&&);
    3836    void willBeDestroyed() override;
     37
     38    void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats = false) override;
    3939
    4040private:
Note: See TracChangeset for help on using the changeset viewer.