Title: [249203] trunk/Source/WebCore
- Revision
- 249203
- Author
- simon.fra...@apple.com
- Date
- 2019-08-28 09:57:31 -0700 (Wed, 28 Aug 2019)
Log 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:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (249202 => 249203)
--- trunk/Source/WebCore/ChangeLog 2019-08-28 16:42:40 UTC (rev 249202)
+++ trunk/Source/WebCore/ChangeLog 2019-08-28 16:57:31 UTC (rev 249203)
@@ -1,3 +1,19 @@
+2019-08-28 Simon Fraser <simon.fra...@apple.com>
+
+ 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:
+
2019-08-28 Ryosuke Niwa <rn...@webkit.org>
REGRESSION (r248807): Objects stored in ElementRareData are leaked
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp (249202 => 249203)
--- trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp 2019-08-28 16:42:40 UTC (rev 249202)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGBlock.cpp 2019-08-28 16:57:31 UTC (rev 249203)
@@ -36,16 +36,6 @@
{
}
-LayoutRect RenderSVGBlock::visualOverflowRect() const
-{
- LayoutRect borderRect = borderBoxRect();
-
- if (const ShadowData* textShadow = style().textShadow())
- textShadow->adjustRectForShadow(borderRect);
-
- return borderRect;
-}
-
void RenderSVGBlock::updateFromStyle()
{
RenderBlockFlow::updateFromStyle();
@@ -85,4 +75,17 @@
SVGResourcesCache::clientStyleChanged(*this, diff, style());
}
+void RenderSVGBlock::computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats)
+{
+ RenderBlockFlow::computeOverflow(oldClientAfterEdge, recomputeFloats);
+
+ const auto* textShadow = style().textShadow();
+ if (!textShadow)
+ return;
+
+ LayoutRect borderRect = borderBoxRect();
+ textShadow->adjustRectForShadow(borderRect);
+ addVisualOverflow(snappedIntRect(borderRect));
}
+
+}
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h (249202 => 249203)
--- trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h 2019-08-28 16:42:40 UTC (rev 249202)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGBlock.h 2019-08-28 16:57:31 UTC (rev 249203)
@@ -29,8 +29,6 @@
class RenderSVGBlock : public RenderBlockFlow {
WTF_MAKE_ISO_ALLOCATED(RenderSVGBlock);
public:
- LayoutRect visualOverflowRect() const final;
-
SVGGraphicsElement& graphicsElement() const { return downcast<SVGGraphicsElement>(nodeForNonAnonymous()); }
protected:
@@ -37,6 +35,8 @@
RenderSVGBlock(SVGGraphicsElement&, RenderStyle&&);
void willBeDestroyed() override;
+ void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats = false) override;
+
private:
void element() const = delete;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes