Part 2 of removing PlatformString.h, remove PlatformString.h
[WebKit-https.git] / Source / WebCore / css / CSSProperty.cpp
index ab10439..7ec018d 100644 (file)
 #include "config.h"
 #include "CSSProperty.h"
 
-#include "CSSPropertyLonghand.h"
-#include "CSSPropertyNames.h"
-#include "PlatformString.h"
+#include "CSSValueList.h"
+#include "MemoryInstrumentation.h"
 #include "RenderStyleConstants.h"
+#include "StylePropertyShorthand.h"
+
+#if ENABLE(CSS_VARIABLES)
+#include "CSSVariableValue.h"
+#endif
+
+#include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
 
+struct SameSizeAsCSSProperty {
+    uint32_t bitfields;
+    void* value;
+};
+
+COMPILE_ASSERT(sizeof(CSSProperty) == sizeof(SameSizeAsCSSProperty), CSSProperty_should_stay_small);
+
+String CSSProperty::cssName() const
+{
+#if ENABLE(CSS_VARIABLES)
+    if (id() == CSSPropertyVariable) {
+        ASSERT(value()->isVariableValue());
+        return "-webkit-var-" + static_cast<CSSVariableValue*>(value())->name();
+    }
+#endif
+    return getPropertyNameString(id());
+}
+
 String CSSProperty::cssText() const
 {
-    return String(getPropertyName(static_cast<CSSPropertyID>(id()))) + ": " + m_value->cssText() + (isImportant() ? " !important" : "") + "; ";
+    StringBuilder result;
+    result.append(cssName());
+    result.appendLiteral(": ");
+    result.append(m_value->cssText());
+    if (isImportant())
+        result.appendLiteral(" !important");
+    result.append(';');
+    return result.toString();
+}
+
+void CSSProperty::wrapValueInCommaSeparatedList()
+{
+    RefPtr<CSSValue> value = m_value.release();
+    m_value = CSSValueList::createCommaSeparated();
+    static_cast<CSSValueList*>(m_value.get())->append(value.release());
 }
 
 enum LogicalBoxSide { BeforeSide, EndSide, AfterSide, StartSide };
 enum PhysicalBoxSide { TopSide, RightSide, BottomSide, LeftSide };
 
