Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1260)

Unified Diff: Source/core/rendering/shapes/ShapeOutsideInfo.cpp

Issue 844733004: [CSS Shapes] Negative raster shape height leads to crash (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Force line-height Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/shapes/shape-outside-floats/shape-outside-negative-height-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/shapes/ShapeOutsideInfo.cpp
diff --git a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
index 5e3e524d5a31077b80f62917154f242e5fdba26b..669ea90d8b169966e9e290ce1b068ea652872c6d 100644
--- a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
+++ b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
@@ -103,7 +103,9 @@ static LayoutRect getShapeImageMarginRect(const RenderBox& renderBox, const Layo
{
LayoutPoint marginBoxOrigin(-renderBox.marginLogicalLeft() - renderBox.borderAndPaddingLogicalLeft(), -renderBox.marginBefore() - renderBox.borderBefore() - renderBox.paddingBefore());
LayoutSize marginBoxSizeDelta(renderBox.marginLogicalWidth() + renderBox.borderAndPaddingLogicalWidth(), renderBox.marginLogicalHeight() + renderBox.borderAndPaddingLogicalHeight());
- return LayoutRect(marginBoxOrigin, referenceBoxLogicalSize + marginBoxSizeDelta);
+ LayoutSize marginRectSize(referenceBoxLogicalSize + marginBoxSizeDelta);
+ marginRectSize.clampNegativeToZero();
+ return LayoutRect(marginBoxOrigin, marginRectSize);
}
static bool isValidRasterShapeRect(const LayoutRect& rect)
« no previous file with comments | « LayoutTests/fast/shapes/shape-outside-floats/shape-outside-negative-height-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698