diff options
Diffstat (limited to 'Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp')
| -rw-r--r-- | Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp | 76 |
1 files changed, 23 insertions, 53 deletions
diff --git a/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp b/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp index 20ded8b8b..aed179b9c 100644 --- a/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp +++ b/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp @@ -2,13 +2,12 @@ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2004, 2005, 2007 Rob Buis <buis@kde.org> Copyright (C) Research In Motion Limited 2010. All rights reserved. - Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved. Based on khtml code by: Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) Copyright (C) 2002-2003 Dirk Mueller (mueller@kde.org) - Copyright (C) 2002 Apple Inc. + Copyright (C) 2002 Apple Computer, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -27,11 +26,12 @@ */ #include "config.h" + +#if ENABLE(SVG) #include "SVGRenderStyleDefs.h" #include "RenderStyle.h" #include "SVGRenderStyle.h" -#include <wtf/PointerComparison.h> namespace WebCore { @@ -58,7 +58,7 @@ inline StyleFillData::StyleFillData(const StyleFillData& other) { } -Ref<StyleFillData> StyleFillData::copy() const +PassRef<StyleFillData> StyleFillData::copy() const { return adoptRef(*new StyleFillData(*this)); } @@ -77,8 +77,8 @@ bool StyleFillData::operator==(const StyleFillData& other) const StyleStrokeData::StyleStrokeData() : opacity(SVGRenderStyle::initialStrokeOpacity()) , miterLimit(SVGRenderStyle::initialStrokeMiterLimit()) - , width(RenderStyle::initialOneLength()) - , dashOffset(RenderStyle::initialZeroLength()) + , width(SVGRenderStyle::initialStrokeWidth()) + , dashOffset(SVGRenderStyle::initialStrokeDashOffset()) , dashArray(SVGRenderStyle::initialStrokeDashArray()) , paintType(SVGRenderStyle::initialStrokePaintType()) , paintColor(SVGRenderStyle::initialStrokePaintColor()) @@ -105,7 +105,7 @@ inline StyleStrokeData::StyleStrokeData(const StyleStrokeData& other) { } -Ref<StyleStrokeData> StyleStrokeData::copy() const +PassRef<StyleStrokeData> StyleStrokeData::copy() const { return adoptRef(*new StyleStrokeData(*this)); } @@ -138,7 +138,7 @@ inline StyleStopData::StyleStopData(const StyleStopData& other) { } -Ref<StyleStopData> StyleStopData::copy() const +PassRef<StyleStopData> StyleStopData::copy() const { return adoptRef(*new StyleStopData(*this)); } @@ -160,7 +160,7 @@ inline StyleTextData::StyleTextData(const StyleTextData& other) { } -Ref<StyleTextData> StyleTextData::copy() const +PassRef<StyleTextData> StyleTextData::copy() const { return adoptRef(*new StyleTextData(*this)); } @@ -187,7 +187,7 @@ inline StyleMiscData::StyleMiscData(const StyleMiscData& other) { } -Ref<StyleMiscData> StyleMiscData::copy() const +PassRef<StyleMiscData> StyleMiscData::copy() const { return adoptRef(*new StyleMiscData(*this)); } @@ -206,22 +206,27 @@ StyleShadowSVGData::StyleShadowSVGData() inline StyleShadowSVGData::StyleShadowSVGData(const StyleShadowSVGData& other) : RefCounted<StyleShadowSVGData>() - , shadow(other.shadow ? std::make_unique<ShadowData>(*other.shadow) : nullptr) + , shadow(other.shadow ? adoptPtr(new ShadowData(*other.shadow)) : nullptr) { } -Ref<StyleShadowSVGData> StyleShadowSVGData::copy() const +PassRef<StyleShadowSVGData> StyleShadowSVGData::copy() const { return adoptRef(*new StyleShadowSVGData(*this)); } bool StyleShadowSVGData::operator==(const StyleShadowSVGData& other) const { - return arePointingToEqualData(shadow, other.shadow); + if ((!shadow && other.shadow) || (shadow && !other.shadow)) + return false; + if (shadow && other.shadow && (*shadow != *other.shadow)) + return false; + return true; } StyleResourceData::StyleResourceData() : clipper(SVGRenderStyle::initialClipperResource()) + , filter(SVGRenderStyle::initialFilterResource()) , masker(SVGRenderStyle::initialMaskerResource()) { } @@ -229,11 +234,12 @@ StyleResourceData::StyleResourceData() inline StyleResourceData::StyleResourceData(const StyleResourceData& other) : RefCounted<StyleResourceData>() , clipper(other.clipper) + , filter(other.filter) , masker(other.masker) { } -Ref<StyleResourceData> StyleResourceData::copy() const +PassRef<StyleResourceData> StyleResourceData::copy() const { return adoptRef(*new StyleResourceData(*this)); } @@ -241,6 +247,7 @@ Ref<StyleResourceData> StyleResourceData::copy() const bool StyleResourceData::operator==(const StyleResourceData& other) const { return clipper == other.clipper + && filter == other.filter && masker == other.masker; } @@ -259,7 +266,7 @@ inline StyleInheritedResourceData::StyleInheritedResourceData(const StyleInherit { } -Ref<StyleInheritedResourceData> StyleInheritedResourceData::copy() const +PassRef<StyleInheritedResourceData> StyleInheritedResourceData::copy() const { return adoptRef(*new StyleInheritedResourceData(*this)); } @@ -271,43 +278,6 @@ bool StyleInheritedResourceData::operator==(const StyleInheritedResourceData& ot && markerEnd == other.markerEnd; } -StyleLayoutData::StyleLayoutData() - : cx(RenderStyle::initialZeroLength()) - , cy(RenderStyle::initialZeroLength()) - , r(RenderStyle::initialZeroLength()) - , rx(RenderStyle::initialZeroLength()) - , ry(RenderStyle::initialZeroLength()) - , x(RenderStyle::initialZeroLength()) - , y(RenderStyle::initialZeroLength()) -{ -} - -inline StyleLayoutData::StyleLayoutData(const StyleLayoutData& other) - : RefCounted<StyleLayoutData>() - , cx(other.cx) - , cy(other.cy) - , r(other.r) - , rx(other.rx) - , ry(other.ry) - , x(other.x) - , y(other.y) -{ -} - -Ref<StyleLayoutData> StyleLayoutData::copy() const -{ - return adoptRef(*new StyleLayoutData(*this)); -} - -bool StyleLayoutData::operator==(const StyleLayoutData& other) const -{ - return cx == other.cx - && cy == other.cy - && r == other.r - && rx == other.rx - && ry == other.ry - && x == other.x - && y == other.y; } -} +#endif // ENABLE(SVG) |
