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

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

Issue 1094003002: CSSStyleDeclaration::setProperty should override important style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review feedback Created 5 years, 8 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 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 "config.h" 5 #include "config.h"
6 #include "core/css/parser/CSSParser.h" 6 #include "core/css/parser/CSSParser.h"
7 7
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/StyleRule.h" 10 #include "core/css/StyleRule.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 BisonCSSParser(context).parseSheet(styleSheet, text, startPosition, observer , logErrors); 57 BisonCSSParser(context).parseSheet(styleSheet, text, startPosition, observer , logErrors);
58 } 58 }
59 59
60 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID u nresolvedProperty, const String& string, bool important, CSSParserMode parserMod e, StyleSheetContents* styleSheet) 60 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID u nresolvedProperty, const String& string, bool important, CSSParserMode parserMod e, StyleSheetContents* styleSheet)
61 { 61 {
62 if (string.isEmpty()) 62 if (string.isEmpty())
63 return false; 63 return false;
64 CSSPropertyID resolvedProperty = resolveCSSPropertyID(unresolvedProperty); 64 CSSPropertyID resolvedProperty = resolveCSSPropertyID(unresolvedProperty);
65 RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(res olvedProperty, string, parserMode); 65 RefPtrWillBeRawPtr<CSSValue> value = CSSParserFastPaths::maybeParseValue(res olvedProperty, string, parserMode);
66 if (value) 66 if (value)
67 return declaration->addParsedProperty(CSSProperty(resolvedProperty, valu e.release(), important)); 67 return declaration->setProperty(CSSProperty(resolvedProperty, value.rele ase(), important));
68 CSSParserContext context(parserMode, 0); 68 CSSParserContext context(parserMode, 0);
69 if (styleSheet) { 69 if (styleSheet) {
70 context = styleSheet->parserContext(); 70 context = styleSheet->parserContext();
71 context.setMode(parserMode); 71 context.setMode(parserMode);
72 } 72 }
73 return parseValue(declaration, unresolvedProperty, string, important, contex t); 73 return parseValue(declaration, unresolvedProperty, string, important, contex t);
74 } 74 }
75 75
76 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID u nresolvedProperty, const String& string, bool important, const CSSParserContext& context) 76 bool CSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID u nresolvedProperty, const String& string, bool important, const CSSParserContext& context)
77 { 77 {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 CSSValueID id = cssValueKeywordID(cssColor); 170 CSSValueID id = cssValueKeywordID(cssColor);
171 if (!CSSPropertyParser::isSystemColor(id)) 171 if (!CSSPropertyParser::isSystemColor(id))
172 return false; 172 return false;
173 173
174 Color parsedColor = LayoutTheme::theme().systemColor(id); 174 Color parsedColor = LayoutTheme::theme().systemColor(id);
175 color = parsedColor.rgb(); 175 color = parsedColor.rgb();
176 return true; 176 return true;
177 } 177 }
178 178
179 } // namespace blink 179 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/StylePropertySet.cpp ('k') | Source/core/css/resolver/ViewportStyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698