Index: third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp |
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp |
index c6bc94a57fcb2167244e9dada8154dd6dbf51d19..040ca6f7a22aac602f71ebffd7c2b9b890273815 100644 |
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp |
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp |
@@ -408,6 +408,26 @@ void StyleBuilderFunctions::applyValueCSSPropertySnapHeight(StyleResolverState& |
state.style()->setSnapHeightPosition(position); |
} |
+void StyleBuilderFunctions::applyInitialCSSPropertySnapWidth(StyleResolverState& state) |
+{ |
+ state.style()->setSnapWidth(LayoutUnit()); |
+} |
+ |
+void StyleBuilderFunctions::applyInheritCSSPropertySnapWidth(StyleResolverState& state) |
+{ |
+ state.style()->setSnapWidth(state.parentStyle()->snapWidth()); |
+} |
+ |
+void StyleBuilderFunctions::applyValueCSSPropertySnapWidth(StyleResolverState& state, CSSValue* value) |
+{ |
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
+ ASSERT(primitiveValue->isLength()); |
+ LayoutUnit unit = LayoutUnit::fromFloatCeil(primitiveValue->computeLength<float>(state.cssToLengthConversionData())); |
+ ASSERT(unit >= 0); |
+ const int kMaxSnapWidth = (1 << StyleRareNonInheritedData::kSnapWidthBits) - 1; |
+ state.style()->setSnapWidth(std::min(unit, LayoutUnit(kMaxSnapWidth))); |
+} |
+ |
void StyleBuilderFunctions::applyValueCSSPropertyTextAlign(StyleResolverState& state, CSSValue* value) |
{ |
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |