Title: [110305] trunk/Source/WebCore
Revision
110305
Author
[email protected]
Date
2012-03-09 11:05:40 -0800 (Fri, 09 Mar 2012)

Log Message

CSSParser: Use Vector for intermediate property storage.
<http://webkit.org/b/80653>

Reviewed by Antti Koivisto.

Remove the custom memory management for intermediate CSSProperties in CSSParser
and replace it by a Vector<CSSProperty, 256>.
This avoids heap allocations and removes a bunch of unnecessary complexity.

Remove WTF_MAKE_FAST_ALLOCATED from CSSProperty since they are only created on
the stack now.

* css/CSSGrammar.y:
* css/CSSParser.cpp:
(WebCore::CSSParser::CSSParser):
(WebCore::CSSParser::~CSSParser):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseColor):
(WebCore::CSSParser::parseDeclaration):
(WebCore::CSSParser::addProperty):
(WebCore::CSSParser::rollbackLastProperties):
(WebCore::CSSParser::clearProperties):
(WebCore::CSSParser::parse4Values):
(WebCore::CSSParser::parseFlowThread):
(WebCore::CSSParser::createStyleRule):
(WebCore::CSSParser::createFontFaceRule):
(WebCore::CSSParser::createPageRule):
(WebCore::CSSParser::createMarginAtRule):
(WebCore::CSSParser::startDeclarationsForMarginBox):
(WebCore::CSSParser::endDeclarationsForMarginBox):
(WebCore::CSSParser::deleteFontFaceOnlyValues):
(WebCore::CSSParser::createKeyframeRule):
* css/CSSParser.h:
(WebCore::CSSParser::hasProperties):
(CSSParser):
* css/CSSProperty.h:
* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::StylePropertySet):
(WebCore::StylePropertySet::addParsedProperties):
* css/StylePropertySet.h:
(WebCore::StylePropertySet::create):
(StylePropertySet):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (110304 => 110305)


--- trunk/Source/WebCore/ChangeLog	2012-03-09 18:02:46 UTC (rev 110304)
+++ trunk/Source/WebCore/ChangeLog	2012-03-09 19:05:40 UTC (rev 110305)
@@ -1,3 +1,50 @@
+2012-03-09  Andreas Kling  <[email protected]>
+
+        CSSParser: Use Vector for intermediate property storage.
+        <http://webkit.org/b/80653>
+
+        Reviewed by Antti Koivisto.
+
+        Remove the custom memory management for intermediate CSSProperties in CSSParser
+        and replace it by a Vector<CSSProperty, 256>.
+        This avoids heap allocations and removes a bunch of unnecessary complexity.
+
+        Remove WTF_MAKE_FAST_ALLOCATED from CSSProperty since they are only created on
+        the stack now.
+
+        * css/CSSGrammar.y:
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::CSSParser):
+        (WebCore::CSSParser::~CSSParser):
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseColor):
+        (WebCore::CSSParser::parseDeclaration):
+        (WebCore::CSSParser::addProperty):
+        (WebCore::CSSParser::rollbackLastProperties):
+        (WebCore::CSSParser::clearProperties):
+        (WebCore::CSSParser::parse4Values):
+        (WebCore::CSSParser::parseFlowThread):
+        (WebCore::CSSParser::createStyleRule):
+        (WebCore::CSSParser::createFontFaceRule):
+        (WebCore::CSSParser::createPageRule):
+        (WebCore::CSSParser::createMarginAtRule):
+        (WebCore::CSSParser::startDeclarationsForMarginBox):
+        (WebCore::CSSParser::endDeclarationsForMarginBox):
+        (WebCore::CSSParser::deleteFontFaceOnlyValues):
+        (WebCore::CSSParser::createKeyframeRule):
+        * css/CSSParser.h:
+        (WebCore::CSSParser::hasProperties):
+        (CSSParser):
+        * css/CSSProperty.h:
+        * css/SVGCSSParser.cpp:
+        (WebCore::CSSParser::parseSVGValue):
+        * css/StylePropertySet.cpp:
+        (WebCore::StylePropertySet::StylePropertySet):
+        (WebCore::StylePropertySet::addParsedProperties):
+        * css/StylePropertySet.h:
+        (WebCore::StylePropertySet::create):
+        (StylePropertySet):
+
 2012-03-09  Nate Chapin  <[email protected]>
 
         CachedRawResource breaks when trying to load

