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

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: Clamp the reference box size to zero 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..a1535ed73ef62c7735280198626278db5c0c1eb9 100644
--- a/Source/core/layout/shapes/ShapeOutsideInfo.cpp
+++ b/Source/core/layout/shapes/ShapeOutsideInfo.cpp
@@ -56,6 +56,10 @@ void ShapeOutsideInfo::setReferenceBoxLogicalSize(LayoutSize newReferenceBoxLogi
newReferenceBoxLogicalSize.expand(m_renderer.marginWidth(), m_renderer.marginHeight());
else
newReferenceBoxLogicalSize.expand(m_renderer.marginHeight(), m_renderer.marginWidth());
+ if (newReferenceBoxLogicalSize.isEmpty()) {
bjonesbe 2015/03/16 22:26:34 Sorry I missed this earlier, but in this case you
+ newReferenceBoxLogicalSize.setWidth(newReferenceBoxLogicalSize.width().clamp(0.0));
+ newReferenceBoxLogicalSize.setHeight(newReferenceBoxLogicalSize.height().clamp(0.0));
+ }
break;
case BorderBox:
break;
@@ -287,7 +291,7 @@ ShapeOutsideDeltas ShapeOutsideInfo::computeDeltasForContainingBlockLine(const L
if (isShapeDirty() || !m_shapeOutsideDeltas.isForLine(borderBoxLineTop, lineHeight)) {
LayoutUnit referenceBoxLineTop = borderBoxLineTop - logicalTopOffset();
- LayoutUnit floatMarginBoxWidth = containingBlock.logicalWidthForFloat(&floatingObject);
+ LayoutUnit floatMarginBoxWidth = containingBlock.logicalWidthForFloat(&floatingObject).abs();
bjonesbe 2015/03/16 22:26:34 This one also needs to clamp to 0, as a float with
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