summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/style/SVGRenderStyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/style/SVGRenderStyle.cpp')
-rw-r--r--Source/WebCore/rendering/style/SVGRenderStyle.cpp67
1 files changed, 11 insertions, 56 deletions
diff --git a/Source/WebCore/rendering/style/SVGRenderStyle.cpp b/Source/WebCore/rendering/style/SVGRenderStyle.cpp
index df79aff65..06c793f69 100644
--- a/Source/WebCore/rendering/style/SVGRenderStyle.cpp
+++ b/Source/WebCore/rendering/style/SVGRenderStyle.cpp
@@ -7,7 +7,7 @@
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
@@ -26,6 +26,8 @@
*/
#include "config.h"
+
+#if ENABLE(SVG)
#include "SVGRenderStyle.h"
#include "CSSPrimitiveValue.h"
@@ -43,7 +45,7 @@ static const SVGRenderStyle& defaultSVGStyle()
return *style.get().get();
}
-Ref<SVGRenderStyle> SVGRenderStyle::createDefaultStyle()
+PassRef<SVGRenderStyle> SVGRenderStyle::createDefaultStyle()
{
return adoptRef(*new SVGRenderStyle(CreateDefault));
}
@@ -56,7 +58,6 @@ SVGRenderStyle::SVGRenderStyle()
, stops(defaultSVGStyle().stops)
, misc(defaultSVGStyle().misc)
, shadowSVG(defaultSVGStyle().shadowSVG)
- , layout(defaultSVGStyle().layout)
, resources(defaultSVGStyle().resources)
{
setBitDefaults();
@@ -70,7 +71,6 @@ SVGRenderStyle::SVGRenderStyle(CreateDefaultType)
, stops(StyleStopData::create())
, misc(StyleMiscData::create())
, shadowSVG(StyleShadowSVGData::create())
- , layout(StyleLayoutData::create())
, resources(StyleResourceData::create())
{
setBitDefaults();
@@ -87,12 +87,11 @@ inline SVGRenderStyle::SVGRenderStyle(const SVGRenderStyle& other)
, stops(other.stops)
, misc(other.misc)
, shadowSVG(other.shadowSVG)
- , layout(other.layout)
, resources(other.resources)
{
}
-Ref<SVGRenderStyle> SVGRenderStyle::copy() const
+PassRef<SVGRenderStyle> SVGRenderStyle::copy() const
{
return adoptRef(*new SVGRenderStyle(*this));
}
@@ -109,7 +108,6 @@ bool SVGRenderStyle::operator==(const SVGRenderStyle& other) const
&& stops == other.stops
&& misc == other.misc
&& shadowSVG == other.shadowSVG
- && layout == other.layout
&& inheritedResources == other.inheritedResources
&& resources == other.resources
&& svg_inherited_flags == other.svg_inherited_flags
@@ -144,50 +142,9 @@ void SVGRenderStyle::copyNonInheritedFrom(const SVGRenderStyle* other)
stops = other->stops;
misc = other->misc;
shadowSVG = other->shadowSVG;
- layout = other->layout;
resources = other->resources;
}
-Vector<PaintType, 3> SVGRenderStyle::paintTypesForPaintOrder() const
-{
- Vector<PaintType, 3> paintOrder;
- switch (this->paintOrder()) {
- case PaintOrderNormal:
- FALLTHROUGH;
- case PaintOrderFill:
- paintOrder.append(PaintTypeFill);
- paintOrder.append(PaintTypeStroke);
- paintOrder.append(PaintTypeMarkers);
- break;
- case PaintOrderFillMarkers:
- paintOrder.append(PaintTypeFill);
- paintOrder.append(PaintTypeMarkers);
- paintOrder.append(PaintTypeStroke);
- break;
- case PaintOrderStroke:
- paintOrder.append(PaintTypeStroke);
- paintOrder.append(PaintTypeFill);
- paintOrder.append(PaintTypeMarkers);
- break;
- case PaintOrderStrokeMarkers:
- paintOrder.append(PaintTypeStroke);
- paintOrder.append(PaintTypeMarkers);
- paintOrder.append(PaintTypeFill);
- break;
- case PaintOrderMarkers:
- paintOrder.append(PaintTypeMarkers);
- paintOrder.append(PaintTypeFill);
- paintOrder.append(PaintTypeStroke);
- break;
- case PaintOrderMarkersStroke:
- paintOrder.append(PaintTypeMarkers);
- paintOrder.append(PaintTypeStroke);
- paintOrder.append(PaintTypeFill);
- break;
- };
- return paintOrder;
-}
-
StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
{
// NOTE: All comparisions that may return StyleDifferenceLayout have to go before those who return StyleDifferenceRepaint
@@ -228,10 +185,6 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
if (shadowSVG != other->shadowSVG)
return StyleDifferenceLayout;
- // The x or y properties require relayout.
- if (layout != other->layout)
- return StyleDifferenceLayout;
-
// Some stroke properties, requires relayouts, as the cached stroke boundaries need to be recalculated.
if (stroke != other->stroke) {
if (stroke->width != other->stroke->width
@@ -251,10 +204,6 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
return StyleDifferenceRepaint;
}
- // vector-effect changes require a re-layout.
- if (svg_noninherited_flags.f._vectorEffect != other->svg_noninherited_flags.f._vectorEffect)
- return StyleDifferenceLayout;
-
// NOTE: All comparisions below may only return StyleDifferenceRepaint
// Painting related properties only need repaints.
@@ -283,6 +232,10 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
|| svg_inherited_flags._colorInterpolationFilters != other->svg_inherited_flags._colorInterpolationFilters)
return StyleDifferenceRepaint;
+ // FIXME: vector-effect is not taken into account in the layout-phase. Once this is fixed, we should relayout here.
+ if (svg_noninherited_flags.f._vectorEffect != other->svg_noninherited_flags.f._vectorEffect)
+ return StyleDifferenceRepaint;
+
if (svg_noninherited_flags.f.bufferedRendering != other->svg_noninherited_flags.f.bufferedRendering)
return StyleDifferenceRepaint;
@@ -293,3 +246,5 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
}
}
+
+#endif // ENABLE(SVG)