<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[193614] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/193614">193614</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-12-06 22:27:48 -0800 (Sun, 06 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Show more information about SVG renderers in showLayerTree() output
https://bugs.webkit.org/show_bug.cgi?id=151930
Reviewed by Zalan Bujtas.
In showLayerTree() output, for SVG renderers show:
- visual and layout overflow, for boxes
- frame rect, for boxes
- layout state
- class and id
* rendering/RenderLayer.cpp:
(WebCore::showLayerTree):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::writeDebugInfo): New function to share dumping with svg output.
(WebCore::write):
* rendering/RenderTreeAsText.h:
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writePositionAndStyle): Show the frameRect for boxes (e.g. RenderSVGRoot).
Much more useful that showing the clippedOverflowRect.
(WebCore::writeStandardPrefix):
(WebCore::writeChildren):
(WebCore::writeSVGResourceContainer):
(WebCore::writeSVGContainer):
(WebCore::write):
(WebCore::writeSVGText):
(WebCore::writeSVGInlineText):
(WebCore::writeSVGImage):
(WebCore::writeSVGGradientStop):
(WebCore::writeResources):
(WebCore::operator<<): Deleted.
* rendering/svg/SVGRenderTreeAsText.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/RenderTreeAsText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTreeAsTexth">trunk/Source/WebCore/rendering/RenderTreeAsText.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderTreeAsTexth">trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (193613 => 193614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-07 06:27:08 UTC (rev 193613)
+++ trunk/Source/WebCore/ChangeLog        2015-12-07 06:27:48 UTC (rev 193614)
</span><span class="lines">@@ -1,5 +1,41 @@
</span><span class="cx"> 2015-12-06 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><ins>+ Show more information about SVG renderers in showLayerTree() output
+ https://bugs.webkit.org/show_bug.cgi?id=151930
+
+ Reviewed by Zalan Bujtas.
+
+ In showLayerTree() output, for SVG renderers show:
+ - visual and layout overflow, for boxes
+ - frame rect, for boxes
+ - layout state
+ - class and id
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::showLayerTree):
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::RenderTreeAsText::writeRenderObject):
+ (WebCore::writeDebugInfo): New function to share dumping with svg output.
+ (WebCore::write):
+ * rendering/RenderTreeAsText.h:
+ * rendering/svg/SVGRenderTreeAsText.cpp:
+ (WebCore::writePositionAndStyle): Show the frameRect for boxes (e.g. RenderSVGRoot).
+ Much more useful that showing the clippedOverflowRect.
+ (WebCore::writeStandardPrefix):
+ (WebCore::writeChildren):
+ (WebCore::writeSVGResourceContainer):
+ (WebCore::writeSVGContainer):
+ (WebCore::write):
+ (WebCore::writeSVGText):
+ (WebCore::writeSVGInlineText):
+ (WebCore::writeSVGImage):
+ (WebCore::writeSVGGradientStop):
+ (WebCore::writeResources):
+ (WebCore::operator<<): Deleted.
+ * rendering/svg/SVGRenderTreeAsText.h:
+
+2015-12-06 Simon Fraser <simon.fraser@apple.com>
+
</ins><span class="cx"> Clipping along compositing borders in svg-edit
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=151791
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (193613 => 193614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-12-07 06:27:08 UTC (rev 193613)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2015-12-07 06:27:48 UTC (rev 193614)
</span><span class="lines">@@ -7073,7 +7073,7 @@
</span><span class="cx"> if (!layer)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- WTF::String output = externalRepresentation(&layer->renderer().frame(), WebCore::RenderAsTextShowAllLayers | WebCore::RenderAsTextShowLayerNesting | WebCore::RenderAsTextShowCompositedLayers | WebCore::RenderAsTextShowAddresses | WebCore::RenderAsTextShowIDAndClass | WebCore::RenderAsTextDontUpdateLayout | WebCore::RenderAsTextShowLayoutState | WebCore::RenderAsTextShowOverflow);
</del><ins>+ WTF::String output = externalRepresentation(&layer->renderer().frame(), WebCore::RenderAsTextShowAllLayers | WebCore::RenderAsTextShowLayerNesting | WebCore::RenderAsTextShowCompositedLayers | WebCore::RenderAsTextShowAddresses | WebCore::RenderAsTextShowIDAndClass | WebCore::RenderAsTextDontUpdateLayout | WebCore::RenderAsTextShowLayoutState | WebCore::RenderAsTextShowOverflow | WebCore::RenderAsTextShowSVGGeometry);
</ins><span class="cx"> fprintf(stderr, "%s\n", output.utf8().data());
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (193613 => 193614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2015-12-07 06:27:08 UTC (rev 193613)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2015-12-07 06:27:48 UTC (rev 193614)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx"> #include "SimpleLineLayoutResolver.h"
</span><span class="cx"> #include "StyleProperties.h"
</span><ins>+#include "TextStream.h"
</ins><span class="cx"> #include <wtf/HexNumber.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span><span class="lines">@@ -393,8 +394,13 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ writeDebugInfo(ts, o, behavior);
+}
+
+void writeDebugInfo(TextStream& ts, const RenderObject& object, RenderAsTextBehavior behavior)
+{
</ins><span class="cx"> if (behavior & RenderAsTextShowIDAndClass) {
</span><del>- if (Element* element = is<Element>(o.node()) ? downcast<Element>(o.node()) : nullptr) {
</del><ins>+ if (Element* element = is<Element>(object.node()) ? downcast<Element>(object.node()) : nullptr) {
</ins><span class="cx"> if (element->hasID())
</span><span class="cx"> ts << " id=\"" + element->getIdAttribute() + "\"";
</span><span class="cx">
</span><span class="lines">@@ -409,33 +415,33 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (behavior & RenderAsTextShowLayoutState) {
</span><del>- bool needsLayout = o.selfNeedsLayout() || o.needsPositionedMovementLayout() || o.posChildNeedsLayout() || o.normalChildNeedsLayout();
</del><ins>+ bool needsLayout = object.selfNeedsLayout() || object.needsPositionedMovementLayout() || object.posChildNeedsLayout() || object.normalChildNeedsLayout();
</ins><span class="cx"> if (needsLayout)
</span><span class="cx"> ts << " (needs layout:";
</span><span class="cx">
</span><span class="cx"> bool havePrevious = false;
</span><del>- if (o.selfNeedsLayout()) {
</del><ins>+ if (object.selfNeedsLayout()) {
</ins><span class="cx"> ts << " self";
</span><span class="cx"> havePrevious = true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (o.needsPositionedMovementLayout()) {
</del><ins>+ if (object.needsPositionedMovementLayout()) {
</ins><span class="cx"> if (havePrevious)
</span><span class="cx"> ts << ",";
</span><span class="cx"> havePrevious = true;
</span><span class="cx"> ts << " positioned movement";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (o.normalChildNeedsLayout()) {
</del><ins>+ if (object.normalChildNeedsLayout()) {
</ins><span class="cx"> if (havePrevious)
</span><span class="cx"> ts << ",";
</span><span class="cx"> havePrevious = true;
</span><span class="cx"> ts << " child";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (o.posChildNeedsLayout()) {
</del><ins>+ if (object.posChildNeedsLayout()) {
</ins><span class="cx"> if (havePrevious)
</span><span class="cx"> ts << ",";
</span><span class="cx"> ts << " positioned child";
</span><span class="lines">@@ -444,9 +450,9 @@
</span><span class="cx"> if (needsLayout)
</span><span class="cx"> ts << ")";
</span><span class="cx"> }
</span><del>-
- if (behavior & RenderAsTextShowOverflow && is<RenderBox>(o)) {
- const auto& box = downcast<RenderBox>(o);
</del><ins>+
+ if (behavior & RenderAsTextShowOverflow && is<RenderBox>(object)) {
+ const auto& box = downcast<RenderBox>(object);
</ins><span class="cx"> if (box.hasRenderOverflow()) {
</span><span class="cx"> LayoutRect layoutOverflow = box.layoutOverflowRect();
</span><span class="cx"> ts << " (layout overflow " << layoutOverflow.x().toInt() << "," << layoutOverflow.y().toInt() << " " << layoutOverflow.width().toInt() << "x" << layoutOverflow.height().toInt() << ")";
</span><span class="lines">@@ -502,35 +508,35 @@
</span><span class="cx"> void write(TextStream& ts, const RenderObject& o, int indent, RenderAsTextBehavior behavior)
</span><span class="cx"> {
</span><span class="cx"> if (is<RenderSVGShape>(o)) {
</span><del>- write(ts, downcast<RenderSVGShape>(o), indent);
</del><ins>+ write(ts, downcast<RenderSVGShape>(o), indent, behavior);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (is<RenderSVGGradientStop>(o)) {
</span><del>- writeSVGGradientStop(ts, downcast<RenderSVGGradientStop>(o), indent);
</del><ins>+ writeSVGGradientStop(ts, downcast<RenderSVGGradientStop>(o), indent, behavior);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (is<RenderSVGResourceContainer>(o)) {
</span><del>- writeSVGResourceContainer(ts, downcast<RenderSVGResourceContainer>(o), indent);
</del><ins>+ writeSVGResourceContainer(ts, downcast<RenderSVGResourceContainer>(o), indent, behavior);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (is<RenderSVGContainer>(o)) {
</span><del>- writeSVGContainer(ts, downcast<RenderSVGContainer>(o), indent);
</del><ins>+ writeSVGContainer(ts, downcast<RenderSVGContainer>(o), indent, behavior);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (is<RenderSVGRoot>(o)) {
</span><del>- write(ts, downcast<RenderSVGRoot>(o), indent);
</del><ins>+ write(ts, downcast<RenderSVGRoot>(o), indent, behavior);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (is<RenderSVGText>(o)) {
</span><del>- writeSVGText(ts, downcast<RenderSVGText>(o), indent);
</del><ins>+ writeSVGText(ts, downcast<RenderSVGText>(o), indent, behavior);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (is<RenderSVGInlineText>(o)) {
</span><del>- writeSVGInlineText(ts, downcast<RenderSVGInlineText>(o), indent);
</del><ins>+ writeSVGInlineText(ts, downcast<RenderSVGInlineText>(o), indent, behavior);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (is<RenderSVGImage>(o)) {
</span><del>- writeSVGImage(ts, downcast<RenderSVGImage>(o), indent);
</del><ins>+ writeSVGImage(ts, downcast<RenderSVGImage>(o), indent, behavior);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeAsTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.h (193613 => 193614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeAsText.h        2015-12-07 06:27:08 UTC (rev 193613)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.h        2015-12-07 06:27:48 UTC (rev 193614)
</span><span class="lines">@@ -36,16 +36,17 @@
</span><span class="cx"> class TextStream;
</span><span class="cx">
</span><span class="cx"> enum RenderAsTextBehaviorFlags {
</span><del>- RenderAsTextBehaviorNormal = 0,
- RenderAsTextShowAllLayers = 1 << 0, // Dump all layers, not just those that would paint.
- RenderAsTextShowLayerNesting = 1 << 1, // Annotate the layer lists.
- RenderAsTextShowCompositedLayers = 1 << 2, // Show which layers are composited.
- RenderAsTextShowAddresses = 1 << 3, // Show layer and renderer addresses.
- RenderAsTextShowIDAndClass = 1 << 4, // Show id and class attributes
- RenderAsTextPrintingMode = 1 << 5, // Dump the tree in printing mode.
- RenderAsTextDontUpdateLayout = 1 << 6, // Don't update layout, to make it safe to call showLayerTree() from the debugger inside layout or painting code.
- RenderAsTextShowLayoutState = 1 << 7, // Print the various 'needs layout' bits on renderers.
- RenderAsTextShowOverflow = 1 << 8 // Print layout and visual overflow.
</del><ins>+ RenderAsTextBehaviorNormal = 0,
+ RenderAsTextShowAllLayers = 1 << 0, // Dump all layers, not just those that would paint.
+ RenderAsTextShowLayerNesting = 1 << 1, // Annotate the layer lists.
+ RenderAsTextShowCompositedLayers = 1 << 2, // Show which layers are composited.
+ RenderAsTextShowAddresses = 1 << 3, // Show layer and renderer addresses.
+ RenderAsTextShowIDAndClass = 1 << 4, // Show id and class attributes
+ RenderAsTextPrintingMode = 1 << 5, // Dump the tree in printing mode.
+ RenderAsTextDontUpdateLayout = 1 << 6, // Don't update layout, to make it safe to call showLayerTree() from the debugger inside layout or painting code.
+ RenderAsTextShowLayoutState = 1 << 7, // Print the various 'needs layout' bits on renderers.
+ RenderAsTextShowOverflow = 1 << 8, // Print layout and visual overflow.
+ RenderAsTextShowSVGGeometry = 1 << 9, // Print additional geometry for SVG objects.
</ins><span class="cx"> };
</span><span class="cx"> typedef unsigned RenderAsTextBehavior;
</span><span class="cx">
</span><span class="lines">@@ -53,6 +54,7 @@
</span><span class="cx"> WEBCORE_EXPORT String externalRepresentation(Frame*, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
</span><span class="cx"> WEBCORE_EXPORT String externalRepresentation(Element*, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
</span><span class="cx"> void write(TextStream&, const RenderObject&, int indent = 0, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
</span><ins>+void writeDebugInfo(TextStream&, const RenderObject&, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
</ins><span class="cx">
</span><span class="cx"> class RenderTreeAsText {
</span><span class="cx"> // FIXME: This is a cheesy hack to allow easy access to RenderStyle colors. It won't be needed if we convert
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (193613 => 193614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp        2015-12-07 06:27:08 UTC (rev 193613)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp        2015-12-07 06:27:48 UTC (rev 193614)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx"> #include "RenderSVGResourceSolidColor.h"
</span><span class="cx"> #include "RenderSVGRoot.h"
</span><span class="cx"> #include "RenderSVGText.h"
</span><del>-#include "RenderTreeAsText.h"
</del><span class="cx"> #include "SVGCircleElement.h"
</span><span class="cx"> #include "SVGEllipseElement.h"
</span><span class="cx"> #include "SVGInlineTextBox.h"
</span><span class="lines">@@ -228,9 +227,19 @@
</span><span class="cx"> writeIfNotEmpty(ts, "end marker", svgStyle.markerEndResource());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static TextStream& writePositionAndStyle(TextStream& ts, const RenderElement& renderer)
</del><ins>+static TextStream& writePositionAndStyle(TextStream& ts, const RenderElement& renderer, RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal)
</ins><span class="cx"> {
</span><ins>+ if (behavior & RenderAsTextShowSVGGeometry) {
+ if (is<RenderBox>(renderer)) {
+ LayoutRect r = downcast<RenderBox>(renderer).frameRect();
+ ts << " " << enclosingIntRect(r);
+ }
+
+ ts << " clipped";
+ }
+
</ins><span class="cx"> ts << " " << enclosingIntRect(renderer.absoluteClippedOverflowRect());
</span><ins>+
</ins><span class="cx"> writeStyle(ts, renderer);
</span><span class="cx"> return ts;
</span><span class="cx"> }
</span><span class="lines">@@ -279,11 +288,6 @@
</span><span class="cx"> return ts;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static TextStream& operator<<(TextStream& ts, const RenderSVGRoot& root)
-{
- return writePositionAndStyle(ts, root);
-}
-
</del><span class="cx"> static void writeRenderSVGTextBox(TextStream& ts, const RenderSVGText& text)
</span><span class="cx"> {
</span><span class="cx"> auto* box = downcast<SVGRootInlineBox>(text.firstRootBox());
</span><span class="lines">@@ -363,19 +367,24 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void writeStandardPrefix(TextStream& ts, const RenderObject& object, int indent)
</del><ins>+static void writeStandardPrefix(TextStream& ts, const RenderObject& object, int indent, RenderAsTextBehavior behavior)
</ins><span class="cx"> {
</span><span class="cx"> writeIndent(ts, indent);
</span><span class="cx"> ts << object.renderName();
</span><span class="cx">
</span><ins>+ if (behavior & RenderAsTextShowAddresses)
+ ts << " " << static_cast<const void*>(&object);
+
</ins><span class="cx"> if (object.node())
</span><span class="cx"> ts << " {" << object.node()->nodeName() << "}";
</span><ins>+
+ writeDebugInfo(ts, object, behavior);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static void writeChildren(TextStream& ts, const RenderElement& parent, int indent)
</del><ins>+static void writeChildren(TextStream& ts, const RenderElement& parent, int indent, RenderAsTextBehavior behavior)
</ins><span class="cx"> {
</span><span class="cx"> for (const auto& child : childrenOfType<RenderObject>(parent))
</span><del>- write(ts, child, indent + 1);
</del><ins>+ write(ts, child, indent + 1, behavior);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline void writeCommonGradientProperties(TextStream& ts, SVGSpreadMethodType spreadMethod, const AffineTransform& gradientTransform, SVGUnitTypes::SVGUnitType gradientUnits)
</span><span class="lines">@@ -389,9 +398,9 @@
</span><span class="cx"> ts << " [gradientTransform=" << gradientTransform << "]";
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void writeSVGResourceContainer(TextStream& ts, const RenderSVGResourceContainer& resource, int indent)
</del><ins>+void writeSVGResourceContainer(TextStream& ts, const RenderSVGResourceContainer& resource, int indent, RenderAsTextBehavior behavior)
</ins><span class="cx"> {
</span><del>- writeStandardPrefix(ts, resource, indent);
</del><ins>+ writeStandardPrefix(ts, resource, indent, behavior);
</ins><span class="cx">
</span><span class="cx"> const AtomicString& id = resource.element().getIdAttribute();
</span><span class="cx"> writeNameAndQuotedValue(ts, "id", id);
</span><span class="lines">@@ -468,68 +477,69 @@
</span><span class="cx"> ts << " [center=" << centerPoint << "] [focal=" << focalPoint << "] [radius=" << radius << "] [focalRadius=" << focalRadius << "]\n";
</span><span class="cx"> } else
</span><span class="cx"> ts << "\n";
</span><del>- writeChildren(ts, resource, indent);
</del><ins>+ writeChildren(ts, resource, indent, behavior);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void writeSVGContainer(TextStream& ts, const RenderSVGContainer& container, int indent)
</del><ins>+void writeSVGContainer(TextStream& ts, const RenderSVGContainer& container, int indent, RenderAsTextBehavior behavior)
</ins><span class="cx"> {
</span><span class="cx"> // Currently RenderSVGResourceFilterPrimitive has no meaningful output.
</span><span class="cx"> if (container.isSVGResourceFilterPrimitive())
</span><span class="cx"> return;
</span><del>- writeStandardPrefix(ts, container, indent);
- writePositionAndStyle(ts, container);
</del><ins>+ writeStandardPrefix(ts, container, indent, behavior);
+ writePositionAndStyle(ts, container, behavior);
</ins><span class="cx"> ts << "\n";
</span><del>- writeResources(ts, container, indent);
- writeChildren(ts, container, indent);
</del><ins>+ writeResources(ts, container, indent, behavior);
+ writeChildren(ts, container, indent, behavior);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void write(TextStream& ts, const RenderSVGRoot& root, int indent)
</del><ins>+void write(TextStream& ts, const RenderSVGRoot& root, int indent, RenderAsTextBehavior behavior)
</ins><span class="cx"> {
</span><del>- writeStandardPrefix(ts, root, indent);
- ts << root << "\n";
- writeChildren(ts, root, indent);
</del><ins>+ writeStandardPrefix(ts, root, indent, behavior);
+ writePositionAndStyle(ts, root, behavior);
+ ts << "\n";
+ writeChildren(ts, root, indent, behavior);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void writeSVGText(TextStream& ts, const RenderSVGText& text, int indent)
</del><ins>+void writeSVGText(TextStream& ts, const RenderSVGText& text, int indent, RenderAsTextBehavior behavior)
</ins><span class="cx"> {
</span><del>- writeStandardPrefix(ts, text, indent);
</del><ins>+ writeStandardPrefix(ts, text, indent, behavior);
</ins><span class="cx"> writeRenderSVGTextBox(ts, text);
</span><span class="cx"> ts << "\n";
</span><del>- writeResources(ts, text, indent);
- writeChildren(ts, text, indent);
</del><ins>+ writeResources(ts, text, indent, behavior);
+ writeChildren(ts, text, indent, behavior);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void writeSVGInlineText(TextStream& ts, const RenderSVGInlineText& text, int indent)
</del><ins>+void writeSVGInlineText(TextStream& ts, const RenderSVGInlineText& text, int indent, RenderAsTextBehavior behavior)
</ins><span class="cx"> {
</span><del>- writeStandardPrefix(ts, text, indent);
</del><ins>+ writeStandardPrefix(ts, text, indent, behavior);
</ins><span class="cx"> ts << " " << enclosingIntRect(FloatRect(text.firstRunLocation(), text.floatLinesBoundingBox().size())) << "\n";
</span><del>- writeResources(ts, text, indent);
</del><ins>+ writeResources(ts, text, indent, behavior);
</ins><span class="cx"> writeSVGInlineTextBoxes(ts, text, indent);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void writeSVGImage(TextStream& ts, const RenderSVGImage& image, int indent)
</del><ins>+void writeSVGImage(TextStream& ts, const RenderSVGImage& image, int indent, RenderAsTextBehavior behavior)
</ins><span class="cx"> {
</span><del>- writeStandardPrefix(ts, image, indent);
- writePositionAndStyle(ts, image);
</del><ins>+ writeStandardPrefix(ts, image, indent, behavior);
+ writePositionAndStyle(ts, image, behavior);
</ins><span class="cx"> ts << "\n";
</span><del>- writeResources(ts, image, indent);
</del><ins>+ writeResources(ts, image, indent, behavior);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void write(TextStream& ts, const RenderSVGShape& shape, int indent)
</del><ins>+void write(TextStream& ts, const RenderSVGShape& shape, int indent, RenderAsTextBehavior behavior)
</ins><span class="cx"> {
</span><del>- writeStandardPrefix(ts, shape, indent);
</del><ins>+ writeStandardPrefix(ts, shape, indent, behavior);
</ins><span class="cx"> ts << shape << "\n";
</span><del>- writeResources(ts, shape, indent);
</del><ins>+ writeResources(ts, shape, indent, behavior);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void writeSVGGradientStop(TextStream& ts, const RenderSVGGradientStop& stop, int indent)
</del><ins>+void writeSVGGradientStop(TextStream& ts, const RenderSVGGradientStop& stop, int indent, RenderAsTextBehavior behavior)
</ins><span class="cx"> {
</span><del>- writeStandardPrefix(ts, stop, indent);
</del><ins>+ writeStandardPrefix(ts, stop, indent, behavior);
</ins><span class="cx">
</span><span class="cx"> ts << " [offset=" << stop.element().offset() << "] [color=" << stop.element().stopColorIncludingOpacity() << "]\n";
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void writeResources(TextStream& ts, const RenderObject& renderer, int indent)
</del><ins>+void writeResources(TextStream& ts, const RenderObject& renderer, int indent, RenderAsTextBehavior behavior)
</ins><span class="cx"> {
</span><span class="cx"> const RenderStyle& style = renderer.style();
</span><span class="cx"> const SVGRenderStyle& svgStyle = style.svgStyle();
</span><span class="lines">@@ -542,7 +552,7 @@
</span><span class="cx"> ts << " ";
</span><span class="cx"> writeNameAndQuotedValue(ts, "masker", svgStyle.maskerResource());
</span><span class="cx"> ts << " ";
</span><del>- writeStandardPrefix(ts, *masker, 0);
</del><ins>+ writeStandardPrefix(ts, *masker, 0, behavior);
</ins><span class="cx"> ts << " " << masker->resourceBoundingBox(renderer) << "\n";
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -552,7 +562,7 @@
</span><span class="cx"> ts << " ";
</span><span class="cx"> writeNameAndQuotedValue(ts, "clipPath", svgStyle.clipperResource());
</span><span class="cx"> ts << " ";
</span><del>- writeStandardPrefix(ts, *clipper, 0);
</del><ins>+ writeStandardPrefix(ts, *clipper, 0, behavior);
</ins><span class="cx"> ts << " " << clipper->resourceBoundingBox(renderer) << "\n";
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -568,7 +578,7 @@
</span><span class="cx"> ts << " ";
</span><span class="cx"> writeNameAndQuotedValue(ts, "filter", id);
</span><span class="cx"> ts << " ";
</span><del>- writeStandardPrefix(ts, *filter, 0);
</del><ins>+ writeStandardPrefix(ts, *filter, 0, behavior);
</ins><span class="cx"> ts << " " << filter->resourceBoundingBox(renderer) << "\n";
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderTreeAsTexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h (193613 => 193614)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h        2015-12-07 06:27:08 UTC (rev 193613)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h        2015-12-07 06:27:48 UTC (rev 193614)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef SVGRenderTreeAsText_h
</span><span class="cx"> #define SVGRenderTreeAsText_h
</span><span class="cx">
</span><ins>+#include "RenderTreeAsText.h"
</ins><span class="cx"> #include "TextStream.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -48,15 +49,15 @@
</span><span class="cx"> class SVGUnitTypes;
</span><span class="cx">
</span><span class="cx"> // functions used by the main RenderTreeAsText code
</span><del>-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 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);
-void writeResources(TextStream&, const RenderObject&, int indent);
</del><ins>+void write(TextStream&, const RenderSVGShape&, int indent, RenderAsTextBehavior);
+void write(TextStream&, const RenderSVGRoot&, int indent, RenderAsTextBehavior);
+void writeSVGGradientStop(TextStream&, const RenderSVGGradientStop&, int indent, RenderAsTextBehavior);
+void writeSVGResourceContainer(TextStream&, const RenderSVGResourceContainer&, int indent, RenderAsTextBehavior);
+void writeSVGContainer(TextStream&, const RenderSVGContainer&, int indent, RenderAsTextBehavior);
+void writeSVGImage(TextStream&, const RenderSVGImage&, int indent, RenderAsTextBehavior);
+void writeSVGInlineText(TextStream&, const RenderSVGInlineText&, int indent, RenderAsTextBehavior);
+void writeSVGText(TextStream&, const RenderSVGText&, int indent, RenderAsTextBehavior);
+void writeResources(TextStream&, const RenderObject&, int indent, RenderAsTextBehavior);
</ins><span class="cx">
</span><span class="cx"> // helper operators specific to dumping the render tree. these are used in various classes to dump the render tree
</span><span class="cx"> // these could be defined in separate namespace to avoid matching these generic signatures unintentionally.
</span></span></pre>
</div>
</div>
</body>
</html>