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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp

Issue 1712503002: [css-grid] Rows track sizes are optional in grid-template shorthand (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased patch Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 // Handle leading <custom-ident>*. 1473 // Handle leading <custom-ident>*.
1474 if (!parseGridLineNames(*m_valueList, *templateRows, trailingIdentWasAdd ed ? toCSSGridLineNamesValue(templateRows->item(templateRows->length() - 1)) : n ullptr)) 1474 if (!parseGridLineNames(*m_valueList, *templateRows, trailingIdentWasAdd ed ? toCSSGridLineNamesValue(templateRows->item(templateRows->length() - 1)) : n ullptr))
1475 return false; 1475 return false;
1476 1476
1477 // Handle a template-area's row. 1477 // Handle a template-area's row.
1478 if (!parseGridTemplateAreasRow(gridAreaMap, rowCount, columnCount)) 1478 if (!parseGridTemplateAreasRow(gridAreaMap, rowCount, columnCount))
1479 return false; 1479 return false;
1480 ++rowCount; 1480 ++rowCount;
1481 1481
1482 // Handle template-rows's track-size. 1482 // Handle template-rows's track-size.
1483 if (m_valueList->current() && !isForwardSlashOperator(m_valueList->curre nt()) && m_valueList->current()->m_unit != CSSParserValue::String) { 1483 if (m_valueList->current() && !isForwardSlashOperator(m_valueList->curre nt()) && m_valueList->current()->m_unit != CSSParserValue::String && m_valueList ->current()->m_unit != CSSParserValue::Operator) {
svillar 2016/02/19 11:48:44 As you told me in private, != Operator includes !i
Manuel Rego 2016/02/19 12:24:36 Done.
1484 RefPtrWillBeRawPtr<CSSValue> value = parseGridTrackSize(*m_valueList ); 1484 RefPtrWillBeRawPtr<CSSValue> value = parseGridTrackSize(*m_valueList );
1485 if (!value) 1485 if (!value)
1486 return false; 1486 return false;
1487 templateRows->append(value); 1487 templateRows->append(value);
1488 } else { 1488 } else {
1489 templateRows->append(cssValuePool().createIdentifierValue(CSSValueAu to)); 1489 templateRows->append(cssValuePool().createIdentifierValue(CSSValueAu to));
1490 } 1490 }
1491 1491
1492 // This will handle the trailing/leading <custom-ident>* in the grammar. 1492 // This will handle the trailing/leading <custom-ident>* in the grammar.
1493 if (!parseGridLineNames(*m_valueList, *templateRows)) 1493 if (!parseGridLineNames(*m_valueList, *templateRows))
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 RefPtrWillBeRawPtr<CSSValue> columnsValue = parseGridTemplateColumns(imp ortant); 1549 RefPtrWillBeRawPtr<CSSValue> columnsValue = parseGridTemplateColumns(imp ortant);
1550 if (!columnsValue) 1550 if (!columnsValue)
1551 return false; 1551 return false;
1552 1552
1553 addProperty(CSSPropertyGridTemplateRows, rowsValue.release(), important) ; 1553 addProperty(CSSPropertyGridTemplateRows, rowsValue.release(), important) ;
1554 addProperty(CSSPropertyGridTemplateColumns, columnsValue.release(), impo rtant); 1554 addProperty(CSSPropertyGridTemplateColumns, columnsValue.release(), impo rtant);
1555 addProperty(CSSPropertyGridTemplateAreas, cssValuePool().createIdentifie rValue(CSSValueNone), important); 1555 addProperty(CSSPropertyGridTemplateAreas, cssValuePool().createIdentifie rValue(CSSValueNone), important);
1556 return true; 1556 return true;
1557 } 1557 }
1558 1558
1559 // 3- [<line-names>? <string> [<track-size> <line-names>]? ]+ syntax. 1559 // 3- [<line-names>? <string> <track-size>? <line-names>? ]+ syntax.
1560 // It requires to rewind parsing due to previous syntax failures. 1560 // It requires to rewind parsing due to previous syntax failures.
1561 m_valueList->setCurrentIndex(0); 1561 m_valueList->setCurrentIndex(0);
1562 return parseGridTemplateRowsAndAreasAndColumns(important); 1562 return parseGridTemplateRowsAndAreasAndColumns(important);
1563 } 1563 }
1564 1564
1565 bool CSSPropertyParser::parseGridShorthand(bool important) 1565 bool CSSPropertyParser::parseGridShorthand(bool important)
1566 { 1566 {
1567 ShorthandScope scope(this, CSSPropertyGrid); 1567 ShorthandScope scope(this, CSSPropertyGrid);
1568 ASSERT(shorthandForProperty(CSSPropertyGrid).length() == 8); 1568 ASSERT(shorthandForProperty(CSSPropertyGrid).length() == 8);
1569 1569
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
3158 ASSERT(!m_parsedCalculation); 3158 ASSERT(!m_parsedCalculation);
3159 m_parsedCalculation = CSSCalcValue::create(args, range); 3159 m_parsedCalculation = CSSCalcValue::create(args, range);
3160 3160
3161 if (!m_parsedCalculation) 3161 if (!m_parsedCalculation)
3162 return false; 3162 return false;
3163 3163
3164 return true; 3164 return true;
3165 } 3165 }
3166 3166
3167 } // namespace blink 3167 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698