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

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

Issue 2040853002: Changed CSSParser::parseFontFaceDescriptor to return a const CSSValue* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_fix_copy_locs
Patch Set: Rebase Created 4 years, 6 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 | « third_party/WebKit/Source/core/css/parser/CSSParser.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/CSSParser.h" 5 #include "core/css/parser/CSSParser.h"
6 6
7 #include "core/css/CSSColorValue.h" 7 #include "core/css/CSSColorValue.h"
8 #include "core/css/CSSKeyframeRule.h" 8 #include "core/css/CSSKeyframeRule.h"
9 #include "core/css/StyleColor.h" 9 #include "core/css/StyleColor.h"
10 #include "core/css/StylePropertySet.h" 10 #include "core/css/StylePropertySet.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 bool CSSParser::parseSystemColor(Color& color, const String& colorString) 159 bool CSSParser::parseSystemColor(Color& color, const String& colorString)
160 { 160 {
161 CSSValueID id = cssValueKeywordID(colorString); 161 CSSValueID id = cssValueKeywordID(colorString);
162 if (!CSSPropertyParser::isSystemColor(id)) 162 if (!CSSPropertyParser::isSystemColor(id))
163 return false; 163 return false;
164 164
165 color = LayoutTheme::theme().systemColor(id); 165 color = LayoutTheme::theme().systemColor(id);
166 return true; 166 return true;
167 } 167 }
168 168
169 CSSValue* CSSParser::parseFontFaceDescriptor(CSSPropertyID propertyID, const Str ing& propertyValue, const CSSParserContext& context) 169 const CSSValue* CSSParser::parseFontFaceDescriptor(CSSPropertyID propertyID, con st String& propertyValue, const CSSParserContext& context)
170 { 170 {
171 StringBuilder builder; 171 StringBuilder builder;
172 builder.append("@font-face { "); 172 builder.append("@font-face { ");
173 builder.append(getPropertyNameString(propertyID)); 173 builder.append(getPropertyNameString(propertyID));
174 builder.append(" : "); 174 builder.append(" : ");
175 builder.append(propertyValue); 175 builder.append(propertyValue);
176 builder.append("; }"); 176 builder.append("; }");
177 StyleRuleBase* rule = parseRule(context, nullptr, builder.toString()); 177 StyleRuleBase* rule = parseRule(context, nullptr, builder.toString());
178 if (!rule || !rule->isFontFaceRule()) 178 if (!rule || !rule->isFontFaceRule())
179 return nullptr; 179 return nullptr;
180 return toStyleRuleFontFace(rule)->properties().getPropertyCSSValue(propertyI D); 180 return toStyleRuleFontFace(rule)->properties().getPropertyCSSValue(propertyI D);
181 } 181 }
182 182
183 } // namespace blink 183 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698