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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 2737673003: Revert of Catch up the spec update in CSS Rhythmic Sizing (Closed)
Patch Set: Created 3 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
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 2eb7a947b75d72f0c8b0dfb065b35c763953a2f1..621e4e3071fdb9e8a4c1356b1cb417d4aa00fab6 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -424,6 +424,42 @@
}
state.style()->setPageSizeType(pageSizeType);
state.style()->setPageSize(size);
+}
+
+void StyleBuilderFunctions::applyInitialCSSPropertySnapHeight(
+ StyleResolverState& state) {
+ state.style()->setSnapHeightUnit(0);
+ state.style()->setSnapHeightPosition(0);
+}
+
+void StyleBuilderFunctions::applyInheritCSSPropertySnapHeight(
+ StyleResolverState& state) {
+ state.style()->setSnapHeightUnit(state.parentStyle()->snapHeightUnit());
+ state.style()->setSnapHeightPosition(
+ state.parentStyle()->snapHeightPosition());
+}
+
+void StyleBuilderFunctions::applyValueCSSPropertySnapHeight(
+ StyleResolverState& state,
+ const CSSValue& value) {
+ const CSSValueList& list = toCSSValueList(value);
+ const CSSPrimitiveValue& first = toCSSPrimitiveValue(list.item(0));
+ DCHECK(first.isLength());
+ int unit = first.computeLength<int>(state.cssToLengthConversionData());
+ DCHECK_GE(unit, 0);
+ state.style()->setSnapHeightUnit(clampTo<uint8_t>(unit));
+
+ if (list.length() == 1) {
+ state.style()->setSnapHeightPosition(0);
+ return;
+ }
+
+ DCHECK_EQ(list.length(), 2U);
+ const CSSPrimitiveValue& second = toCSSPrimitiveValue(list.item(1));
+ DCHECK(second.isNumber());
+ int position = second.getIntValue();
+ DCHECK(position > 0 && position <= 100);
+ state.style()->setSnapHeightPosition(position);
}
void StyleBuilderFunctions::applyValueCSSPropertyTextAlign(

Powered by Google App Engine
This is Rietveld 408576698