diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-03-12 14:11:15 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-03-12 14:11:15 +0100 |
commit | dd91e772430dc294e3bf478c119ef8d43c0a3358 (patch) | |
tree | 6f33ce4d5872a5691e0291eb45bf6ab373a5f567 /Source/WebCore/css/StylePropertySet.cpp | |
parent | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (diff) | |
download | qtwebkit-dd91e772430dc294e3bf478c119ef8d43c0a3358.tar.gz |
Imported WebKit commit 3db4eb1820ac8fb03065d7ea73a4d9db1e8fea1a (http://svn.webkit.org/repository/webkit/trunk@110422)
This includes build fixes for the latest qtbase/qtdeclarative as well as the final QML2 API.
Diffstat (limited to 'Source/WebCore/css/StylePropertySet.cpp')
-rw-r--r-- | Source/WebCore/css/StylePropertySet.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Source/WebCore/css/StylePropertySet.cpp b/Source/WebCore/css/StylePropertySet.cpp index e8d97cacc..65452ec3b 100644 --- a/Source/WebCore/css/StylePropertySet.cpp +++ b/Source/WebCore/css/StylePropertySet.cpp @@ -57,26 +57,27 @@ StylePropertySet::StylePropertySet(const Vector<CSSProperty>& properties) m_properties.shrinkToFit(); } -StylePropertySet::StylePropertySet(const CSSProperty* const * properties, int numProperties, bool useStrictParsing) +StylePropertySet::StylePropertySet(const CSSProperty* properties, int numProperties, bool useStrictParsing) : m_strictParsing(useStrictParsing) , m_hasCSSOMWrapper(false) { + // FIXME: This logic belongs in CSSParser. + m_properties.reserveInitialCapacity(numProperties); HashMap<int, bool> candidates; for (int i = 0; i < numProperties; ++i) { - const CSSProperty *property = properties[i]; - ASSERT(property); - bool important = property->isImportant(); + const CSSProperty& property = properties[i]; + bool important = property.isImportant(); - HashMap<int, bool>::iterator it = candidates.find(property->id()); + HashMap<int, bool>::iterator it = candidates.find(property.id()); if (it != candidates.end()) { if (!important && it->second) continue; - removeProperty(property->id()); + removeProperty(property.id()); } - m_properties.append(*property); - candidates.set(property->id(), important); + m_properties.append(property); + candidates.set(property.id(), important); } } @@ -628,11 +629,11 @@ void StylePropertySet::parseDeclaration(const String& styleDeclaration, CSSStyle parser.parseDeclaration(this, styleDeclaration, 0, contextStyleSheet); } -void StylePropertySet::addParsedProperties(const CSSProperty* const* properties, int numProperties) +void StylePropertySet::addParsedProperties(const CSSProperty* properties, int numProperties) { m_properties.reserveCapacity(numProperties); for (int i = 0; i < numProperties; ++i) - addParsedProperty(*properties[i]); + addParsedProperty(properties[i]); } void StylePropertySet::addParsedProperty(const CSSProperty& property) |