Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
index 61fad6199d87245b7d5b117528fce8994b9c6100..0efbf131a6fe318b113e2349e70d6ca66f9830f1 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
@@ -591,6 +591,19 @@ void LayoutBox::updateLayerTransformAfterLayout() |
layer()->updateTransformationMatrix(); |
} |
+LayoutUnit LayoutBox::snapContentLogicalWidth() const |
+{ |
+ LayoutUnit width = contentLogicalWidth(); |
+ if (width <= 0) |
+ return width; |
+ LayoutUnit unit = styleRef().snapWidth(); |
+ ASSERT(unit > 0); |
+ LayoutUnit mod = intMod(width, unit); |
+ if (!mod) |
+ return width; |
+ return LayoutUnit((width - mod).ceil()); |
+} |
+ |
LayoutUnit LayoutBox::constrainLogicalWidthByMinMax(LayoutUnit logicalWidth, LayoutUnit availableWidth, LayoutBlock* cb) const |
{ |
const ComputedStyle& styleToUse = styleRef(); |