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

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

Issue 22215002: Allow grid positions to be named grid areas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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/CSSParser-in.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 37d1e3af6579d6a7f38a48a2155f1aba9b048277..e9b9c658bd0b43098b9d56e8dea3a3f5316726d6 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -945,10 +945,18 @@ static bool createGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSiz
static bool createGridPosition(CSSValue* value, GridPosition& position)
{
- // For now, we only accept: 'auto' | [ <integer> || <string> ] | span && <integer>?
+ // We accept the specification's grammar:
+ // 'auto' | [ <integer> || <string> ] | [ span && [ <integer> || string ] ] | <ident>
if (value->isPrimitiveValue()) {
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+ // We translate <ident> to <string> during parsing as it
+ // makes handling it more simple.
+ if (primitiveValue->isString()) {
+ position.setNamedGridArea(primitiveValue->getStringValue());
+ return true;
+ }
+
ASSERT(primitiveValue->getValueID() == CSSValueAuto);
return true;
}
« no previous file with comments | « Source/core/css/CSSParser-in.cpp ('k') | Source/core/rendering/RenderGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698