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

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

Issue 826893003: [CSS Grid Layout] Remove stack from grid-auto-flow syntax (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@remove-stack
Patch Set: Adding perftests Created 5 years, 11 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
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 3775 matching lines...) Expand 10 before | Expand all | Expand 10 after
3786 } 3786 }
3787 3787
3788 if (!rowCount || !columnCount) 3788 if (!rowCount || !columnCount)
3789 return nullptr; 3789 return nullptr;
3790 3790
3791 return CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount) ; 3791 return CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount) ;
3792 } 3792 }
3793 3793
3794 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridAutoFlow(CSSParserV alueList& list) 3794 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridAutoFlow(CSSParserV alueList& list)
3795 { 3795 {
3796 // [ row | column ] && dense? | stack && [ row | column ]? 3796 // [ row | column ] || dense
3797 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 3797 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
3798 3798
3799 CSSParserValue* value = list.current(); 3799 CSSParserValue* value = list.current();
3800 if (!value) 3800 if (!value)
3801 return nullptr; 3801 return nullptr;
3802 3802
3803 RefPtrWillBeRawPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSep arated(); 3803 RefPtrWillBeRawPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSep arated();
3804 3804
3805 // First parameter. 3805 // First parameter.
3806 CSSValueID firstId = value->id; 3806 CSSValueID firstId = value->id;
3807 if (firstId != CSSValueRow && firstId != CSSValueColumn && firstId != CSSVal ueDense && firstId != CSSValueStack) 3807 if (firstId != CSSValueRow && firstId != CSSValueColumn && firstId != CSSVal ueDense)
3808 return nullptr; 3808 return nullptr;
3809 parsedValues->append(cssValuePool().createIdentifierValue(firstId)); 3809 parsedValues->append(cssValuePool().createIdentifierValue(firstId));
3810 3810
3811 // Second parameter, if any. 3811 // Second parameter, if any.
3812 value = list.next(); 3812 value = list.next();
3813 if (!value && firstId == CSSValueDense)
3814 return nullptr;
3815
3816 if (value) { 3813 if (value) {
3817 switch (firstId) { 3814 switch (firstId) {
Julien - ping for review 2015/01/05 13:11:34 We could probably simplify this code now that we b
Manuel Rego 2015/01/08 12:50:28 I don't see very clear how to simplify this code.
Julien - ping for review 2015/01/09 09:13:03 OK!
3818 case CSSValueRow: 3815 case CSSValueRow:
3819 case CSSValueColumn: 3816 case CSSValueColumn:
3820 if (value->id != CSSValueDense && value->id != CSSValueStack) 3817 if (value->id != CSSValueDense)
3821 return parsedValues; 3818 return parsedValues;
3822 break; 3819 break;
3823 case CSSValueDense: 3820 case CSSValueDense:
3824 case CSSValueStack:
3825 if (value->id != CSSValueRow && value->id != CSSValueColumn) 3821 if (value->id != CSSValueRow && value->id != CSSValueColumn)
3826 return parsedValues; 3822 return parsedValues;
3827 break; 3823 break;
3828 default: 3824 default:
3829 return parsedValues; 3825 return parsedValues;
3830 } 3826 }
3831 parsedValues->append(cssValuePool().createIdentifierValue(value->id)); 3827 parsedValues->append(cssValuePool().createIdentifierValue(value->id));
3832 list.next(); 3828 list.next();
3833 } 3829 }
3834 3830
(...skipping 4735 matching lines...) Expand 10 before | Expand all | Expand 10 after
8570 } 8566 }
8571 } 8567 }
8572 8568
8573 if (!list->length()) 8569 if (!list->length())
8574 return nullptr; 8570 return nullptr;
8575 8571
8576 return list.release(); 8572 return list.release();
8577 } 8573 }
8578 8574
8579 } // namespace blink 8575 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698