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

Unified Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 1160273004: [CSS Grid Layout] Support dots sequences in grid-template-areas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
Index: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 4158e67cdb5ee513c33fafc6c0a2d5a04107d372..fd950743a6f3596f7f2396bc48f457585ddef978 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -3639,6 +3639,16 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseGridBreadth(CS
return createPrimitiveNumericValue(currentValue);
}
+static bool containsOnlyDots(const String& string)
+{
+ ASSERT(!string.isEmpty());
+ for (unsigned i = 0; i < string.length(); ++i) {
+ if (string.characterAt(i) != '.')
+ return false;
+ }
+ return true;
svillar 2015/06/05 10:38:09 I think it's better to do like LayoutText::contain
Manuel Rego 2015/06/05 11:20:10 Thanks for the pointer, I've followed a similar ap
+}
+
bool CSSPropertyParser::parseGridTemplateAreasRow(NamedGridAreaMap& gridAreaMap, const size_t rowCount, size_t& columnCount)
{
CSSParserValue* currentValue = m_valueList->current();
@@ -3664,7 +3674,7 @@ bool CSSPropertyParser::parseGridTemplateAreasRow(NamedGridAreaMap& gridAreaMap,
const String& gridAreaName = columnNames[currentCol];
// Unamed areas are always valid (we consider them to be 1x1).
- if (gridAreaName == ".")
+ if (containsOnlyDots(gridAreaName))
continue;
// We handle several grid areas with the same name at once to simplify the validation code.

Powered by Google App Engine
This is Rietveld 408576698