From dd91e772430dc294e3bf478c119ef8d43c0a3358 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 12 Mar 2012 14:11:15 +0100 Subject: 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. --- Source/WebCore/css/StylePropertySet.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'Source/WebCore/css/StylePropertySet.cpp') 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& 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 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::iterator it = candidates.find(property->id()); + HashMap::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) -- cgit v1.2.1