| Index: Source/core/css/StylePropertySerializer.h
|
| diff --git a/Source/core/css/StylePropertySerializer.h b/Source/core/css/StylePropertySerializer.h
|
| index 72647d44221721784a99ef88c6a522cfdf69dab9..94059e070b7f2aa4012856ea83df89c5cf27b20e 100644
|
| --- a/Source/core/css/StylePropertySerializer.h
|
| +++ b/Source/core/css/StylePropertySerializer.h
|
| @@ -26,6 +26,8 @@
|
| #include "core/css/CSSValueList.h"
|
| #include "core/css/StylePropertySet.h"
|
|
|
| +#include "wtf/BitArray.h"
|
| +
|
| namespace blink {
|
|
|
| class StylePropertySet;
|
| @@ -33,7 +35,8 @@ class StylePropertyShorthand;
|
|
|
| class StylePropertySerializer {
|
| public:
|
| - StylePropertySerializer(const StylePropertySet&);
|
| + explicit StylePropertySerializer(const StylePropertySet&);
|
| +
|
| String asText() const;
|
| String getPropertyValue(CSSPropertyID) const;
|
| private:
|
| @@ -52,7 +55,62 @@ private:
|
| bool shorthandHasOnlyInitialOrInheritedValue(const StylePropertyShorthand&) const;
|
| void appendBackgroundPropertyAsText(StringBuilder& result, unsigned& numDecls) const;
|
|
|
| - const StylePropertySet& m_propertySet;
|
| + // Only StylePropertySerializer uses the following two classes.
|
| + class PropertyValueForSerializer {
|
| + public:
|
| + explicit PropertyValueForSerializer(StylePropertySet::PropertyReference property)
|
| + : m_value(property.value())
|
| + , m_id(property.id())
|
| + , m_isImportant(property.isImportant())
|
| + , m_isImplicit(property.isImplicit())
|
| + , m_isInherited(property.isInherited()) { }
|
| +
|
| + PropertyValueForSerializer(CSSPropertyID id, const CSSValue* value, bool isImportant)
|
| + : m_value(value)
|
| + , m_id(id)
|
| + , m_isImportant(isImportant)
|
| + , m_isImplicit(value->isImplicitInitialValue())
|
| + , m_isInherited(value->isInheritedValue()) { }
|
| +
|
| + CSSPropertyID id() const { return m_id; }
|
| + const CSSValue* value() const { return m_value; }
|
| + bool isImportant() const { return m_isImportant; }
|
| + bool isImplicit() const { return m_isImplicit; }
|
| + bool isInherited() const { return m_isInherited; }
|
| + bool isValid() const { return m_value; }
|
| +
|
| + private:
|
| + const CSSValue* m_value;
|
| + CSSPropertyID m_id;
|
| + bool m_isImportant;
|
| + bool m_isImplicit;
|
| + bool m_isInherited;
|
| + };
|
| +
|
| + class StylePropertySetForSerializer {
|
| + public:
|
| + explicit StylePropertySetForSerializer(const StylePropertySet&);
|
| +
|
| + unsigned propertyCount() const;
|
| + PropertyValueForSerializer propertyAt(unsigned index) const;
|
| + bool shouldProcessPropertyAt(unsigned index) const;
|
| + int findPropertyIndex(CSSPropertyID) const;
|
| + const CSSValue* getPropertyCSSValue(CSSPropertyID) const;
|
| + String getPropertyValue(CSSPropertyID) const;
|
| + bool isPropertyImplicit(CSSPropertyID) const;
|
| + bool propertyIsImportant(CSSPropertyID) const;
|
| +
|
| + private:
|
| + bool hasExpandedAllProperty() const { return hasAllProperty() && m_needToExpandAll; }
|
| + bool hasAllProperty() const { return m_allIndex != -1; }
|
| +
|
| + const StylePropertySet& m_propertySet;
|
| + int m_allIndex;
|
| + BitArray<numCSSProperties> m_longhandPropertyUsed;
|
| + bool m_needToExpandAll;
|
| + };
|
| +
|
| + const StylePropertySetForSerializer m_propertySet;
|
| };
|
|
|
| } // namespace blink
|
|
|