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

Unified Diff: Source/core/css/PropertySetCSSStyleDeclaration.cpp

Issue 141243006: Make element.style.setProperty override earlier property values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Set correct parser mode Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSStyleDeclaration.idl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/PropertySetCSSStyleDeclaration.cpp
diff --git a/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
index 064e654dec9281772133327c1fe0ae7a2b13c631..7a7fea493afd612aab544ddb0095c75023cd1e94 100644
--- a/Source/core/css/PropertySetCSSStyleDeclaration.cpp
+++ b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
@@ -215,11 +215,21 @@ void AbstractPropertySetCSSStyleDeclaration::setProperty(const String& propertyN
if (!propertyID)
return;
- bool important = priority.find("important", 0, false) != kNotFound;
+ bool important = equalIgnoringCase(priority, "important");
+ if (!important && !priority.isEmpty())
+ return;
esprehn 2014/02/25 19:20:39 Can you make this change separately?
willMutate();
- bool changed = propertySet()->setProperty(propertyID, value, important, contextStyleSheet());
+ bool changed;
+
+ if (priority.isNull()) {
+ RefPtr<MutableStylePropertySet> tempPropertySet = MutableStylePropertySet::create(propertySet()->cssParserMode());
+ changed = tempPropertySet->setProperty(propertyID, value, important, contextStyleSheet());
+ propertySet()->mergeAndOverrideOnConflict(tempPropertySet.get());
esprehn 2014/02/25 19:20:39 This doesn't seem like the right way to fix this.
+ } else {
+ changed = propertySet()->setProperty(propertyID, value, important, contextStyleSheet());
+ }
didMutate(changed ? PropertyChanged : NoChanges);
« no previous file with comments | « Source/core/css/CSSStyleDeclaration.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698