Modified: trunk/Source/WebCore/css/CSSGrammar.y (110304 => 110305)


--- trunk/Source/WebCore/css/CSSGrammar.y	2012-03-09 18:02:46 UTC (rev 110304)
+++ trunk/Source/WebCore/css/CSSGrammar.y	2012-03-09 19:05:40 UTC (rev 110305)
@@ -326,9 +326,9 @@
         CSSParser* p = static_cast<CSSParser*>(parser);
         if ($4) {
             p->m_valueList = p->sinkFloatingValueList($4);
-            int oldParsedProperties = p->m_numParsedProperties;
+            int oldParsedProperties = p->m_parsedProperties.size();
             if (!p->parseValue(p->m_id, p->m_important))
-                p->rollbackLastProperties(p->m_numParsedProperties - oldParsedProperties);
+                p->rollbackLastProperties(p->m_parsedProperties.size() - oldParsedProperties);
             p->m_valueList = nullptr;
         }
     }
@@ -1300,10 +1300,10 @@
         bool isPropertyParsed = false;
         if ($1 && $4) {
             p->m_valueList = p->sinkFloatingValueList($4);
-            int oldParsedProperties = p->m_numParsedProperties;
+            int oldParsedProperties = p->m_parsedProperties.size();
             $$ = p->parseValue($1, $5);
             if (!$$)
-                p->rollbackLastProperties(p->m_numParsedProperties - oldParsedProperties);
+                p->rollbackLastProperties(p->m_parsedProperties.size() - oldParsedProperties);
             else
                 isPropertyParsed = true;
             p->m_valueList = nullptr;

Modified: trunk/Source/WebCore/css/CSSParser.cpp (110304 => 110305)


--- trunk/Source/WebCore/css/CSSParser.cpp	2012-03-09 18:02:46 UTC (rev 110304)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2012-03-09 19:05:40 UTC (rev 110305)
@@ -178,17 +178,11 @@
         m_cssValuePool = CSSValuePool::create();
 }
 
-// FIXME: Can m_parsedProperties just be a Vector?
-    
 CSSParser::CSSParser(bool strictParsing)
     : m_strict(strictParsing)
     , m_important(false)
     , m_id(0)
     , m_styleSheet(0)
-    , m_parsedProperties(static_cast<CSSProperty**>(fastMalloc(32 * sizeof(CSSProperty*))))
-    , m_numParsedProperties(0)
-    , m_maxParsedProperties(32)
-    , m_numParsedPropertiesBeforeMarginBox(INVALID_NUM_PARSED_PROPERTIES)
     , m_inParseShorthand(0)
     , m_currentShorthand(0)
     , m_implicitShorthand(false)
