Title: [286449] trunk/Source/WebCore
Revision
286449
Author
commit-qu...@webkit.org
Date
2021-12-02 13:26:40 -0800 (Thu, 02 Dec 2021)

Log Message

Verify borderRect is Renderable
https://bugs.webkit.org/show_bug.cgi?id=232650

Patch by Brandon Stewart <brandonstew...@apple.com> on 2021-12-02
Reviewed by Alan Bujtas.

Verify that borderRect is renderable.
Align isRenderable() implementations in RoundedRect and FloatRoundedRect.

* platform/graphics/RoundedRect.cpp:
(WebCore::RoundedRect::isRenderable const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBoxShadow):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (286448 => 286449)


--- trunk/Source/WebCore/ChangeLog	2021-12-02 21:25:35 UTC (rev 286448)
+++ trunk/Source/WebCore/ChangeLog	2021-12-02 21:26:40 UTC (rev 286449)
@@ -1,3 +1,18 @@
+2021-12-02  Brandon Stewart  <brandonstew...@apple.com>
+
+        Verify borderRect is Renderable
+        https://bugs.webkit.org/show_bug.cgi?id=232650
+
+        Reviewed by Alan Bujtas.
+
+        Verify that borderRect is renderable.
+        Align isRenderable() implementations in RoundedRect and FloatRoundedRect.
+
+        * platform/graphics/RoundedRect.cpp:
+        (WebCore::RoundedRect::isRenderable const):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintBoxShadow):
+
 2021-12-02  Alan Bujtas  <za...@apple.com>
 
         [LFC][IFC] Redundant line run type checking in InlineDisplayContentBuilder::processNonBidiContent

Modified: trunk/Source/WebCore/platform/graphics/RoundedRect.cpp (286448 => 286449)


--- trunk/Source/WebCore/platform/graphics/RoundedRect.cpp	2021-12-02 21:25:35 UTC (rev 286448)
+++ trunk/Source/WebCore/platform/graphics/RoundedRect.cpp	2021-12-02 21:26:40 UTC (rev 286449)
@@ -165,7 +165,11 @@
 
 bool RoundedRect::isRenderable() const
 {
-    return m_radii.topLeft().width() + m_radii.topRight().width() <= m_rect.width()
+    return m_radii.topLeft().width() >= 0 && m_radii.topLeft().height() >= 0
+        && m_radii.bottomLeft().width() >= 0 && m_radii.bottomLeft().height() >= 0
+        && m_radii.topRight().width() >= 0 && m_radii.topRight().height() >= 0
+        && m_radii.bottomRight().width() >= 0 && m_radii.bottomRight().height() >= 0
+        && m_radii.topLeft().width() + m_radii.topRight().width() <= m_rect.width()
         && m_radii.bottomLeft().width() + m_radii.bottomRight().width() <= m_rect.width()
         && m_radii.topLeft().height() + m_radii.bottomLeft().height() <= m_rect.height()
         && m_radii.topRight().height() + m_radii.bottomRight().height() <= m_rect.height();

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (286448 => 286449)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2021-12-02 21:25:35 UTC (rev 286448)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2021-12-02 21:26:40 UTC (rev 286449)
@@ -2422,6 +2422,9 @@
     RoundedRect borderRect = (shadowStyle == ShadowStyle::Inset) ? style.getRoundedInnerBorderFor(paintRect, includeLogicalLeftEdge, includeLogicalRightEdge)
         : style.getRoundedBorderFor(paintRect, includeLogicalLeftEdge, includeLogicalRightEdge);
 
+    if (!borderRect.isRenderable())
+        borderRect.adjustRadii();
+
     bool hasBorderRadius = style.hasBorderRadius();
     float deviceScaleFactor = document().deviceScaleFactor();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to