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

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

Issue 333563003: [CSS Grid Layout] Update grid-auto-flow to the new syntax (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Attempt 2 to fix win_blink_rel Created 6 years, 6 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 | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/rendering/RenderGrid.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleBuilderCustom.cpp
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index dab8db7c24c2110f0036006daf0946622ffc668e..264bdd4d282bdebad5307b13774d698cd8408392 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -1400,4 +1400,60 @@ void StyleBuilderFunctions::applyValueCSSPropertyBaselineShift(StyleResolverStat
}
}
+void StyleBuilderFunctions::applyValueCSSPropertyGridAutoFlow(StyleResolverState& state, CSSValue* value)
+{
+ ASSERT(value->isValueList());
+ CSSValueList* list = toCSSValueList(value);
+
+ CSSPrimitiveValue* first = list->length() >= 1 ? toCSSPrimitiveValue(list->item(0)) : nullptr;
+
+ if (!first) {
+ applyInitialCSSPropertyGridAutoFlow(state);
+ return;
+ }
+
+ CSSPrimitiveValue* second = list->length() == 2 ? toCSSPrimitiveValue(list->item(1)) : nullptr;
+
+ GridAutoFlow autoFlow = RenderStyle::initialGridAutoFlow();
+ switch (first->getValueID()) {
+ case CSSValueRow:
+ if (second) {
+ if (second->getValueID() == CSSValueDense)
+ autoFlow = AutoFlowRowDense;
+ else
+ autoFlow = AutoFlowStackRow;
+ } else {
+ autoFlow = AutoFlowRow;
+ }
+ break;
+ case CSSValueColumn:
+ if (second) {
+ if (second->getValueID() == CSSValueDense)
+ autoFlow = AutoFlowColumnDense;
+ else
+ autoFlow = AutoFlowStackColumn;
+ } else {
+ autoFlow = AutoFlowColumn;
+ }
+ break;
+ case CSSValueDense:
+ if (second && second->getValueID() == CSSValueColumn)
+ autoFlow = AutoFlowColumnDense;
+ else
+ autoFlow = AutoFlowRowDense;
+ break;
+ case CSSValueStack:
+ if (second && second->getValueID() == CSSValueColumn)
+ autoFlow = AutoFlowStackColumn;
+ else
+ autoFlow = AutoFlowStackRow;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+
+ state.style()->setGridAutoFlow(autoFlow);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/rendering/RenderGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698