@@ -218,7 +212,6 @@
 CSSParser::~CSSParser()
 {
     clearProperties();
-    fastFree(m_parsedProperties);
 
     fastDeleteAllValues(m_floatingSelectors);
     deleteAllValues(m_floatingSelectorVectors);
@@ -520,9 +513,9 @@
     bool ok = false;
     if (m_hasFontFaceOnlyValues)
         deleteFontFaceOnlyValues();
-    if (m_numParsedProperties) {
+    if (!m_parsedProperties.isEmpty()) {
         ok = true;
-        declaration->addParsedProperties(m_parsedProperties, m_numParsedProperties);
+        declaration->addParsedProperties(m_parsedProperties.data(), m_parsedProperties.size());
         clearProperties();
     }
 
@@ -543,7 +536,7 @@
     if (!parser.parseColor(string))
         return false;
 
-    CSSValue* value = parser.m_parsedProperties[0]->value();
+    CSSValue* value = parser.m_parsedProperties.first().value();
     if (!value->isPrimitiveValue())
         return false;
 
@@ -565,7 +558,7 @@
     cssyyparse(this);
     m_rule = 0;
 
-    return (m_numParsedProperties && m_parsedProperties[0]->m_id == CSSPropertyColor);
+    return !m_parsedProperties.isEmpty() && m_parsedProperties.first().id() == CSSPropertyColor;
 }
 
 bool CSSParser::parseSystemColor(RGBA32& color, const String& string, Document* document)
@@ -621,9 +614,9 @@
     bool ok = false;
     if (m_hasFontFaceOnlyValues)
         deleteFontFaceOnlyValues();
-    if (m_numParsedProperties) {
+    if (!m_parsedProperties.isEmpty()) {
         ok = true;
-        declaration->addParsedProperties(m_parsedProperties, m_numParsedProperties);
+        declaration->addParsedProperties(m_parsedProperties.data(), m_parsedProperties.size());
         clearProperties();
     }
 
@@ -667,31 +660,19 @@
 
 void CSSParser::addProperty(int propId, PassRefPtr<CSSValue> value, bool important, bool implicit)
 {
-    OwnPtr<CSSProperty> prop(adoptPtr(new CSSProperty(propId, value, important, m_currentShorthand, m_implicitShorthand || implicit)));
-    if (m_numParsedProperties >= m_maxParsedProperties) {
-        if (m_numParsedProperties > (UINT_MAX / sizeof(CSSProperty*)) - 32)
-            CRASH();  // Avoid inconsistencies with rollbackLastProperties.
-        m_maxParsedProperties += 32;
-        m_parsedProperties = static_cast<CSSProperty**>(fastRealloc(m_parsedProperties,
-            m_maxParsedProperties * sizeof(CSSProperty*)));
-    }
-    m_parsedProperties[m_numParsedProperties++] = prop.leakPtr();
+    m_parsedProperties.append(CSSProperty(propId, value, important, m_currentShorthand, m_implicitShorthand || implicit));
 }
 
 void CSSParser::rollbackLastProperties(int num)
 {
     ASSERT(num >= 0);
-    ASSERT(m_numParsedProperties >= static_cast<unsigned>(num));
-
-    for (int i = 0; i < num; ++i)
-        delete m_parsedProperties[--m_numParsedProperties];
+    ASSERT(m_parsedProperties.size() >= static_cast<unsigned>(num));
+    m_parsedProperties.shrink(m_parsedProperties.size() - num);
 }
 
 void CSSParser::clearProperties()
 {
-    for (unsigned i = 0; i < m_numParsedProperties; i++)
-        delete m_parsedProperties[i];
-    m_numParsedProperties = 0;
+    m_parsedProperties.clear();
     m_numParsedPropertiesBeforeMarginBox = INVALID_NUM_PARSED_PROPERTIES;
     m_hasFontFaceOnlyValues = false;
 }
@@ -1072,7 +1053,7 @@
         ShorthandScope scope(this, propId);
         if (num != 1 || !parseValue(CSSPropertyOverflowX, important))
             return false;
-        CSSValue* value = m_parsedProperties[m_numParsedProperties - 1]->value();
+        CSSValue* value = m_parsedProperties.last().value();
         addProperty(CSSPropertyOverflowY, value, important);
         return true;
     }
@@ -1166,7 +1147,7 @@
             ShorthandScope scope(this, CSSPropertyBorderSpacing);
             if (!parseValue(properties[0], important))
                 return false;
-            CSSValue* value = m_parsedProperties[m_numParsedProperties-1]->value();
+            CSSValue* value = m_parsedProperties.last().value();
             addProperty(properties[1], value, important);
             return true;
         }
@@ -1913,7 +1894,7 @@
             ShorthandScope scope(this, CSSPropertyWebkitMarginCollapse);
             if (!parseValue(properties[0], important))
                 return false;
-            CSSValue* value = m_parsedProperties[m_numParsedProperties-1]->value();
+            CSSValue* value = m_parsedProperties.last().value();
             addProperty(properties[1], value, important);
             return true;
         }
