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

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

Issue 1145383003: strict WIP Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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
« no previous file with comments | « no previous file | 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 return false; 138 return false;
139 139
140 // The regular color parsers don't resolve named colors, so explicitly 140 // The regular color parsers don't resolve named colors, so explicitly
141 // handle these first. 141 // handle these first.
142 Color namedColor; 142 Color namedColor;
143 if (namedColor.setNamedColor(string)) { 143 if (namedColor.setNamedColor(string)) {
144 color = namedColor; 144 color = namedColor;
145 return true; 145 return true;
146 } 146 }
147 147
148 RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::parseColor(string, strict ? HTMLStandardMode : HTMLQuirksMode); 148 CSSParserContext context(strict ? HTMLStandardMode : HTMLQuirksMode, 0);
149 // TODO(timloh): Why is this always strict mode? 149 RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::parseColor(string, context.mode());
150 if (!value) 150 if (!value)
151 value = parseSingleValue(CSSPropertyColor, string, strictCSSParserContex t()); 151 value = parseSingleValue(CSSPropertyColor, string, context);
152 152
153 if (!value || !value->isColorValue()) 153 if (!value || !value->isColorValue())
154 return false; 154 return false;
155 color = toCSSColorValue(*value).value(); 155 color = toCSSColorValue(*value).value();
156 return true; 156 return true;
157 } 157 }
158 158
159 bool CSSParser::parseSystemColor(Color& color, const String& colorString) 159 bool CSSParser::parseSystemColor(Color& color, const String& colorString)
160 { 160 {
161 CSSParserString cssColor; 161 CSSParserString cssColor;
(...skipping 14 matching lines...) Expand all
176 builder.appendLiteral(" : "); 176 builder.appendLiteral(" : ");
177 builder.append(propertyValue); 177 builder.append(propertyValue);
178 builder.appendLiteral("; }"); 178 builder.appendLiteral("; }");
179 RefPtrWillBeRawPtr<StyleRuleBase> rule = parseRule(context, nullptr, builder .toString()); 179 RefPtrWillBeRawPtr<StyleRuleBase> rule = parseRule(context, nullptr, builder .toString());
180 if (!rule || !rule->isFontFaceRule()) 180 if (!rule || !rule->isFontFaceRule())
181 return nullptr; 181 return nullptr;
182 return toStyleRuleFontFace(rule.get())->properties().getPropertyCSSValue(pro pertyID); 182 return toStyleRuleFontFace(rule.get())->properties().getPropertyCSSValue(pro pertyID);
183 } 183 }
184 184
185 } // namespace blink 185 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698