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

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

Issue 1036653002: Clamp shape-margin to zero (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address review comment Created 5 years, 8 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-block-width-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/layout/shapes/ShapeOutsideInfo.cpp
diff --git a/Source/core/layout/shapes/ShapeOutsideInfo.cpp b/Source/core/layout/shapes/ShapeOutsideInfo.cpp
index 7a110df8b54bcaac27aa3d9957b7f95ab8817f2a..4f875a18c9fd3f9ef5065a49501991dfa020d5cc 100644
--- a/Source/core/layout/shapes/ShapeOutsideInfo.cpp
+++ b/Source/core/layout/shapes/ShapeOutsideInfo.cpp
@@ -153,7 +153,9 @@ const Shape& ShapeOutsideInfo::computedShape() const
const ComputedStyle& containingBlockStyle = *m_renderer.containingBlock()->style();
WritingMode writingMode = containingBlockStyle.writingMode();
- LayoutUnit maximumValue = m_renderer.containingBlock() ? m_renderer.containingBlock()->contentWidth() : LayoutUnit();
+ LayoutUnit maximumValue;
+ if (m_renderer.containingBlock() && m_renderer.containingBlock()->contentWidth() > 0)
leviw_travelin_and_unemployed 2015/04/14 21:12:31 The contentWidth() is negative? That doesn't seem
+ maximumValue = m_renderer.containingBlock()->contentWidth();
float margin = floatValueForLength(m_renderer.style()->shapeMargin(), maximumValue.toFloat());
float shapeImageThreshold = style.shapeImageThreshold();
« no previous file with comments | « LayoutTests/fast/shapes/shape-outside-floats/shape-outside-negative-block-width-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698