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

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

Issue 642303002: Move style building for grid-auto-flow to StyleBuilderConverter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove unreachable code. Created 6 years, 2 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/resolver/StyleBuilderConverter.h ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleBuilderConverter.cpp
diff --git a/Source/core/css/resolver/StyleBuilderConverter.cpp b/Source/core/css/resolver/StyleBuilderConverter.cpp
index a0b7c0ddee2fc658775701d0d9019fa6b02ba19b..6727a79672b74a11823ca0f985bb8e021ce1eb87 100644
--- a/Source/core/css/resolver/StyleBuilderConverter.cpp
+++ b/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -338,6 +338,43 @@ EGlyphOrientation StyleBuilderConverter::convertGlyphOrientation(StyleResolverSt
return GO_270DEG;
}
+GridAutoFlow StyleBuilderConverter::convertGridAutoFlow(StyleResolverState&, CSSValue* value)
+{
+ CSSValueList* list = toCSSValueList(value);
+
+ ASSERT(list->length() >= 1);
+ CSSPrimitiveValue* first = toCSSPrimitiveValue(list->item(0));
+ CSSPrimitiveValue* second = list->length() == 2 ? toCSSPrimitiveValue(list->item(1)) : nullptr;
+
+ switch (first->getValueID()) {
+ case CSSValueRow:
+ if (second) {
+ if (second->getValueID() == CSSValueDense)
+ return AutoFlowRowDense;
+ return AutoFlowStackRow;
+ }
+ return AutoFlowRow;
+ case CSSValueColumn:
+ if (second) {
+ if (second->getValueID() == CSSValueDense)
+ return AutoFlowColumnDense;
+ return AutoFlowStackColumn;
+ }
+ return AutoFlowColumn;
+ case CSSValueDense:
+ if (second && second->getValueID() == CSSValueColumn)
+ return AutoFlowColumnDense;
+ return AutoFlowRowDense;
+ case CSSValueStack:
+ if (second && second->getValueID() == CSSValueColumn)
+ return AutoFlowStackColumn;
+ return AutoFlowStackRow;
+ default:
+ ASSERT_NOT_REACHED();
+ return RenderStyle::initialGridAutoFlow();
+ }
+}
+
GridPosition StyleBuilderConverter::convertGridPosition(StyleResolverState&, CSSValue* value)
{
// We accept the specification's grammar:
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.h ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698