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

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

Issue 2378113005: Change isCSSWideKeyword() to take a StringView instead of a CSSValueID (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 StringBuilder builder; 633 StringBuilder builder;
634 bool addedSpace = false; 634 bool addedSpace = false;
635 const CSSParserToken& firstToken = range.peek(); 635 const CSSParserToken& firstToken = range.peek();
636 while (range.peek().type() == IdentToken) { 636 while (range.peek().type() == IdentToken) {
637 if (!builder.isEmpty()) { 637 if (!builder.isEmpty()) {
638 builder.append(' '); 638 builder.append(' ');
639 addedSpace = true; 639 addedSpace = true;
640 } 640 }
641 builder.append(range.consumeIncludingWhitespace().value()); 641 builder.append(range.consumeIncludingWhitespace().value());
642 } 642 }
643 if (!addedSpace && isCSSWideKeyword(firstToken.id())) 643 if (!addedSpace && isCSSWideKeyword(firstToken.value()))
644 return String(); 644 return String();
645 return builder.toString(); 645 return builder.toString();
646 } 646 }
647 647
648 static CSSValue* consumeFamilyName(CSSParserTokenRange& range) 648 static CSSValue* consumeFamilyName(CSSParserTokenRange& range)
649 { 649 {
650 if (range.peek().type() == StringToken) 650 if (range.peek().type() == StringToken)
651 return CSSFontFamilyValue::create(range.consumeIncludingWhitespace().val ue().toString()); 651 return CSSFontFamilyValue::create(range.consumeIncludingWhitespace().val ue().toString());
652 if (range.peek().type() != IdentToken) 652 if (range.peek().type() != IdentToken)
653 return nullptr; 653 return nullptr;
(...skipping 4124 matching lines...) Expand 10 before | Expand all | Expand 10 after
4778 case CSSPropertyGridTemplate: 4778 case CSSPropertyGridTemplate:
4779 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); 4779 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important);
4780 case CSSPropertyGrid: 4780 case CSSPropertyGrid:
4781 return consumeGridShorthand(important); 4781 return consumeGridShorthand(important);
4782 default: 4782 default:
4783 return false; 4783 return false;
4784 } 4784 }
4785 } 4785 }
4786 4786
4787 } // namespace blink 4787 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698