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

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

Issue 1808753002: Make consumeCustomIdent exclude css wide keywords (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add subtests Created 4 years, 9 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/parser/CSSPropertyParser.h" 5 #include "core/css/parser/CSSPropertyParser.h"
6 6
7 #include "core/StylePropertyShorthand.h" 7 #include "core/StylePropertyShorthand.h"
8 #include "core/css/CSSBasicShapeValues.h" 8 #include "core/css/CSSBasicShapeValues.h"
9 #include "core/css/CSSBorderImage.h" 9 #include "core/css/CSSBorderImage.h"
10 #include "core/css/CSSContentDistributionValue.h" 10 #include "core/css/CSSContentDistributionValue.h"
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 list->append(resultY.release()); 557 list->append(resultY.release());
558 RefPtrWillBeRawPtr<CSSValue> resultZ = consumeLength(range, cssParserMod e, ValueRangeAll); 558 RefPtrWillBeRawPtr<CSSValue> resultZ = consumeLength(range, cssParserMod e, ValueRangeAll);
559 if (!resultZ) 559 if (!resultZ)
560 resultZ = cssValuePool().createValue(0, CSSPrimitiveValue::UnitType: :Pixels); 560 resultZ = cssValuePool().createValue(0, CSSPrimitiveValue::UnitType: :Pixels);
561 list->append(resultZ.release()); 561 list->append(resultZ.release());
562 return list.release(); 562 return list.release();
563 } 563 }
564 return nullptr; 564 return nullptr;
565 } 565 }
566 566
567 static inline bool isCSSWideKeyword(const CSSValueID& id)
568 {
569 return id == CSSValueInitial || id == CSSValueInherit || id == CSSValueUnset || id == CSSValueDefault;
570 }
571
572 // Methods for consuming non-shorthand properties starts here. 567 // Methods for consuming non-shorthand properties starts here.
573 static PassRefPtrWillBeRawPtr<CSSValue> consumeWillChange(CSSParserTokenRange& r ange) 568 static PassRefPtrWillBeRawPtr<CSSValue> consumeWillChange(CSSParserTokenRange& r ange)
574 { 569 {
575 if (range.peek().id() == CSSValueAuto) 570 if (range.peek().id() == CSSValueAuto)
576 return consumeIdent(range); 571 return consumeIdent(range);
577 572
578 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated (); 573 RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createCommaSeparated ();
579 // Every comma-separated list of identifiers is a valid will-change value, 574 // Every comma-separated list of identifiers is a valid will-change value,
580 // unless the list includes an explicitly disallowed identifier. 575 // unless the list includes an explicitly disallowed identifier.
581 while (true) { 576 while (true) {
(...skipping 3999 matching lines...) Expand 10 before | Expand all | Expand 10 after
4581 m_currentShorthand = oldShorthand; 4576 m_currentShorthand = oldShorthand;
4582 CSSParserValueList valueList(m_range); 4577 CSSParserValueList valueList(m_range);
4583 if (!valueList.size()) 4578 if (!valueList.size())
4584 return false; 4579 return false;
4585 m_valueList = &valueList; 4580 m_valueList = &valueList;
4586 return legacyParseShorthand(unresolvedProperty, important); 4581 return legacyParseShorthand(unresolvedProperty, important);
4587 } 4582 }
4588 } 4583 }
4589 4584
4590 } // namespace blink 4585 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698