-static int resolveToPhysicalProperty(TextDirection direction, WritingMode writingMode, LogicalBoxSide logicalSide, const CSSPropertyLonghand& longhand)
+static CSSPropertyID resolveToPhysicalProperty(TextDirection direction, WritingMode writingMode, LogicalBoxSide logicalSide, const StylePropertyShorthand& shorthand)
 {
     if (direction == LTR) {
         if (writingMode == TopToBottomWritingMode) {
             // The common case. The logical and physical box sides match.
             // Left = Start, Right = End, Before = Top, After = Bottom
-            return longhand.properties()[logicalSide];
+            return shorthand.properties()[logicalSide];
         }
 
         if (writingMode == BottomToTopWritingMode) {
             // Start = Left, End = Right, Before = Bottom, After = Top.
             switch (logicalSide) {
             case StartSide:
-                return longhand.properties()[LeftSide];
+                return shorthand.properties()[LeftSide];
             case EndSide:
-                return longhand.properties()[RightSide];
+                return shorthand.properties()[RightSide];
             case BeforeSide:
-                return longhand.properties()[BottomSide];
+                return shorthand.properties()[BottomSide];
             default:
-                return longhand.properties()[TopSide];
+                return shorthand.properties()[TopSide];
             }
         }
 
@@ -63,26 +101,26 @@ static int resolveToPhysicalProperty(TextDirection direction, WritingMode writin
             // Start = Top, End = Bottom, Before = Left, After = Right.
             switch (logicalSide) {
             case StartSide:
-                return longhand.properties()[TopSide];
+                return shorthand.properties()[TopSide];
             case EndSide:
-                return longhand.properties()[BottomSide];
+                return shorthand.properties()[BottomSide];
             case BeforeSide:
-                return longhand.properties()[LeftSide];
+                return shorthand.properties()[LeftSide];
             default:
-                return longhand.properties()[RightSide];
+                return shorthand.properties()[RightSide];
             }
         }
 
         // Start = Top, End = Bottom, Before = Right, After = Left
         switch (logicalSide) {
         case StartSide:
-            return longhand.properties()[TopSide];
+            return shorthand.properties()[TopSide];
         case EndSide:
-            return longhand.properties()[BottomSide];
+            return shorthand.properties()[BottomSide];
         case BeforeSide:
-            return longhand.properties()[RightSide];
+            return shorthand.properties()[RightSide];
         default:
-            return longhand.properties()[LeftSide];
+            return shorthand.properties()[LeftSide];
         }
     }
 
@@ -90,13 +128,13 @@ static int resolveToPhysicalProperty(TextDirection direction, WritingMode writin
         // Start = Right, End = Left, Before = Top, After = Bottom
         switch (logicalSide) {
         case StartSide:
-            return longhand.properties()[RightSide];
+            return shorthand.properties()[RightSide];
         case EndSide:
-            return longhand.properties()[LeftSide];
+            return shorthand.properties()[LeftSide];
         case BeforeSide:
-            return longhand.properties()[TopSide];
+            return shorthand.properties()[TopSide];
         default:
-            return longhand.properties()[BottomSide];
+            return shorthand.properties()[BottomSide];
         }
     }
 
@@ -104,13 +142,13 @@ static int resolveToPhysicalProperty(TextDirection direction, WritingMode writin
         // Start = Right, End = Left, Before = Bottom, After = Top
         switch (logicalSide) {
         case StartSide:
-            return longhand.properties()[RightSide];
+            return shorthand.properties()[RightSide];
         case EndSide:
-            return longhand.properties()[LeftSide];
+            return shorthand.properties()[LeftSide];
         case BeforeSide:
-            return longhand.properties()[BottomSide];
+            return shorthand.properties()[BottomSide];
         default:
-            return longhand.properties()[TopSide];
+            return shorthand.properties()[TopSide];
         }
     }
 
@@ -118,64 +156,64 @@ static int resolveToPhysicalProperty(TextDirection direction, WritingMode writin
         // Start = Bottom, End = Top, Before = Left, After = Right
         switch (logicalSide) {
         case StartSide:
-            return longhand.properties()[BottomSide];
+            return shorthand.properties()[BottomSide];
         case EndSide:
-            return longhand.properties()[TopSide];
+            return shorthand.properties()[TopSide];
         case BeforeSide:
-            return longhand.properties()[LeftSide];
+            return shorthand.properties()[LeftSide];
         default:
-            return longhand.properties()[RightSide];
+            return shorthand.properties()[RightSide];
         }
     }
 
     // Start = Bottom, End = Top, Before = Right, After = Left
     switch (logicalSide) {
     case StartSide:
-        return longhand.properties()[BottomSide];
+        return shorthand.properties()[BottomSide];
     case EndSide:
-        return longhand.properties()[TopSide];
+        return shorthand.properties()[TopSide];
     case BeforeSide:
-        return longhand.properties()[RightSide];
+        return shorthand.properties()[RightSide];
     default:
-        return longhand.properties()[LeftSide];
+        return shorthand.properties()[LeftSide];
     }
 }
 
 enum LogicalExtent { LogicalWidth, LogicalHeight };
 
-static int resolveToPhysicalProperty(WritingMode writingMode, LogicalExtent logicalSide, const int* properties)
+static CSSPropertyID resolveToPhysicalProperty(WritingMode writingMode, LogicalExtent logicalSide, const CSSPropertyID* properties)
 {
     if (writingMode == TopToBottomWritingMode || writingMode == BottomToTopWritingMode)
         return properties[logicalSide];
     return logicalSide == LogicalWidth ? properties[1] : properties[0];
 }
 
