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

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

Issue 1008893002: [CSS Shapes] Normalize margin box size (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use std::max instead of clamp Created 5 years, 9 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-floats-ellipse-negative-margins-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 8e2f81d369b722b9b5020478835df591fe79ed71..eea6568ab106225e2a466d08aa62dfbf693359a7 100644
--- a/Source/core/layout/shapes/ShapeOutsideInfo.cpp
+++ b/Source/core/layout/shapes/ShapeOutsideInfo.cpp
@@ -76,6 +76,8 @@ void ShapeOutsideInfo::setReferenceBoxLogicalSize(LayoutSize newReferenceBoxLogi
break;
}
+ newReferenceBoxLogicalSize.clampNegativeToZero();
+
if (m_referenceBoxLogicalSize == newReferenceBoxLogicalSize)
return;
markShapeAsDirty();
@@ -287,7 +289,7 @@ ShapeOutsideDeltas ShapeOutsideInfo::computeDeltasForContainingBlockLine(const L
if (isShapeDirty() || !m_shapeOutsideDeltas.isForLine(borderBoxLineTop, lineHeight)) {
LayoutUnit referenceBoxLineTop = borderBoxLineTop - logicalTopOffset();
- LayoutUnit floatMarginBoxWidth = containingBlock.logicalWidthForFloat(&floatingObject);
+ LayoutUnit floatMarginBoxWidth = std::max(containingBlock.logicalWidthForFloat(&floatingObject), LayoutUnit());
if (computedShape().lineOverlapsShapeMarginBounds(referenceBoxLineTop, lineHeight)) {
LineSegment segment = computedShape().getExcludedInterval((borderBoxLineTop - logicalTopOffset()), std::min(lineHeight, shapeLogicalBottom() - borderBoxLineTop));
« no previous file with comments | « LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-negative-margins-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698