Index: Source/core/css/CSSProperty.cpp |
diff --git a/Source/core/css/CSSProperty.cpp b/Source/core/css/CSSProperty.cpp |
index a236d359c47f42b5d107c14319fd8c9485c4aee5..1ab97e10142a22e084e29965a0b30a485d60c044 100644 |
--- a/Source/core/css/CSSProperty.cpp |
+++ b/Source/core/css/CSSProperty.cpp |
@@ -37,6 +37,20 @@ struct SameSizeAsCSSProperty { |
COMPILE_ASSERT(sizeof(CSSProperty) == sizeof(SameSizeAsCSSProperty), CSSProperty_should_stay_small); |
+CSSPropertyID StylePropertyMetadata::shorthandID() const |
+{ |
+ if (!m_isSetFromShorthand) |
+ return CSSPropertyInvalid; |
+ |
+ const Vector<StylePropertyShorthand> shorthands = matchingShorthandsForLonghand(static_cast<CSSPropertyID>(m_propertyID)); |
+ ASSERT(shorthands.size()); |
+ if (shorthands.size() > 1) { |
Julien - ping for review
2013/06/14 17:38:27
Do we really need this branch? m_shorthandID is 0
|
+ ASSERT(m_shorthandID >= 0 && m_shorthandID < shorthands.size()); |
+ return shorthands.at(m_shorthandID).id(); |
+ } |
+ return shorthands.at(0).id(); |
+} |
+ |
void CSSProperty::wrapValueInCommaSeparatedList() |
{ |
RefPtr<CSSValue> value = m_value.release(); |
@@ -164,7 +178,7 @@ static CSSPropertyID resolveToPhysicalProperty(WritingMode writingMode, LogicalE |
static const StylePropertyShorthand& borderDirections() |
{ |
static const CSSPropertyID properties[4] = { CSSPropertyBorderTop, CSSPropertyBorderRight, CSSPropertyBorderBottom, CSSPropertyBorderLeft }; |
- DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderDirections, (properties, WTF_ARRAY_LENGTH(properties))); |
+ DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderDirections, (CSSPropertyBorder, properties, WTF_ARRAY_LENGTH(properties))); |
return borderDirections; |
} |