@@ -2754,7 +2735,7 @@
         case 1: {
             if (!parseValue(properties[0], important))
                 return false;
-            CSSValue *value = m_parsedProperties[m_numParsedProperties-1]->value();
+            CSSValue *value = m_parsedProperties.last().value();
             ImplicitScope implicitScope(this, PropertyImplicit);
             addProperty(properties[1], value, important);
             addProperty(properties[2], value, important);
@@ -2764,17 +2745,17 @@
         case 2: {
             if (!parseValue(properties[0], important) || !parseValue(properties[1], important))
                 return false;
-            CSSValue *value = m_parsedProperties[m_numParsedProperties-2]->value();
+            CSSValue *value = m_parsedProperties[m_parsedProperties.size() - 2].value();
             ImplicitScope implicitScope(this, PropertyImplicit);
             addProperty(properties[2], value, important);
-            value = m_parsedProperties[m_numParsedProperties-2]->value();
+            value = m_parsedProperties[m_parsedProperties.size() - 2].value();
             addProperty(properties[3], value, important);
             break;
         }
         case 3: {
             if (!parseValue(properties[0], important) || !parseValue(properties[1], important) || !parseValue(properties[2], important))
                 return false;
-            CSSValue *value = m_parsedProperties[m_numParsedProperties-2]->value();
+            CSSValue *value = m_parsedProperties[m_parsedProperties.size() - 2].value();
             ImplicitScope implicitScope(this, PropertyImplicit);
             addProperty(properties[3], value, important);
             break;
@@ -7119,7 +7100,7 @@
 
     m_rule = 0;
 
-    return ((m_numParsedProperties == 1) && (m_parsedProperties[0]->m_id == CSSPropertyWebkitFlowInto));
+    return ((m_parsedProperties.size() == 1) && (m_parsedProperties.first().id() == CSSPropertyWebkitFlowInto));
 }
 
 // none | <ident>
@@ -8864,7 +8845,7 @@
         rule->styleRule()->adoptSelectorVector(*selectors);
         if (m_hasFontFaceOnlyValues)
             deleteFontFaceOnlyValues();
-        rule->styleRule()->setProperties(StylePropertySet::create(m_parsedProperties, m_numParsedProperties, m_strict));
+        rule->styleRule()->setProperties(StylePropertySet::create(m_parsedProperties.data(), m_parsedProperties.size(), m_strict));
         result = rule.get();
         m_parsedRules.append(rule.release());
         if (m_ruleRangeMap) {
@@ -8886,14 +8867,13 @@
 CSSRule* CSSParser::createFontFaceRule()
 {
     m_allowImportRules = m_allowNamespaceDeclarations = false;
-    for (unsigned i = 0; i < m_numParsedProperties; ++i) {
-        CSSProperty* property = m_parsedProperties[i];
-        int id = property->id();
-        if (id == CSSPropertyFontVariant && property->value()->isPrimitiveValue()) {
-            RefPtr<CSSValue> value = property->m_value.release();
-            property->m_value = CSSValueList::createCommaSeparated();
-            static_cast<CSSValueList*>(property->value())->append(value.release());
-        } else if (id == CSSPropertyFontFamily && (!property->value()->isValueList() || static_cast<CSSValueList*>(property->value())->length() != 1)) {
+    for (unsigned i = 0; i < m_parsedProperties.size(); ++i) {
+        CSSProperty& property = m_parsedProperties[i];
+        if (property.id() == CSSPropertyFontVariant && property.value()->isPrimitiveValue()) {
+            RefPtr<CSSValue> value = property.m_value.release();
+            property.m_value = CSSValueList::createCommaSeparated();
+            static_cast<CSSValueList*>(property.value())->append(value.release());
+        } else if (property.id() == CSSPropertyFontFamily && (!property.value()->isValueList() || static_cast<CSSValueList*>(property.value())->length() != 1)) {
             // Unlike font-family property, font-family descriptor in @font-face rule
             // has to be a value list with exactly one family name. It cannot have a
             // have 'initial' value and cannot 'inherit' from parent.
@@ -8903,7 +8883,7 @@
         }
     }
     RefPtr<CSSFontFaceRule> rule = CSSFontFaceRule::create(m_styleSheet);
-    rule->setDeclaration(StylePropertySet::create(m_parsedProperties, m_numParsedProperties, m_strict));
+    rule->setDeclaration(StylePropertySet::create(m_parsedProperties.data(), m_parsedProperties.size(), m_strict));
     clearProperties();
     CSSFontFaceRule* result = rule.get();
     m_parsedRules.append(rule.release());
@@ -8974,7 +8954,7 @@
         Vector<OwnPtr<CSSParserSelector> > selectorVector;
         selectorVector.append(pageSelector);
         rule->adoptSelectorVector(selectorVector);
-        rule->setDeclaration(StylePropertySet::create(m_parsedProperties, m_numParsedProperties, m_strict));
+        rule->setDeclaration(StylePropertySet::create(m_parsedProperties.data(), m_parsedProperties.size(), m_strict));
         pageRule = rule.get();
         m_parsedRules.append(rule.release());
     }
@@ -9007,7 +8987,7 @@
 {
     // FIXME: Implement margin at-rule here, using:
     //        - marginBox: margin box
-    //        - m_parsedProperties: properties at [m_numParsedPropertiesBeforeMarginBox, m_numParsedProperties) are for this at-rule.
+    //        - m_parsedProperties: properties at [m_numParsedPropertiesBeforeMarginBox, m_parsedProperties.size()] are for this at-rule.
     // Don't forget to also update the action for page symbol in CSSGrammar.y such that margin at-rule data is cleared if page_selector is invalid.
 
     endDeclarationsForMarginBox();
@@ -9016,32 +8996,26 @@
 
 void CSSParser::startDeclarationsForMarginBox()
 {
-    m_numParsedPropertiesBeforeMarginBox = m_numParsedProperties;
+    m_numParsedPropertiesBeforeMarginBox = m_parsedProperties.size();
 }
 
 void CSSParser::endDeclarationsForMarginBox()
 {
-    ASSERT(m_numParsedPropertiesBeforeMarginBox != INVALID_NUM_PARSED_PROPERTIES);
-    rollbackLastProperties(m_numParsedProperties - m_numParsedPropertiesBeforeMarginBox);
+    rollbackLastProperties(m_parsedProperties.size() - m_numParsedPropertiesBeforeMarginBox);
     m_numParsedPropertiesBeforeMarginBox = INVALID_NUM_PARSED_PROPERTIES;
 }
 
 void CSSParser::deleteFontFaceOnlyValues()
 {
     ASSERT(m_hasFontFaceOnlyValues);
-    int deletedProperties = 0;
-
-    for (unsigned i = 0; i < m_numParsedProperties; ++i) {
-        CSSProperty* property = m_parsedProperties[i];
-        int id = property->id();
-        if (id == CSSPropertyFontVariant && property->value()->isValueList()) {
-            delete property;
-            deletedProperties++;
-        } else if (deletedProperties)
-            m_parsedProperties[i - deletedProperties] = m_parsedProperties[i];
+    for (unsigned i = 0; i < m_parsedProperties.size();) {
+        CSSProperty& property = m_parsedProperties[i];
+        if (property.id() == CSSPropertyFontVariant && property.value()->isValueList()) {
+            m_parsedProperties.remove(i);
+            continue;
+        }
+        ++i;
     }
-
-    m_numParsedProperties -= deletedProperties;
 }
 
 WebKitCSSKeyframeRule* CSSParser::createKeyframeRule(CSSParserValueList* keys)
@@ -9058,7 +9032,7 @@
 
     RefPtr<WebKitCSSKeyframeRule> keyframe = WebKitCSSKeyframeRule::create(m_styleSheet);
     keyframe->setKeyText(keyString);
-    keyframe->setDeclaration(StylePropertySet::create(m_parsedProperties, m_numParsedProperties, m_strict));
+    keyframe->setDeclaration(StylePropertySet::create(m_parsedProperties.data(), m_parsedProperties.size(), m_strict));
 
     clearProperties();
 

Modified: trunk/Source/WebCore/css/CSSParser.h (110304 => 110305)


--- trunk/Source/WebCore/css/CSSParser.h	2012-03-09 18:02:46 UTC (rev 110304)
+++ trunk/Source/WebCore/css/CSSParser.h	2012-03-09 19:05:40 UTC (rev 110305)
@@ -26,6 +26,7 @@
 #include "CSSCalculationValue.h"
 #include "CSSGradientValue.h"
 #include "CSSParserValues.h"
+#include "CSSProperty.h"
 #include "CSSPropertySourceData.h"
 #include "CSSSelector.h"
 #include "Color.h"
@@ -83,7 +84,7 @@
 
     void addProperty(int propId, PassRefPtr<CSSValue>, bool important, bool implicit = false);
     void rollbackLastProperties(int num);
-    bool hasProperties() const { return m_numParsedProperties > 0; }
+    bool hasProperties() const { return !m_parsedProperties.isEmpty(); }
 
     bool parseValue(int propId, bool important);
     bool parseShorthand(int propId, const int* properties, int numProperties, bool important);
@@ -284,12 +285,10 @@
     RefPtr<WebKitCSSKeyframeRule> m_keyframe;
     OwnPtr<MediaQuery> m_mediaQuery;
     OwnPtr<CSSParserValueList> m_valueList;
-    CSSProperty** m_parsedProperties;
+    Vector<CSSProperty, 256> m_parsedProperties;
     CSSSelectorList* m_selectorListForParseSelector;
 
     RefPtr<CSSValuePool> m_cssValuePool;
-    unsigned m_numParsedProperties;
-    unsigned m_maxParsedProperties;
     unsigned m_numParsedPropertiesBeforeMarginBox;
 
     int m_inParseShorthand;

Modified: trunk/Source/WebCore/css/CSSProperty.h (110304 => 110305)


--- trunk/Source/WebCore/css/CSSProperty.h	2012-03-09 18:02:46 UTC (rev 110304)
+++ trunk/Source/WebCore/css/CSSProperty.h	2012-03-09 19:05:40 UTC (rev 110305)
@@ -30,7 +30,6 @@
 namespace WebCore {
 
 class CSSProperty {
-    WTF_MAKE_FAST_ALLOCATED;
 public:
     CSSProperty(unsigned propID, PassRefPtr<CSSValue> value, bool important = false, int shorthandID = 0, bool implicit = false)
         : m_id(propID)

Modified: trunk/Source/WebCore/css/SVGCSSParser.cpp (110304 => 110305)


--- trunk/Source/WebCore/css/SVGCSSParser.cpp	2012-03-09 18:02:46 UTC (rev 110304)
+++ trunk/Source/WebCore/css/SVGCSSParser.cpp	2012-03-09 19:05:40 UTC (rev 110305)
@@ -292,7 +292,7 @@
             rollbackLastProperties(1);
             return false;
         }
-        CSSValue* value = m_parsedProperties[m_numParsedProperties - 1]->value();
+        CSSValue* value = m_parsedProperties.last().value();
         addProperty(CSSPropertyMarkerMid, value, important);
         addProperty(CSSPropertyMarkerEnd, value, important);
         m_implicitShorthand = false;

Modified: trunk/Source/WebCore/css/StylePropertySet.cpp (110304 => 110305)


--- trunk/Source/WebCore/css/StylePropertySet.cpp	2012-03-09 18:02:46 UTC (rev 110304)
+++ trunk/Source/WebCore/css/StylePropertySet.cpp	2012-03-09 19:05:40 UTC (rev 110305)
@@ -57,26 +57,27 @@
     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 @@
     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)

Modified: trunk/Source/WebCore/css/StylePropertySet.h (110304 => 110305)


--- trunk/Source/WebCore/css/StylePropertySet.h	2012-03-09 18:02:46 UTC (rev 110304)
+++ trunk/Source/WebCore/css/StylePropertySet.h	2012-03-09 19:05:40 UTC (rev 110305)
@@ -43,7 +43,7 @@
     {
         return adoptRef(new StylePropertySet);
     }
-    static PassRefPtr<StylePropertySet> create(const CSSProperty* const* properties, int numProperties, bool useStrictParsing)
+    static PassRefPtr<StylePropertySet> create(const CSSProperty* properties, int numProperties, bool useStrictParsing)
     {
         return adoptRef(new StylePropertySet(properties, numProperties, useStrictParsing));
     }
@@ -76,7 +76,7 @@
 
     void parseDeclaration(const String& styleDeclaration, CSSStyleSheet* contextStyleSheet);
 
-    void addParsedProperties(const CSSProperty* const *, int numProperties);
+    void addParsedProperties(const CSSProperty*, int numProperties);
     void addParsedProperty(const CSSProperty&);
 
     PassRefPtr<StylePropertySet> copyBlockProperties() const;
@@ -113,7 +113,7 @@
 private:
     StylePropertySet();
     StylePropertySet(const Vector<CSSProperty>&);
-    StylePropertySet(const CSSProperty* const *, int numProperties, bool useStrictParsing);
+    StylePropertySet(const CSSProperty*, int numProperties, bool useStrictParsing);
 
     void setNeedsStyleRecalc();
 

Modified: trunk/Source/WebCore/svg/SVGFontFaceElement.cpp (110304 => 110305)


--- trunk/Source/WebCore/svg/SVGFontFaceElement.cpp	2012-03-09 18:02:46 UTC (rev 110304)
+++ trunk/Source/WebCore/svg/SVGFontFaceElement.cpp	2012-03-09 19:05:40 UTC (rev 110305)
@@ -298,8 +298,7 @@
 
     // Parse in-memory CSS rules
     CSSProperty srcProperty(CSSPropertySrc, list);
-    const CSSProperty* srcPropertyRef = &srcProperty;
-    m_fontFaceRule->declaration()->addParsedProperties(&srcPropertyRef, 1);
+    m_fontFaceRule->declaration()->addParsedProperties(&srcProperty, 1);
 
     if (describesParentFont) {    
         // Traverse parsed CSS values and associate CSSFontFaceSrcValue elements with ourselves.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to