diff options
Diffstat (limited to 'Source/WebCore/css/StylePropertySet.h')
-rw-r--r-- | Source/WebCore/css/StylePropertySet.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/Source/WebCore/css/StylePropertySet.h b/Source/WebCore/css/StylePropertySet.h index d500398d0..e14f89c3f 100644 --- a/Source/WebCore/css/StylePropertySet.h +++ b/Source/WebCore/css/StylePropertySet.h @@ -37,7 +37,9 @@ class KURL; class PropertySetCSSStyleDeclaration; class StyledElement; class StylePropertyShorthand; -class StyleSheetInternal; +class StyleSheetContents; + +typedef Vector<CSSProperty, 4> StylePropertyVector; class StylePropertySet : public RefCounted<StylePropertySet> { public: @@ -47,13 +49,9 @@ public: { return adoptRef(new StylePropertySet(cssParserMode)); } - static PassRefPtr<StylePropertySet> create(const CSSProperty* properties, int numProperties, CSSParserMode cssParserMode) - { - return adoptRef(new StylePropertySet(properties, numProperties, cssParserMode)); - } - static PassRefPtr<StylePropertySet> create(const Vector<CSSProperty>& properties) + static PassRefPtr<StylePropertySet> adopt(StylePropertyVector& properties, CSSParserMode cssParserMode = CSSStrictMode) { - return adoptRef(new StylePropertySet(properties)); + return adoptRef(new StylePropertySet(properties, cssParserMode)); } unsigned propertyCount() const { return m_properties.size(); } @@ -69,7 +67,7 @@ public: bool isPropertyImplicit(CSSPropertyID) const; // These expand shorthand properties into multiple properties. - bool setProperty(CSSPropertyID, const String& value, bool important = false, StyleSheetInternal* contextStyleSheet = 0); + bool setProperty(CSSPropertyID, const String& value, bool important = false, StyleSheetContents* contextStyleSheet = 0); void setProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important = false); // These do not. FIXME: This is too messy, we can do better. @@ -78,9 +76,9 @@ public: bool removeProperty(CSSPropertyID, String* returnText = 0); - void parseDeclaration(const String& styleDeclaration, StyleSheetInternal* contextStyleSheet); + void parseDeclaration(const String& styleDeclaration, StyleSheetContents* contextStyleSheet); - void addParsedProperties(const CSSProperty*, int numProperties); + void addParsedProperties(const Vector<CSSProperty>&); void addParsedProperty(const CSSProperty&); PassRefPtr<StylePropertySet> copyBlockProperties() const; @@ -92,7 +90,7 @@ public: void setCSSParserMode(CSSParserMode cssParserMode) { m_cssParserMode = cssParserMode; } CSSParserMode cssParserMode() const { return static_cast<CSSParserMode>(m_cssParserMode); } - void addSubresourceStyleURLs(ListHashSet<KURL>&, StyleSheetInternal* contextStyleSheet); + void addSubresourceStyleURLs(ListHashSet<KURL>&, StyleSheetContents* contextStyleSheet); PassRefPtr<StylePropertySet> copy() const; // Used by StyledElement::copyNonAttributeProperties(). @@ -121,9 +119,8 @@ public: private: StylePropertySet(CSSParserMode); - StylePropertySet(const Vector<CSSProperty>&); + StylePropertySet(StylePropertyVector&, CSSParserMode); StylePropertySet(const StylePropertySet&); - StylePropertySet(const CSSProperty*, int numProperties, CSSParserMode); void setNeedsStyleRecalc(); @@ -143,7 +140,7 @@ private: const CSSProperty* findPropertyWithId(CSSPropertyID) const; CSSProperty* findPropertyWithId(CSSPropertyID); - Vector<CSSProperty, 4> m_properties; + StylePropertyVector m_properties; unsigned m_cssParserMode : 2; mutable unsigned m_ownsCSSOMWrapper : 1; |