Index: Source/core/css/CSSProperty.h |
diff --git a/Source/core/css/CSSProperty.h b/Source/core/css/CSSProperty.h |
index 7b508141c6ff725071eda61793a030322a3a8583..64cbc9dd872febcbd1edfd7db0a9d33a6b7fc2ed 100644 |
--- a/Source/core/css/CSSProperty.h |
+++ b/Source/core/css/CSSProperty.h |
@@ -26,14 +26,15 @@ |
#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 shorthandID, bool important, bool implicit, bool inherited) |
: m_propertyID(propertyID) |
+ , m_isSetFromShorthand(isSetFromShorthand) |
, m_shorthandID(shorthandID) |
, m_important(important) |
, m_implicit(implicit) |
@@ -41,20 +42,20 @@ union StylePropertyMetadata { |
{ |
} |
- 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_shorthandID : 2; // If this property was set as part of an ambiguous 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; |
}; |
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 shorthandID = 0, bool implicit = false) |
+ : m_metadata(propertyID, isSetFromShorthand, shorthandID, 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(); } |