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

Side by Side Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 569563002: [CSSGridLayout] ASSERTION: Bad cast in parseGridTemplateRowsAndAreas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 | « Source/core/css/parser/CSSPropertyParser.h ('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 3340 matching lines...) Expand 10 before | Expand all | Expand 10 after
3351 RefPtrWillBeRawPtr<CSSValue> value = parseGridTrackSize(*m_valueList ); 3351 RefPtrWillBeRawPtr<CSSValue> value = parseGridTrackSize(*m_valueList );
3352 if (!value) 3352 if (!value)
3353 return false; 3353 return false;
3354 templateRows->append(value); 3354 templateRows->append(value);
3355 } else { 3355 } else {
3356 templateRows->append(cssValuePool().createIdentifierValue(CSSValueAu to)); 3356 templateRows->append(cssValuePool().createIdentifierValue(CSSValueAu to));
3357 } 3357 }
3358 3358
3359 // This will handle the trailing/leading <custom-ident>* in the grammar. 3359 // This will handle the trailing/leading <custom-ident>* in the grammar.
3360 trailingIdentWasAdded = false; 3360 trailingIdentWasAdded = false;
3361 if (m_valueList->current() && m_valueList->current()->unit == CSSParserV alue::ValueList) { 3361 if (m_valueList->current() && m_valueList->current()->unit == CSSParserV alue::ValueList)
Julien - ping for review 2014/09/12 14:51:36 Nit: We could even remove this branch together: t
3362 parseGridLineNames(*m_valueList, *templateRows); 3362 trailingIdentWasAdded = parseGridLineNames(*m_valueList, *templateRo ws);
3363 trailingIdentWasAdded = true;
3364 }
3365 } 3363 }
3366 3364
3367 // [<track-list> /]? 3365 // [<track-list> /]?
3368 if (templateColumns) 3366 if (templateColumns)
3369 addProperty(CSSPropertyGridTemplateColumns, templateColumns, important); 3367 addProperty(CSSPropertyGridTemplateColumns, templateColumns, important);
3370 else 3368 else
3371 addProperty(CSSPropertyGridTemplateColumns, cssValuePool().createIdenti fierValue(CSSValueNone), important); 3369 addProperty(CSSPropertyGridTemplateColumns, cssValuePool().createIdenti fierValue(CSSValueNone), important);
3372 3370
3373 // [<line-names>? <string> [<track-size> <line-names>]? ]+ 3371 // [<line-names>? <string> [<track-size> <line-names>]? ]+
3374 RefPtrWillBeRawPtr<CSSValue> templateAreas = CSSGridTemplateAreasValue::crea te(gridAreaMap, rowCount, columnCount); 3372 RefPtrWillBeRawPtr<CSSValue> templateAreas = CSSGridTemplateAreasValue::crea te(gridAreaMap, rowCount, columnCount);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
3542 if (!isForwardSlashOperator(m_valueList->current())) 3540 if (!isForwardSlashOperator(m_valueList->current()))
3543 return false; 3541 return false;
3544 3542
3545 if (!m_valueList->next()) 3543 if (!m_valueList->next())
3546 return false; 3544 return false;
3547 3545
3548 property = parseGridPosition(); 3546 property = parseGridPosition();
3549 return true; 3547 return true;
3550 } 3548 }
3551 3549
3552 void CSSPropertyParser::parseGridLineNames(CSSParserValueList& inputList, CSSVal ueList& valueList, CSSGridLineNamesValue* previousNamedAreaTrailingLineNames) 3550 bool CSSPropertyParser::parseGridLineNames(CSSParserValueList& inputList, CSSVal ueList& valueList, CSSGridLineNamesValue* previousNamedAreaTrailingLineNames)
3553 { 3551 {
3554 ASSERT(inputList.current() && inputList.current()->unit == CSSParserValue::V alueList); 3552 ASSERT(inputList.current() && inputList.current()->unit == CSSParserValue::V alueList);
3555 3553
3556 CSSParserValueList* identList = inputList.current()->valueList; 3554 CSSParserValueList* identList = inputList.current()->valueList;
3557 if (!identList->size()) { 3555 if (!identList->size()) {
3558 inputList.next(); 3556 inputList.next();
3559 return; 3557 return false;
3560 } 3558 }
3561 3559
3562 // Need to ensure the identList is at the heading index, since the parserLis t might have been rewound. 3560 // Need to ensure the identList is at the heading index, since the parserLis t might have been rewound.
3563 identList->setCurrentIndex(0); 3561 identList->setCurrentIndex(0);
3564 3562
3565 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = previousNamedAreaTrail ingLineNames; 3563 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = previousNamedAreaTrail ingLineNames;
3566 if (!lineNames) 3564 if (!lineNames)
3567 lineNames = CSSGridLineNamesValue::create(); 3565 lineNames = CSSGridLineNamesValue::create();
3568 while (CSSParserValue* identValue = identList->current()) { 3566 while (CSSParserValue* identValue = identList->current()) {
3569 ASSERT(identValue->unit == CSSPrimitiveValue::CSS_IDENT); 3567 ASSERT(identValue->unit == CSSPrimitiveValue::CSS_IDENT);
3570 RefPtrWillBeRawPtr<CSSPrimitiveValue> lineName = createPrimitiveStringVa lue(identValue); 3568 RefPtrWillBeRawPtr<CSSPrimitiveValue> lineName = createPrimitiveStringVa lue(identValue);
3571 lineNames->append(lineName.release()); 3569 lineNames->append(lineName.release());
3572 identList->next(); 3570 identList->next();
3573 } 3571 }
3574 if (!previousNamedAreaTrailingLineNames) 3572 if (!previousNamedAreaTrailingLineNames)
3575 valueList.append(lineNames.release()); 3573 valueList.append(lineNames.release());
3576 3574
3577 inputList.next(); 3575 inputList.next();
3576 return true;
3578 } 3577 }
3579 3578
3580 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackList() 3579 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackList()
3581 { 3580 {
3582 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 3581 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
3583 3582
3584 CSSParserValue* value = m_valueList->current(); 3583 CSSParserValue* value = m_valueList->current();
3585 if (value->id == CSSValueNone) { 3584 if (value->id == CSSValueNone) {
3586 m_valueList->next(); 3585 m_valueList->next();
3587 return cssValuePool().createIdentifierValue(CSSValueNone); 3586 return cssValuePool().createIdentifierValue(CSSValueNone);
(...skipping 4608 matching lines...) Expand 10 before | Expand all | Expand 10 after
8196 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); 8195 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill));
8197 if (!seenStroke) 8196 if (!seenStroke)
8198 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke) ); 8197 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke) );
8199 if (!seenMarkers) 8198 if (!seenMarkers)
8200 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers )); 8199 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers ));
8201 8200
8202 return parsedValues.release(); 8201 return parsedValues.release();
8203 } 8202 }
8204 8203
8205 } // namespace blink 8204 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698