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

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

Issue 226373002: [CSS Shapes] shape-margin in percentage units always computes to 0px (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test Created 6 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
Index: Source/core/rendering/shapes/ShapeOutsideInfo.cpp
diff --git a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
index ed3beb1933a8a4bbd2ab21571e50b4f69481aba4..3e807fb28c60405c8132273f861203ab96b4905d 100644
--- a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
+++ b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
@@ -35,6 +35,8 @@
#include "core/rendering/RenderBox.h"
#include "core/rendering/RenderImage.h"
leviw_travelin_and_unemployed 2014/04/11 21:04:17 supernit: why this empty space? I'm only used to s
+#include "platform/LengthFunctions.h"
+
namespace WebCore {
CSSBoxType referenceBox(const ShapeValue& shapeValue)
@@ -123,7 +125,9 @@ const Shape& ShapeOutsideInfo::computedShape() const
const RenderStyle& containingBlockStyle = *m_renderer.containingBlock()->style();
WritingMode writingMode = containingBlockStyle.writingMode();
- Length margin = style.shapeMargin();
+ LayoutUnit maximumValue = m_renderer.containingBlock() ? m_renderer.containingBlock()->contentWidth() : LayoutUnit();
+ float margin = floatValueForLength(m_renderer.style()->shapeMargin(), maximumValue.toFloat());
+
float shapeImageThreshold = style.shapeImageThreshold();
ASSERT(style.shapeOutside());
const ShapeValue& shapeValue = *style.shapeOutside();

Powered by Google App Engine
This is Rietveld 408576698