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

Side by Side Diff: Source/core/css/StylePropertySet.cpp

Issue 1094003002: CSSStyleDeclaration::setProperty should override important style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed addParsedProperty to addRespectingCascade 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 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * Copyright (C) 2013 Intel Corporation. All rights reserved. 5 * Copyright (C) 2013 Intel Corporation. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 if (contextStyleSheet) { 298 if (contextStyleSheet) {
299 context = contextStyleSheet->parserContext(); 299 context = contextStyleSheet->parserContext();
300 context.setMode(cssParserMode()); 300 context.setMode(cssParserMode());
301 } 301 }
302 302
303 CSSParser::parseDeclarationList(context, this, styleDeclaration, 0, contextS tyleSheet); 303 CSSParser::parseDeclarationList(context, this, styleDeclaration, 0, contextS tyleSheet);
304 } 304 }
305 305
306 bool MutableStylePropertySet::addParsedProperties(const WillBeHeapVector<CSSProp erty, 256>& properties) 306 bool MutableStylePropertySet::addParsedProperties(const WillBeHeapVector<CSSProp erty, 256>& properties)
307 { 307 {
308 bool changed = false;
Timothy Loh 2015/04/24 09:21:27 Why did we get rid of this?
sashab 2015/04/26 23:23:41 Sorry, I made a mistake. I thought this setPropert
309 m_propertyVector.reserveCapacity(m_propertyVector.size() + properties.size() ); 308 m_propertyVector.reserveCapacity(m_propertyVector.size() + properties.size() );
310 for (unsigned i = 0; i < properties.size(); ++i) 309 for (unsigned i = 0; i < properties.size(); ++i)
311 changed |= addParsedProperty(properties[i]); 310 setProperty(properties[i]);
312 return changed; 311 return true;
313 } 312 }
314 313
315 bool MutableStylePropertySet::addParsedProperty(const CSSProperty& property) 314 bool MutableStylePropertySet::addRespectingCascade(const CSSProperty& property)
316 { 315 {
317 // Only add properties that have no !important counterpart present 316 // Only add properties that have no !important counterpart present
318 if (!propertyIsImportant(property.id()) || property.isImportant()) 317 if (!propertyIsImportant(property.id()) || property.isImportant())
319 return setProperty(property); 318 return setProperty(property);
320 return false; 319 return false;
321 } 320 }
322 321
323 String StylePropertySet::asText() const 322 String StylePropertySet::asText() const
324 { 323 {
325 return StylePropertySerializer(*this).asText(); 324 return StylePropertySerializer(*this).asText();
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 result.appendLiteral(": "); 565 result.appendLiteral(": ");
567 result.append(propertyValue()->cssText()); 566 result.append(propertyValue()->cssText());
568 if (isImportant()) 567 if (isImportant())
569 result.appendLiteral(" !important"); 568 result.appendLiteral(" !important");
570 result.append(';'); 569 result.append(';');
571 return result.toString(); 570 return result.toString();
572 } 571 }
573 572
574 573
575 } // namespace blink 574 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698