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

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

Issue 2566403003: Migrate WTF::Vector::append() to ::push_back() [part 3 of N] (Closed)
Patch Set: Created 4 years 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/CSSSyntaxDescriptor.h" 5 #include "core/css/CSSSyntaxDescriptor.h"
6 6
7 #include "core/css/CSSCustomPropertyDeclaration.h" 7 #include "core/css/CSSCustomPropertyDeclaration.h"
8 #include "core/css/CSSURIValue.h" 8 #include "core/css/CSSURIValue.h"
9 #include "core/css/CSSValueList.h" 9 #include "core/css/CSSValueList.h"
10 #include "core/css/CSSVariableReferenceValue.h" 10 #include "core/css/CSSVariableReferenceValue.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 return !CSSPropertyParserHelpers::isCSSWideKeyword(ident); 89 return !CSSPropertyParserHelpers::isCSSWideKeyword(ident);
90 } 90 }
91 91
92 CSSSyntaxDescriptor::CSSSyntaxDescriptor(String input) { 92 CSSSyntaxDescriptor::CSSSyntaxDescriptor(String input) {
93 size_t offset = 0; 93 size_t offset = 0;
94 consumeWhitespace(input, offset); 94 consumeWhitespace(input, offset);
95 95
96 if (consumeCharacterAndWhitespace(input, '*', offset)) { 96 if (consumeCharacterAndWhitespace(input, '*', offset)) {
97 if (offset != input.length()) 97 if (offset != input.length())
98 return; 98 return;
99 m_syntaxComponents.append( 99 m_syntaxComponents.push_back(
100 CSSSyntaxComponent(CSSSyntaxType::TokenStream, emptyString(), false)); 100 CSSSyntaxComponent(CSSSyntaxType::TokenStream, emptyString(), false));
101 return; 101 return;
102 } 102 }
103 103
104 do { 104 do {
105 CSSSyntaxType type; 105 CSSSyntaxType type;
106 String ident; 106 String ident;
107 bool success; 107 bool success;
108 108
109 if (input[offset] == '<') { 109 if (input[offset] == '<') {
110 success = consumeSyntaxType(input, offset, type); 110 success = consumeSyntaxType(input, offset, type);
111 } else { 111 } else {
112 type = CSSSyntaxType::Ident; 112 type = CSSSyntaxType::Ident;
113 success = consumeSyntaxIdent(input, offset, ident); 113 success = consumeSyntaxIdent(input, offset, ident);
114 } 114 }
115 115
116 if (!success) { 116 if (!success) {
117 m_syntaxComponents.clear(); 117 m_syntaxComponents.clear();
118 return; 118 return;
119 } 119 }
120 120
121 bool repeatable = consumeCharacterAndWhitespace(input, '+', offset); 121 bool repeatable = consumeCharacterAndWhitespace(input, '+', offset);
122 consumeWhitespace(input, offset); 122 consumeWhitespace(input, offset);
123 m_syntaxComponents.append(CSSSyntaxComponent(type, ident, repeatable)); 123 m_syntaxComponents.push_back(CSSSyntaxComponent(type, ident, repeatable));
124 124
125 } while (consumeCharacterAndWhitespace(input, '|', offset)); 125 } while (consumeCharacterAndWhitespace(input, '|', offset));
126 126
127 if (offset != input.length()) 127 if (offset != input.length())
128 m_syntaxComponents.clear(); 128 m_syntaxComponents.clear();
129 } 129 }
130 130
131 const CSSValue* consumeSingleType(const CSSSyntaxComponent& syntax, 131 const CSSValue* consumeSingleType(const CSSSyntaxComponent& syntax,
132 CSSParserTokenRange& range) { 132 CSSParserTokenRange& range) {
133 using namespace CSSPropertyParserHelpers; 133 using namespace CSSPropertyParserHelpers;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 range.consumeWhitespace(); 203 range.consumeWhitespace();
204 for (const CSSSyntaxComponent& component : m_syntaxComponents) { 204 for (const CSSSyntaxComponent& component : m_syntaxComponents) {
205 if (const CSSValue* result = consumeSyntaxComponent(component, range)) 205 if (const CSSValue* result = consumeSyntaxComponent(component, range))
206 return result; 206 return result;
207 } 207 }
208 return CSSVariableParser::parseRegisteredPropertyValue(range, true, 208 return CSSVariableParser::parseRegisteredPropertyValue(range, true,
209 isAnimationTainted); 209 isAnimationTainted);
210 } 210 }
211 211
212 } // namespace blink 212 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp ('k') | third_party/WebKit/Source/core/css/CSSValueList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698