| Index: third_party/WebKit/Source/core/css/CSSValue.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/CSSValue.cpp b/third_party/WebKit/Source/core/css/CSSValue.cpp
|
| index 7068c15edec788bd42723cf43d86e6ac400d1659..58cf530801f8acae073547c827dc3e1ac0e2701c 100644
|
| --- a/third_party/WebKit/Source/core/css/CSSValue.cpp
|
| +++ b/third_party/WebKit/Source/core/css/CSSValue.cpp
|
| @@ -59,6 +59,8 @@
|
| #include "core/css/CSSValueList.h"
|
| #include "core/css/CSSValuePair.h"
|
| #include "core/css/CSSVariableReferenceValue.h"
|
| +#include "core/css/serializer/CSSDeserializeStream.h"
|
| +#include "core/css/serializer/CSSSerializeStream.h"
|
|
|
| namespace blink {
|
|
|
| @@ -266,6 +268,265 @@ String CSSValue::cssText() const
|
| return String();
|
| }
|
|
|
| +PassRefPtrWillBeRawPtr<CSSValue> CSSValue::deserialize(CSSDeserializeStream* stream)
|
| +{
|
| + aaaa b;
|
| + b.m_bitfields = stream->readUnsigned();
|
| + if (b.m_bitfields == 0xffffffff) {
|
| + CSDEBUG("CSSValue::deserialize <nullptr>\n");
|
| + return nullptr;
|
| + }
|
| + CSDEBUG("CSSValue::deserialize type: %d\n", b.m_classType);
|
| + switch (b.m_classType) {
|
| + /*
|
| + case BasicShapeCircleClass:
|
| + return CSSBasicShapeCircleValue::deserializeAfterDispatch(stream);
|
| + case BasicShapeEllipseClass:
|
| + return CSSBasicShapeEllipseValue::deserializeAfterDispatch(stream);
|
| + case BasicShapePolygonClass:
|
| + return CSSBasicShapePolygonValue::deserializeAfterDispatch(stream);
|
| + case BasicShapeInsetClass:
|
| + return CSSBasicShapeInsetValue::deserializeAfterDispatch(stream);
|
| + case BorderImageSliceClass:
|
| + return CSSBorderImageSliceValue::deserializeAfterDispatch(stream);
|
| + */
|
| + case ColorClass:
|
| + return CSSColorValue::deserializeAfterDispatch(stream);
|
| + case CounterClass:
|
| + return CSSCounterValue::deserializeAfterDispatch(stream);
|
| + /*
|
| + case CursorImageClass:
|
| + return CSSCursorImageValue::deserializeAfterDispatch(stream);
|
| + */
|
| + case FontFaceSrcClass:
|
| + return CSSFontFaceSrcValue::deserializeAfterDispatch(stream);
|
| + case FontFeatureClass:
|
| + return CSSFontFeatureValue::deserializeAfterDispatch(stream);
|
| + case FunctionClass:
|
| + return CSSFunctionValue::deserializeAfterDispatch(b.m_bitfields, stream);
|
| + case LinearGradientClass:
|
| + return CSSLinearGradientValue::deserializeAfterDispatch(stream);
|
| + case RadialGradientClass:
|
| + return CSSRadialGradientValue::deserializeAfterDispatch(stream);
|
| + /*
|
| + case CrossfadeClass:
|
| + return CSSCrossfadeValue::deserializeAfterDispatch(stream);
|
| + */
|
| + case CustomIdentClass:
|
| + return CSSCustomIdentValue::deserializeAfterDispatch(stream);
|
| + case ImageClass:
|
| + return CSSImageValue::deserializeAfterDispatch(stream);
|
| + case InheritedClass:
|
| + return CSSInheritedValue::deserializeAfterDispatch(stream);
|
| + /*
|
| + case UnsetClass:
|
| + return CSSUnsetValue::deserializeAfterDispatch(stream);
|
| + */
|
| + case InitialClass:
|
| + return CSSInitialValue::deserializeAfterDispatch(stream);
|
| + /*
|
| + case GridLineNamesClass:
|
| + return CSSGridLineNamesValue::deserializeAfterDispatch(stream);
|
| + case GridTemplateAreasClass:
|
| + return CSSGridTemplateAreasValue::deserializeAfterDispatch(stream);
|
| + case PathClass:
|
| + return CSSPathValue::deserializeAfterDispatch(stream);
|
| + */
|
| + case PrimitiveClass:
|
| + return CSSPrimitiveValue::deserializeAfterDispatch(stream);
|
| + case QuadClass:
|
| + return CSSQuadValue::deserializeAfterDispatch(stream);
|
| + /*
|
| + case ReflectClass:
|
| + return CSSReflectValue::deserializeAfterDispatch(stream);
|
| + */
|
| + case ShadowClass:
|
| + return CSSShadowValue::deserializeAfterDispatch(stream);
|
| + case StringClass:
|
| + return CSSStringValue::deserializeAfterDispatch(stream);
|
| + case CubicBezierTimingFunctionClass:
|
| + return CSSCubicBezierTimingFunctionValue::deserializeAfterDispatch(stream);
|
| + case StepsTimingFunctionClass:
|
| + return CSSStepsTimingFunctionValue::deserializeAfterDispatch(stream);
|
| + case UnicodeRangeClass:
|
| + return CSSUnicodeRangeValue::deserializeAfterDispatch(stream);
|
| + /*
|
| + case URIClass:
|
| + return CSSURIValue::deserializeAfterDispatch(stream);
|
| + */
|
| + case ValuePairClass:
|
| + return CSSValuePair::deserializeAfterDispatch(stream);
|
| + case ValueListClass:
|
| + return CSSValueList::deserializeAfterDispatch(b.m_bitfields, stream);
|
| + case ImageSetClass:
|
| + return CSSImageSetValue::deserializeAfterDispatch(b.m_bitfields, stream);
|
| + /*
|
| + case CSSSVGDocumentClass:
|
| + return CSSSVGDocumentValue::deserializeAfterDispatch(stream);
|
| + case CSSContentDistributionClass:
|
| + return CSSContentDistributionValue::deserializeAfterDispatch(stream);
|
| + case VariableReferenceClass:
|
| + return CSSVariableReferenceValue::deserializeAfterDispatch(stream);
|
| + case CustomPropertyDeclarationClass:
|
| + return toCSSCustomPropertyDeclaration(this)->customCSSText();
|
| + */
|
| + default:
|
| + ASSERT_NOT_REACHED();
|
| + return nullptr;
|
| + }
|
| +}
|
| +
|
| +void CSSSerializeTrait<CSSValue>::serializeNull(CSSSerializeStream* stream)
|
| +{
|
| + stream->writeUnsigned(0xffffffff);
|
| +}
|
| +
|
| +void CSSValue::serialize(CSSSerializeStream* stream) const
|
| +{
|
| + if (reinterpret_cast<uintptr_t>(this) < 0x4) {
|
| + CSDEBUG("CSSValue::serialize <nullptr>\n");
|
| + stream->writeUnsigned(0xffffffff);
|
| + return;
|
| + }
|
| + CSDEBUG("CSSValue::serialize type(%d)\n", classType()); CSSHOW(cssText());
|
| +
|
| + stream->writeUnsigned(m_bitfields);
|
| + switch (classType()) {
|
| + default:
|
| + ASSERT_NOT_REACHED();
|
| + return;
|
| + /*
|
| + case BasicShapeCircleClass:
|
| + toCSSBasicShapeCircleValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case BasicShapeEllipseClass:
|
| + toCSSBasicShapeEllipseValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case BasicShapePolygonClass:
|
| + toCSSBasicShapePolygonValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case BasicShapeInsetClass:
|
| + toCSSBasicShapeInsetValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case BorderImageSliceClass:
|
| + toCSSBorderImageSliceValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + */
|
| + case ColorClass:
|
| + toCSSColorValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case CounterClass:
|
| + toCSSCounterValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + /*
|
| + case CursorImageClass:
|
| + toCSSCursorImageValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + */
|
| + case FontFaceSrcClass:
|
| + toCSSFontFaceSrcValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case FontFeatureClass:
|
| + toCSSFontFeatureValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case FunctionClass:
|
| + toCSSFunctionValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case LinearGradientClass:
|
| + toCSSLinearGradientValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case RadialGradientClass:
|
| + toCSSRadialGradientValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + /*
|
| + case CrossfadeClass:
|
| + toCSSCrossfadeValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + */
|
| + case CustomIdentClass:
|
| + toCSSCustomIdentValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case ImageClass:
|
| + toCSSImageValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case InheritedClass:
|
| + toCSSInheritedValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case InitialClass:
|
| + toCSSInitialValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + /*
|
| + case UnsetClass:
|
| + toCSSUnsetValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case GridLineNamesClass:
|
| + toCSSGridLineNamesValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case GridTemplateAreasClass:
|
| + toCSSGridTemplateAreasValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case PathClass:
|
| + toCSSPathValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + */
|
| + case PrimitiveClass:
|
| + toCSSPrimitiveValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case QuadClass:
|
| + toCSSQuadValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + /*
|
| + case ReflectClass:
|
| + toCSSReflectValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + */
|
| + case ShadowClass:
|
| + toCSSShadowValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case StringClass:
|
| + toCSSStringValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case CubicBezierTimingFunctionClass:
|
| + toCSSCubicBezierTimingFunctionValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case StepsTimingFunctionClass:
|
| + toCSSStepsTimingFunctionValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case UnicodeRangeClass:
|
| + toCSSUnicodeRangeValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + /*
|
| + case URIClass:
|
| + toCSSURIValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + */
|
| + case ValuePairClass:
|
| + toCSSValuePair(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case ValueListClass:
|
| + toCSSValueList(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case ImageSetClass:
|
| + toCSSImageSetValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + /*
|
| + case CSSSVGDocumentClass:
|
| + toCSSSVGDocumentValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case CSSContentDistributionClass:
|
| + toCSSContentDistributionValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case VariableReferenceClass:
|
| + toCSSVariableReferenceValue(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + case CustomPropertyDeclarationClass:
|
| + toCSSCustomPropertyDeclaration(this)->serializeAfterDispatch(stream);
|
| + return;
|
| + */
|
| + }
|
| + ASSERT_NOT_REACHED();
|
| +}
|
| +
|
| void CSSValue::destroy()
|
| {
|
| switch (classType()) {
|
|
|