Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (163315 => 163316)
--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp 2014-02-03 18:38:54 UTC (rev 163315)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp 2014-02-03 18:52:12 UTC (rev 163316)
@@ -66,6 +66,7 @@
#include "RenderSVGImage.h"
#include "RenderSVGInlineText.h"
#include "RenderSVGPath.h"
+#include "RenderSVGResourceContainer.h"
#include "RenderSVGRoot.h"
#include "RenderSVGText.h"
#include "SVGRenderTreeAsText.h"
@@ -518,11 +519,11 @@
return;
}
if (o.isSVGResourceContainer()) {
- writeSVGResourceContainer(ts, o, indent);
+ writeSVGResourceContainer(ts, toRenderSVGResourceContainer(o), indent);
return;
}
if (o.isSVGContainer()) {
- writeSVGContainer(ts, o, indent);
+ writeSVGContainer(ts, toRenderSVGContainer(o), indent);
return;
}
if (o.isSVGRoot()) {
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (163315 => 163316)
--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp 2014-02-03 18:38:54 UTC (rev 163315)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp 2014-02-03 18:52:12 UTC (rev 163316)
@@ -35,6 +35,7 @@
#include "HTMLNames.h"
#include "NodeRenderStyle.h"
#include "RenderImage.h"
+#include "RenderIterator.h"
#include "RenderSVGGradientStop.h"
#include "RenderSVGImage.h"
#include "RenderSVGPath.h"
@@ -250,17 +251,17 @@
ts << " [id=\"" << element.getIdAttribute() << "\"]";
}
-static void writeStyle(TextStream& ts, const RenderObject& object)
+static void writeStyle(TextStream& ts, const RenderElement& renderer)
{
- const RenderStyle& style = object.style();
+ const RenderStyle& style = renderer.style();
const SVGRenderStyle& svgStyle = style.svgStyle();
- if (!object.localTransform().isIdentity())
- writeNameValuePair(ts, "transform", object.localTransform());
+ if (!renderer.localTransform().isIdentity())
+ writeNameValuePair(ts, "transform", renderer.localTransform());
writeIfNotDefault(ts, "image rendering", style.imageRendering(), RenderStyle::initialImageRendering());
writeIfNotDefault(ts, "opacity", style.opacity(), RenderStyle::initialOpacity());
- if (object.isSVGShape()) {
- const RenderSVGShape& shape = static_cast<const RenderSVGShape&>(object);
+ if (renderer.isSVGShape()) {
+ const auto& shape = toRenderSVGShape(renderer);
Color fallbackColor;
if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(const_cast<RenderSVGShape&>(shape), shape.style(), fallbackColor)) {
@@ -307,10 +308,10 @@
writeIfNotEmpty(ts, "end marker", svgStyle.markerEndResource());
}
-static TextStream& writePositionAndStyle(TextStream& ts, const RenderObject& object)
+static TextStream& writePositionAndStyle(TextStream& ts, const RenderElement& renderer)
{
- ts << " " << enclosingIntRect(const_cast<RenderObject&>(object).absoluteClippedOverflowRect());
- writeStyle(ts, object);
+ ts << " " << enclosingIntRect(renderer.absoluteClippedOverflowRect());
+ writeStyle(ts, renderer);
return ts;
}
@@ -451,10 +452,10 @@
ts << " {" << object.node()->nodeName() << "}";
}
-static void writeChildren(TextStream& ts, const RenderObject& object, int indent)
+static void writeChildren(TextStream& ts, const RenderElement& parent, int indent)
{
- for (RenderObject* child = object.firstChildSlow(); child; child = child->nextSibling())
- write(ts, *child, indent + 1);
+ for (const auto& child : childrenOfType<RenderObject>(parent))
+ write(ts, child, indent + 1);
}
static inline void writeCommonGradientProperties(TextStream& ts, SVGSpreadMethodType spreadMethod, const AffineTransform& gradientTransform, SVGUnitTypes::SVGUnitType gradientUnits)
@@ -468,16 +469,13 @@
ts << " [gradientTransform=" << gradientTransform << "]";
}
-void writeSVGResourceContainer(TextStream& ts, const RenderObject& object, int indent)
+void writeSVGResourceContainer(TextStream& ts, const RenderSVGResourceContainer& resource, int indent)
{
- writeStandardPrefix(ts, object, indent);
+ writeStandardPrefix(ts, resource, indent);
- Element* element = toElement(object.node());
- const AtomicString& id = element->getIdAttribute();
+ const AtomicString& id = resource.element().getIdAttribute();
writeNameAndQuotedValue(ts, "id", id);
- const auto& resource = toRenderSVGResourceContainer(object);
-
if (resource.resourceType() == MaskerResourceType) {
const auto& masker = static_cast<const RenderSVGResourceMasker&>(resource);
writeNameValuePair(ts, "maskUnits", masker.maskUnits());
@@ -552,10 +550,10 @@
ts << " [center=" << centerPoint << "] [focal=" << focalPoint << "] [radius=" << radius << "] [focalRadius=" << focalRadius << "]\n";
} else
ts << "\n";
- writeChildren(ts, object, indent);
+ writeChildren(ts, resource, indent);
}
-void writeSVGContainer(TextStream& ts, const RenderObject& container, int indent)
+void writeSVGContainer(TextStream& ts, const RenderSVGContainer& container, int indent)
{
// Currently RenderSVGResourceFilterPrimitive has no meaningful output.
if (container.isSVGResourceFilterPrimitive())
@@ -616,16 +614,15 @@
ts << " [offset=" << stopElement->offset() << "] [color=" << stopElement->stopColorIncludingOpacity() << "]\n";
}
-void writeResources(TextStream& ts, const RenderObject& object, int indent)
+void writeResources(TextStream& ts, const RenderObject& renderer, int indent)
{
- const RenderStyle& style = object.style();
+ const RenderStyle& style = renderer.style();
const SVGRenderStyle& svgStyle = style.svgStyle();
// FIXME: We want to use SVGResourcesCache to determine which resources are present, instead of quering the resource <-> id cache.
// For now leave the DRT output as is, but later on we should change this so cycles are properly ignored in the DRT output.
- RenderObject& renderer = const_cast<RenderObject&>(object);
if (!svgStyle.maskerResource().isEmpty()) {
- if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(object.document(), svgStyle.maskerResource())) {
+ if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(renderer.document(), svgStyle.maskerResource())) {
writeIndent(ts, indent);
ts << " ";
writeNameAndQuotedValue(ts, "masker", svgStyle.maskerResource());
@@ -635,7 +632,7 @@
}
}
if (!svgStyle.clipperResource().isEmpty()) {
- if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(object.document(), svgStyle.clipperResource())) {
+ if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(renderer.document(), svgStyle.clipperResource())) {
writeIndent(ts, indent);
ts << " ";
writeNameAndQuotedValue(ts, "clipPath", svgStyle.clipperResource());
@@ -646,7 +643,7 @@
}
#if ENABLE(FILTERS)
if (!svgStyle.filterResource().isEmpty()) {
- if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(object.document(), svgStyle.filterResource())) {
+ if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(renderer.document(), svgStyle.filterResource())) {
writeIndent(ts, indent);
ts << " ";
writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource());
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h (163315 => 163316)
--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h 2014-02-03 18:38:54 UTC (rev 163315)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h 2014-02-03 18:52:12 UTC (rev 163316)
@@ -38,9 +38,11 @@
class Node;
class RenderImage;
class RenderObject;
+class RenderSVGContainer;
class RenderSVGGradientStop;
class RenderSVGImage;
class RenderSVGInlineText;
+class RenderSVGResourceContainer;
class RenderSVGShape;
class RenderSVGRoot;
class RenderSVGText;
@@ -51,8 +53,8 @@
void write(TextStream&, const RenderSVGShape&, int indent);
void write(TextStream&, const RenderSVGRoot&, int indent);
void writeSVGGradientStop(TextStream&, const RenderSVGGradientStop&, int indent);
-void writeSVGResourceContainer(TextStream&, const RenderObject&, int indent);
-void writeSVGContainer(TextStream&, const RenderObject&, int indent);
+void writeSVGResourceContainer(TextStream&, const RenderSVGResourceContainer&, int indent);
+void writeSVGContainer(TextStream&, const RenderSVGContainer&, int indent);
void writeSVGImage(TextStream&, const RenderSVGImage&, int indent);
void writeSVGInlineText(TextStream&, const RenderSVGInlineText&, int indent);
void writeSVGText(TextStream&, const RenderSVGText&, int indent);