-static const CSSPropertyLonghand& borderDirections()
+static const StylePropertyShorthand& borderDirections()
 {
-    static const int properties[4] = { CSSPropertyBorderTop, CSSPropertyBorderRight, CSSPropertyBorderBottom, CSSPropertyBorderLeft };
-    DEFINE_STATIC_LOCAL(CSSPropertyLonghand, borderDirections, (properties, WTF_ARRAY_LENGTH(properties)));
+    static const CSSPropertyID properties[4] = { CSSPropertyBorderTop, CSSPropertyBorderRight, CSSPropertyBorderBottom, CSSPropertyBorderLeft };
+    DEFINE_STATIC_LOCAL(StylePropertyShorthand, borderDirections, (properties, WTF_ARRAY_LENGTH(properties)));
     return borderDirections;
 }
 
-int CSSProperty::resolveDirectionAwareProperty(int propertyID, TextDirection direction, WritingMode writingMode)
+CSSPropertyID CSSProperty::resolveDirectionAwareProperty(CSSPropertyID propertyID, TextDirection direction, WritingMode writingMode)
 {
-    switch (static_cast<CSSPropertyID>(propertyID)) {
+    switch (propertyID) {
     case CSSPropertyWebkitMarginEnd:
-        return resolveToPhysicalProperty(direction, writingMode, EndSide, marginLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, EndSide, marginShorthand());
     case CSSPropertyWebkitMarginStart:
-        return resolveToPhysicalProperty(direction, writingMode, StartSide, marginLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, StartSide, marginShorthand());
     case CSSPropertyWebkitMarginBefore:
-        return resolveToPhysicalProperty(direction, writingMode, BeforeSide, marginLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, BeforeSide, marginShorthand());
     case CSSPropertyWebkitMarginAfter:
-        return resolveToPhysicalProperty(direction, writingMode, AfterSide, marginLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, AfterSide, marginShorthand());
     case CSSPropertyWebkitPaddingEnd:
-        return resolveToPhysicalProperty(direction, writingMode, EndSide, paddingLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, EndSide, paddingShorthand());
     case CSSPropertyWebkitPaddingStart:
-        return resolveToPhysicalProperty(direction, writingMode, StartSide, paddingLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, StartSide, paddingShorthand());
     case CSSPropertyWebkitPaddingBefore:
-        return resolveToPhysicalProperty(direction, writingMode, BeforeSide, paddingLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, BeforeSide, paddingShorthand());
     case CSSPropertyWebkitPaddingAfter:
-        return resolveToPhysicalProperty(direction, writingMode, AfterSide, paddingLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, AfterSide, paddingShorthand());
     case CSSPropertyWebkitBorderEnd:
         return resolveToPhysicalProperty(direction, writingMode, EndSide, borderDirections());
     case CSSPropertyWebkitBorderStart:
@@ -185,51 +223,51 @@ int CSSProperty::resolveDirectionAwareProperty(int propertyID, TextDirection dir
     case CSSPropertyWebkitBorderAfter:
         return resolveToPhysicalProperty(direction, writingMode, AfterSide, borderDirections());
     case CSSPropertyWebkitBorderEndColor:
-        return resolveToPhysicalProperty(direction, writingMode, EndSide, borderColorLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, EndSide, borderColorShorthand());
     case CSSPropertyWebkitBorderStartColor:
-        return resolveToPhysicalProperty(direction, writingMode, StartSide, borderColorLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, StartSide, borderColorShorthand());
     case CSSPropertyWebkitBorderBeforeColor:
-        return resolveToPhysicalProperty(direction, writingMode, BeforeSide, borderColorLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, BeforeSide, borderColorShorthand());
     case CSSPropertyWebkitBorderAfterColor:
-        return resolveToPhysicalProperty(direction, writingMode, AfterSide, borderColorLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, AfterSide, borderColorShorthand());
     case CSSPropertyWebkitBorderEndStyle:
-        return resolveToPhysicalProperty(direction, writingMode, EndSide, borderStyleLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, EndSide, borderStyleShorthand());
     case CSSPropertyWebkitBorderStartStyle:
-        return resolveToPhysicalProperty(direction, writingMode, StartSide, borderStyleLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, StartSide, borderStyleShorthand());
     case CSSPropertyWebkitBorderBeforeStyle:
-        return resolveToPhysicalProperty(direction, writingMode, BeforeSide, borderStyleLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, BeforeSide, borderStyleShorthand());
     case CSSPropertyWebkitBorderAfterStyle:
-        return resolveToPhysicalProperty(direction, writingMode, AfterSide, borderStyleLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, AfterSide, borderStyleShorthand());
     case CSSPropertyWebkitBorderEndWidth:
-        return resolveToPhysicalProperty(direction, writingMode, EndSide, borderWidthLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, EndSide, borderWidthShorthand());
     case CSSPropertyWebkitBorderStartWidth:
-        return resolveToPhysicalProperty(direction, writingMode, StartSide, borderWidthLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, StartSide, borderWidthShorthand());
     case CSSPropertyWebkitBorderBeforeWidth:
-        return resolveToPhysicalProperty(direction, writingMode, BeforeSide, borderWidthLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, BeforeSide, borderWidthShorthand());
     case CSSPropertyWebkitBorderAfterWidth:
-        return resolveToPhysicalProperty(direction, writingMode, AfterSide, borderWidthLonghand());
+        return resolveToPhysicalProperty(direction, writingMode, AfterSide, borderWidthShorthand());
     case CSSPropertyWebkitLogicalWidth: {
-        const int properties[2] = { CSSPropertyWidth, CSSPropertyHeight };
+        const CSSPropertyID properties[2] = { CSSPropertyWidth, CSSPropertyHeight };
         return resolveToPhysicalProperty(writingMode, LogicalWidth, properties);
     }
     case CSSPropertyWebkitLogicalHeight: {
-        const int properties[2] = { CSSPropertyWidth, CSSPropertyHeight };
+        const CSSPropertyID properties[2] = { CSSPropertyWidth, CSSPropertyHeight };
         return resolveToPhysicalProperty(writingMode, LogicalHeight, properties);
     }
     case CSSPropertyWebkitMinLogicalWidth: {
-        const int properties[2] = { CSSPropertyMinWidth, CSSPropertyMinHeight };
+        const CSSPropertyID properties[2] = { CSSPropertyMinWidth, CSSPropertyMinHeight };
         return resolveToPhysicalProperty(writingMode, LogicalWidth, properties);
     }
     case CSSPropertyWebkitMinLogicalHeight: {
-        const int properties[2] = { CSSPropertyMinWidth, CSSPropertyMinHeight };
+        const CSSPropertyID properties[2] = { CSSPropertyMinWidth, CSSPropertyMinHeight };
         return resolveToPhysicalProperty(writingMode, LogicalHeight, properties);
     }
     case CSSPropertyWebkitMaxLogicalWidth: {
-        const int properties[2] = { CSSPropertyMaxWidth, CSSPropertyMaxHeight };
+        const CSSPropertyID properties[2] = { CSSPropertyMaxWidth, CSSPropertyMaxHeight };
         return resolveToPhysicalProperty(writingMode, LogicalWidth, properties);
     }
     case CSSPropertyWebkitMaxLogicalHeight: {
-        const int properties[2] = { CSSPropertyMaxWidth, CSSPropertyMaxHeight };
+        const CSSPropertyID properties[2] = { CSSPropertyMaxWidth, CSSPropertyMaxHeight };
         return resolveToPhysicalProperty(writingMode, LogicalHeight, properties);
     }
     default:
@@ -237,9 +275,9 @@ int CSSProperty::resolveDirectionAwareProperty(int propertyID, TextDirection dir
     }
 }
 
-bool CSSProperty::isInheritedProperty(unsigned propertyID)
+bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
 {
-    switch (static_cast<CSSPropertyID>(propertyID)) {
+    switch (propertyID) {
     case CSSPropertyBorderCollapse:
     case CSSPropertyBorderSpacing:
     case CSSPropertyCaptionSide:
@@ -253,7 +291,13 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     case CSSPropertyFontStyle:
     case CSSPropertyFontVariant:
     case CSSPropertyFontWeight:
+#if ENABLE(CSS_IMAGE_ORIENTATION)
+    case CSSPropertyImageOrientation:
+#endif
     case CSSPropertyImageRendering:
+#if ENABLE(CSS_IMAGE_RESOLUTION)
+    case CSSPropertyImageResolution:
+#endif
     case CSSPropertyLetterSpacing:
     case CSSPropertyLineHeight:
     case CSSPropertyListStyle:
@@ -265,12 +309,16 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     case CSSPropertyQuotes:
     case CSSPropertyResize:
     case CSSPropertySpeak:
+    case CSSPropertyTabSize:
     case CSSPropertyTextAlign:
     case CSSPropertyTextDecoration:
     case CSSPropertyTextIndent:
     case CSSPropertyTextRendering:
     case CSSPropertyTextShadow:
     case CSSPropertyTextTransform:
+#if ENABLE(CSS_VARIABLES)
+    case CSSPropertyVariable:
+#endif
     case CSSPropertyVisibility:
     case CSSPropertyWebkitAspectRatio:
     case CSSPropertyWebkitBorderHorizontalSpacing:
@@ -300,6 +348,9 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     case CSSPropertyWebkitPrintColorAdjust:
     case CSSPropertyWebkitRtlOrdering:
     case CSSPropertyWebkitTextCombine:
+#if ENABLE(CSS3_TEXT_DECORATION)
+    case CSSPropertyWebkitTextDecorationLine:
+#endif // CSS3_TEXT_DECORATION
     case CSSPropertyWebkitTextDecorationsInEffect:
     case CSSPropertyWebkitTextEmphasis:
     case CSSPropertyWebkitTextEmphasisColor:
@@ -425,6 +476,7 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     case CSSPropertyOutlineStyle:
     case CSSPropertyOutlineWidth:
     case CSSPropertyOverflow:
+    case CSSPropertyOverflowWrap:
     case CSSPropertyOverflowX:
     case CSSPropertyOverflowY:
     case CSSPropertyPadding:
@@ -498,6 +550,9 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     case CSSPropertyWebkitBorderStartStyle:
     case CSSPropertyWebkitBorderStartWidth:
     case CSSPropertyWebkitBoxAlign:
+#if ENABLE(CSS_BOX_DECORATION_BREAK)
+    case CSSPropertyWebkitBoxDecorationBreak:
+#endif
     case CSSPropertyWebkitBoxFlex:
     case CSSPropertyWebkitBoxFlexGroup:
     case CSSPropertyWebkitBoxLines:
@@ -506,12 +561,14 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     case CSSPropertyWebkitBoxPack:
     case CSSPropertyWebkitBoxReflect:
     case CSSPropertyWebkitBoxShadow:
+    case CSSPropertyWebkitClipPath:
     case CSSPropertyWebkitColumnAxis:
     case CSSPropertyWebkitColumnBreakAfter:
     case CSSPropertyWebkitColumnBreakBefore:
     case CSSPropertyWebkitColumnBreakInside:
     case CSSPropertyWebkitColumnCount:
     case CSSPropertyWebkitColumnGap:
+    case CSSPropertyWebkitColumnProgression:
     case CSSPropertyWebkitColumnRule:
     case CSSPropertyWebkitColumnRuleColor:
     case CSSPropertyWebkitColumnRuleStyle:
@@ -522,22 +579,26 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
 #if ENABLE(CSS_FILTERS)
     case CSSPropertyWebkitFilter:
 #endif
-    case CSSPropertyWebkitFlexOrder:
-    case CSSPropertyWebkitFlexPack:
-    case CSSPropertyWebkitFlexAlign:
-    case CSSPropertyWebkitFlexItemAlign:
+#if ENABLE(CSS_COMPOSITING)
+    case CSSPropertyWebkitBlendMode:
+#endif
+    case CSSPropertyWebkitAlignContent:
+    case CSSPropertyWebkitAlignItems:
+    case CSSPropertyWebkitAlignSelf:
+    case CSSPropertyWebkitFlex:
+    case CSSPropertyWebkitFlexBasis:
     case CSSPropertyWebkitFlexDirection:
     case CSSPropertyWebkitFlexFlow:
-    case CSSPropertyWebkitFlexLinePack:
+    case CSSPropertyWebkitFlexGrow:
+    case CSSPropertyWebkitFlexShrink:
     case CSSPropertyWebkitFlexWrap:
+    case CSSPropertyWebkitJustifyContent:
+    case CSSPropertyWebkitOrder:
     case CSSPropertyWebkitFontSizeDelta:
-#if ENABLE(CSS_GRID_LAYOUT)
     case CSSPropertyWebkitGridColumns:
     case CSSPropertyWebkitGridRows:
-
     case CSSPropertyWebkitGridColumn:
     case CSSPropertyWebkitGridRow:
-#endif
     case CSSPropertyWebkitLineClamp:
     case CSSPropertyWebkitLogicalWidth:
     case CSSPropertyWebkitLogicalHeight:
@@ -575,7 +636,6 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     case CSSPropertyWebkitMaskRepeatX:
     case CSSPropertyWebkitMaskRepeatY:
     case CSSPropertyWebkitMaskSize:
-    case CSSPropertyWebkitMatchNearestMailBlockquoteColor:
     case CSSPropertyWebkitMaxLogicalWidth:
     case CSSPropertyWebkitMaxLogicalHeight:
     case CSSPropertyWebkitMinLogicalWidth:
@@ -588,6 +648,9 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     case CSSPropertyWebkitPerspectiveOrigin:
     case CSSPropertyWebkitPerspectiveOriginX:
     case CSSPropertyWebkitPerspectiveOriginY:
+#if ENABLE(CSS3_TEXT_DECORATION)
+    case CSSPropertyWebkitTextDecorationStyle:
+#endif // CSS3_TEXT_DECORATION
     case CSSPropertyWebkitTransform:
     case CSSPropertyWebkitTransformOrigin:
     case CSSPropertyWebkitTransformOriginX:
@@ -600,19 +663,23 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     case CSSPropertyWebkitTransitionProperty:
     case CSSPropertyWebkitTransitionTimingFunction:
     case CSSPropertyWebkitUserDrag:
+#if ENABLE(CSS_REGIONS)
     case CSSPropertyWebkitFlowInto:
     case CSSPropertyWebkitFlowFrom:
     case CSSPropertyWebkitRegionOverflow:
     case CSSPropertyWebkitRegionBreakAfter:
     case CSSPropertyWebkitRegionBreakBefore:
     case CSSPropertyWebkitRegionBreakInside:
+#endif
+#if ENABLE(CSS_EXCLUSIONS)
     case CSSPropertyWebkitWrap:
     case CSSPropertyWebkitWrapFlow:
     case CSSPropertyWebkitWrapMargin:
     case CSSPropertyWebkitWrapPadding:
-    case CSSPropertyWebkitWrapShapeInside:
-    case CSSPropertyWebkitWrapShapeOutside:
+    case CSSPropertyWebkitShapeInside:
+    case CSSPropertyWebkitShapeOutside:
     case CSSPropertyWebkitWrapThrough:
+#endif
 #if ENABLE(SVG)
     case CSSPropertyClipPath:
     case CSSPropertyMask:
@@ -633,6 +700,9 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
 #if ENABLE(DASHBOARD_SUPPORT)
     case CSSPropertyWebkitDashboardRegion:
 #endif
+#if ENABLE(WIDGET_REGION)
+    case CSSPropertyWebkitWidgetRegion:
+#endif
         return false;
     case CSSPropertyInvalid:
         ASSERT_NOT_REACHED();
@@ -642,4 +712,10 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     return false;
 }
 
+void CSSProperty::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
+    info.addInstrumentedMember(m_value);
+}
+
 } // namespace WebCore