Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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; | 308 bool changed = false; |
| 309 m_propertyVector.reserveCapacity(m_propertyVector.size() + properties.size() ); | 309 m_propertyVector.reserveCapacity(m_propertyVector.size() + properties.size() ); |
| 310 for (unsigned i = 0; i < properties.size(); ++i) | 310 for (unsigned i = 0; i < properties.size(); ++i) |
| 311 changed |= addParsedProperty(properties[i]); | 311 changed |= addParsedProperty(properties[i]); |
| 312 return changed; | 312 return changed; |
| 313 } | 313 } |
| 314 | 314 |
| 315 bool MutableStylePropertySet::addParsedProperty(const CSSProperty& property) | 315 bool MutableStylePropertySet::addParsedProperty(const CSSProperty& property) |
|
Timothy Loh
2015/04/24 00:35:05
Other functions call this and expect it to do what
| |
| 316 { | 316 { |
| 317 // Only add properties that have no !important counterpart present | 317 return setProperty(property); |
| 318 if (!propertyIsImportant(property.id()) || property.isImportant()) | |
| 319 return setProperty(property); | |
| 320 return false; | |
| 321 } | 318 } |
| 322 | 319 |
| 323 String StylePropertySet::asText() const | 320 String StylePropertySet::asText() const |
| 324 { | 321 { |
| 325 return StylePropertySerializer(*this).asText(); | 322 return StylePropertySerializer(*this).asText(); |
| 326 } | 323 } |
| 327 | 324 |
| 328 void MutableStylePropertySet::mergeAndOverrideOnConflict(const StylePropertySet* other) | 325 void MutableStylePropertySet::mergeAndOverrideOnConflict(const StylePropertySet* other) |
| 329 { | 326 { |
| 330 unsigned size = other->propertyCount(); | 327 unsigned size = other->propertyCount(); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 566 result.appendLiteral(": "); | 563 result.appendLiteral(": "); |
| 567 result.append(propertyValue()->cssText()); | 564 result.append(propertyValue()->cssText()); |
| 568 if (isImportant()) | 565 if (isImportant()) |
| 569 result.appendLiteral(" !important"); | 566 result.appendLiteral(" !important"); |
| 570 result.append(';'); | 567 result.append(';'); |
| 571 return result.toString(); | 568 return result.toString(); |
| 572 } | 569 } |
| 573 | 570 |
| 574 | 571 |
| 575 } // namespace blink | 572 } // namespace blink |
| OLD | NEW |