| Index: Source/core/css/CSSProperty.h
|
| diff --git a/Source/core/css/CSSProperty.h b/Source/core/css/CSSProperty.h
|
| index 7b508141c6ff725071eda61793a030322a3a8583..1435888635b251d74e5d4a5bf8c904774260b070 100644
|
| --- a/Source/core/css/CSSProperty.h
|
| +++ b/Source/core/css/CSSProperty.h
|
| @@ -26,35 +26,36 @@
|
| #include "core/platform/text/TextDirection.h"
|
| #include "core/platform/text/WritingMode.h"
|
| #include "core/rendering/style/RenderStyleConstants.h"
|
| -#include <wtf/PassRefPtr.h>
|
| -#include <wtf/RefPtr.h>
|
| +#include "wtf/PassRefPtr.h"
|
| +#include "wtf/RefPtr.h"
|
|
|
| namespace WebCore {
|
|
|
| -union StylePropertyMetadata {
|
| - StylePropertyMetadata(CSSPropertyID propertyID, CSSPropertyID shorthandID, bool important, bool implicit, bool inherited)
|
| +struct StylePropertyMetadata {
|
| + StylePropertyMetadata(CSSPropertyID propertyID, bool isSetFromShorthand, int indexInShorthandsVector, bool important, bool implicit, bool inherited)
|
| : m_propertyID(propertyID)
|
| - , m_shorthandID(shorthandID)
|
| + , m_isSetFromShorthand(isSetFromShorthand)
|
| + , m_indexInShorthandsVector(indexInShorthandsVector)
|
| , m_important(important)
|
| , m_implicit(implicit)
|
| , m_inherited(inherited)
|
| {
|
| }
|
|
|
| - unsigned m_bits;
|
| - struct {
|
| - unsigned m_propertyID : 14;
|
| - unsigned m_shorthandID : 14; // If this property was set as part of a shorthand, gives the shorthand.
|
| - unsigned m_important : 1;
|
| - unsigned m_implicit : 1; // Whether or not the property was set implicitly as the result of a shorthand.
|
| - unsigned m_inherited : 1;
|
| - };
|
| + CSSPropertyID shorthandID() const;
|
| +
|
| + unsigned m_propertyID : 10;
|
| + unsigned m_isSetFromShorthand : 1;
|
| + unsigned m_indexInShorthandsVector : 2; // If this property was set as part of an ambiguous shorthand, gives the index in the shorthands vector.
|
| + unsigned m_important : 1;
|
| + unsigned m_implicit : 1; // Whether or not the property was set implicitly as the result of a shorthand.
|
| + unsigned m_inherited : 1;
|
| };
|
|
|
| class CSSProperty {
|
| public:
|
| - CSSProperty(CSSPropertyID propertyID, PassRefPtr<CSSValue> value, bool important = false, CSSPropertyID shorthandID = CSSPropertyInvalid, bool implicit = false)
|
| - : m_metadata(propertyID, shorthandID, important, implicit, isInheritedProperty(propertyID))
|
| + CSSProperty(CSSPropertyID propertyID, PassRefPtr<CSSValue> value, bool important = false, bool isSetFromShorthand = false, int indexInShorthandsVector = 0, bool implicit = false)
|
| + : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, important, implicit, isInheritedProperty(propertyID))
|
| , m_value(value)
|
| {
|
| ASSERT((propertyID == CSSPropertyVariable) == (m_value && m_value->isVariableValue()));
|
| @@ -69,7 +70,8 @@ public:
|
| }
|
|
|
| CSSPropertyID id() const { return static_cast<CSSPropertyID>(m_metadata.m_propertyID); }
|
| - CSSPropertyID shorthandID() const { return static_cast<CSSPropertyID>(m_metadata.m_shorthandID); }
|
| + bool isSetFromShorthand() const { return m_metadata.m_isSetFromShorthand; };
|
| + CSSPropertyID shorthandID() const { return m_metadata.shorthandID(); };
|
| bool isImportant() const { return m_metadata.m_important; }
|
|
|
| CSSValue* value() const { return m_value.get(); }
|
|
|