Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(531)

Unified Diff: Source/core/css/StylePropertySet.h

Issue 18272014: Cache cssomWrappers for StylePropertySets directly on the MutableStylePropertySet. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/css/StylePropertySet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StylePropertySet.h
diff --git a/Source/core/css/StylePropertySet.h b/Source/core/css/StylePropertySet.h
index 3fed4302f2db09da3ccb9aca97bd3c3cb4db6ddb..929594493ce8f76d25a7f757c6c2a648821c0a2a 100644
--- a/Source/core/css/StylePropertySet.h
+++ b/Source/core/css/StylePropertySet.h
@@ -25,6 +25,7 @@
#include "core/css/CSSParserMode.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSProperty.h"
+#include "core/css/PropertySetCSSStyleDeclaration.h"
#include <wtf/ListHashSet.h>
#include <wtf/text/WTFString.h>
#include <wtf/Vector.h>
@@ -37,7 +38,6 @@ class Element;
class ImmutableStylePropertySet;
class KURL;
class MutableStylePropertySet;
-class PropertySetCSSStyleDeclaration;
class StylePropertyShorthand;
class StyleSheetContents;
@@ -106,7 +106,7 @@ public:
String asText() const;
bool isMutable() const { return m_isMutable; }
- bool hasCSSOMWrapper() const { return m_ownsCSSOMWrapper; }
+ bool hasCSSOMWrapper() const;
bool hasFailedOrCanceledSubresources() const;
@@ -122,22 +122,19 @@ public:
protected:
StylePropertySet(CSSParserMode cssParserMode)
: m_cssParserMode(cssParserMode)
- , m_ownsCSSOMWrapper(false)
, m_isMutable(true)
, m_arraySize(0)
{ }
StylePropertySet(CSSParserMode cssParserMode, unsigned immutableArraySize)
: m_cssParserMode(cssParserMode)
- , m_ownsCSSOMWrapper(false)
, m_isMutable(false)
, m_arraySize(immutableArraySize)
{ }
unsigned m_cssParserMode : 2;
- mutable unsigned m_ownsCSSOMWrapper : 1;
mutable unsigned m_isMutable : 1;
- unsigned m_arraySize : 28;
+ unsigned m_arraySize : 29;
friend class PropertySetCSSStyleDeclaration;
};
@@ -174,13 +171,9 @@ inline const StylePropertyMetadata* ImmutableStylePropertySet::metadataArray() c
class MutableStylePropertySet : public StylePropertySet {
public:
- ~MutableStylePropertySet();
-
static PassRefPtr<MutableStylePropertySet> create(CSSParserMode = CSSQuirksMode);
static PassRefPtr<MutableStylePropertySet> create(const CSSProperty* properties, unsigned count);
- MutableStylePropertySet(const StylePropertySet&);
-
unsigned propertyCount() const { return m_propertyVector.size(); }
PropertySetCSSStyleDeclaration* cssStyleDeclaration();
@@ -216,14 +209,15 @@ public:
Vector<CSSProperty, 4> m_propertyVector;
private:
- MutableStylePropertySet(CSSParserMode cssParserMode)
- : StylePropertySet(cssParserMode)
- { }
-
+ explicit MutableStylePropertySet(CSSParserMode);
+ explicit MutableStylePropertySet(const StylePropertySet&);
MutableStylePropertySet(const CSSProperty* properties, unsigned count);
bool removeShorthandProperty(CSSPropertyID);
CSSProperty* findCSSPropertyWithID(CSSPropertyID);
+ OwnPtr<PropertySetCSSStyleDeclaration> m_cssomWrapper;
+
+ friend class StylePropertySet;
};
inline StylePropertyMetadata StylePropertySet::PropertyReference::propertyMetadata() const
« no previous file with comments | « no previous file | Source/core/css/StylePropertySet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698