Diff
Modified: trunk/Source/WTF/ChangeLog (225184 => 225185)
--- trunk/Source/WTF/ChangeLog 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WTF/ChangeLog 2017-11-27 20:02:09 UTC (rev 225185)
@@ -1,3 +1,21 @@
+2017-11-27 Simon Fraser <[email protected]>
+
+ Use TextStream's indent tracking, rather than passing indent to all the externalRepresentation() functions
+ https://bugs.webkit.org/show_bug.cgi?id=180027
+
+ Reviewed by Jon Lee.
+
+ Remove all the indent arguments, and make use of TextStream::IndentScope to control
+ output indentation.
+
+ Add an indent stream manipulator so you can say
+ ts << indent << "text"
+ to write the indent.
+
+ * wtf/text/TextStream.h:
+ (WTF::TextStream::IndentScope::IndentScope):
+ (WTF::TextStream::IndentScope::~IndentScope):
+
2016-08-05 Darin Adler <[email protected]>
Fix some minor problems in the StringImpl header
Modified: trunk/Source/WTF/wtf/text/TextStream.h (225184 => 225185)
--- trunk/Source/WTF/wtf/text/TextStream.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WTF/wtf/text/TextStream.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -95,6 +95,30 @@
WTF_EXPORT_PRIVATE void writeIndent();
+ // Stream manipulators.
+ TextStream& operator<<(TextStream& (*func)(TextStream&))
+ {
+ return (*func)(*this);
+ }
+
+ class IndentScope {
+ public:
+ IndentScope(TextStream& ts, int amount = 1)
+ : m_stream(ts)
+ , m_amount(amount)
+ {
+ m_stream.increaseIndent(m_amount);
+ }
+ ~IndentScope()
+ {
+ m_stream.decreaseIndent(m_amount);
+ }
+
+ private:
+ TextStream& m_stream;
+ int m_amount;
+ };
+
class GroupScope {
public:
GroupScope(TextStream& ts)
@@ -118,6 +142,12 @@
bool m_multiLineMode { true };
};
+inline TextStream& indent(TextStream& ts)
+{
+ ts.writeIndent();
+ return ts;
+}
+
template<typename Item>
TextStream& operator<<(TextStream& ts, const Vector<Item>& vector)
{
@@ -133,8 +163,10 @@
return ts << "]";
}
+// Deprecated. Use TextStream::writeIndent() instead.
WTF_EXPORT_PRIVATE void writeIndent(TextStream&, int indent);
} // namespace WTF
using WTF::TextStream;
+using WTF::indent;
Modified: trunk/Source/WebCore/ChangeLog (225184 => 225185)
--- trunk/Source/WebCore/ChangeLog 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/ChangeLog 2017-11-27 20:02:09 UTC (rev 225185)
@@ -1,3 +1,99 @@
+2017-11-27 Simon Fraser <[email protected]>
+
+ Use TextStream's indent tracking, rather than passing indent to all the externalRepresentation() functions
+ https://bugs.webkit.org/show_bug.cgi?id=180027
+
+ Reviewed by Jon Lee.
+
+ Remove all the indent arguments, and make use of TextStream::IndentScope to control
+ output indentation.
+
+ Add an indent stream manipulator so you can say
+ ts << indent << "text"
+ to write the indent.
+
+ * platform/graphics/filters/FEBlend.cpp:
+ (WebCore::FEBlend::externalRepresentation const):
+ * platform/graphics/filters/FEBlend.h:
+ * platform/graphics/filters/FEColorMatrix.cpp:
+ (WebCore::FEColorMatrix::externalRepresentation const):
+ * platform/graphics/filters/FEColorMatrix.h:
+ * platform/graphics/filters/FEComponentTransfer.cpp:
+ (WebCore::FEComponentTransfer::externalRepresentation const):
+ * platform/graphics/filters/FEComponentTransfer.h:
+ * platform/graphics/filters/FEComposite.cpp:
+ (WebCore::FEComposite::externalRepresentation const):
+ * platform/graphics/filters/FEComposite.h:
+ * platform/graphics/filters/FEConvolveMatrix.cpp:
+ (WebCore::FEConvolveMatrix::externalRepresentation const):
+ * platform/graphics/filters/FEConvolveMatrix.h:
+ * platform/graphics/filters/FEDiffuseLighting.cpp:
+ (WebCore::FEDiffuseLighting::externalRepresentation const):
+ * platform/graphics/filters/FEDiffuseLighting.h:
+ * platform/graphics/filters/FEDisplacementMap.cpp:
+ (WebCore::FEDisplacementMap::externalRepresentation const):
+ * platform/graphics/filters/FEDisplacementMap.h:
+ * platform/graphics/filters/FEDropShadow.cpp:
+ (WebCore::FEDropShadow::externalRepresentation const):
+ * platform/graphics/filters/FEDropShadow.h:
+ * platform/graphics/filters/FEFlood.cpp:
+ (WebCore::FEFlood::externalRepresentation const):
+ * platform/graphics/filters/FEFlood.h:
+ * platform/graphics/filters/FEGaussianBlur.cpp:
+ (WebCore::FEGaussianBlur::externalRepresentation const):
+ * platform/graphics/filters/FEGaussianBlur.h:
+ * platform/graphics/filters/FEMerge.cpp:
+ (WebCore::FEMerge::externalRepresentation const):
+ * platform/graphics/filters/FEMerge.h:
+ * platform/graphics/filters/FEMorphology.cpp:
+ (WebCore::FEMorphology::externalRepresentation const):
+ * platform/graphics/filters/FEMorphology.h:
+ * platform/graphics/filters/FEOffset.cpp:
+ (WebCore::FEOffset::externalRepresentation const):
+ * platform/graphics/filters/FEOffset.h:
+ * platform/graphics/filters/FESpecularLighting.cpp:
+ (WebCore::FESpecularLighting::externalRepresentation const):
+ * platform/graphics/filters/FESpecularLighting.h:
+ * platform/graphics/filters/FETile.cpp:
+ (WebCore::FETile::externalRepresentation const):
+ * platform/graphics/filters/FETile.h:
+ * platform/graphics/filters/FETurbulence.cpp:
+ (WebCore::FETurbulence::externalRepresentation const):
+ * platform/graphics/filters/FETurbulence.h:
+ * platform/graphics/filters/FilterEffect.cpp:
+ (WebCore::FilterEffect::externalRepresentation const):
+ * platform/graphics/filters/FilterEffect.h:
+ * platform/graphics/filters/SourceAlpha.cpp:
+ (WebCore::SourceAlpha::externalRepresentation const):
+ * platform/graphics/filters/SourceAlpha.h:
+ * platform/graphics/filters/SourceGraphic.cpp:
+ (WebCore::SourceGraphic::externalRepresentation const):
+ * platform/graphics/filters/SourceGraphic.h:
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::write):
+ (WebCore::writeLayer):
+ (WebCore::writeLayerRenderers):
+ (WebCore::writeLayers):
+ (WebCore::externalRepresentation):
+ * rendering/RenderTreeAsText.h:
+ * rendering/svg/SVGRenderTreeAsText.cpp:
+ (WebCore::writeSVGInlineTextBox):
+ (WebCore::writeSVGInlineTextBoxes):
+ (WebCore::writeStandardPrefix):
+ (WebCore::writeChildren):
+ (WebCore::writeSVGResourceContainer):
+ (WebCore::writeSVGContainer):
+ (WebCore::write):
+ (WebCore::writeSVGText):
+ (WebCore::writeSVGInlineText):
+ (WebCore::writeSVGImage):
+ (WebCore::writeSVGGradientStop):
+ (WebCore::writeResources):
+ * rendering/svg/SVGRenderTreeAsText.h:
+ * svg/graphics/filters/SVGFEImage.cpp:
+ (WebCore::FEImage::externalRepresentation const):
+ * svg/graphics/filters/SVGFEImage.h:
+
2017-11-27 Chris Dumez <[email protected]>
Give Document a strongly typed identifier instead of a uint64_t
Modified: trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -75,14 +75,15 @@
}
#endif
-TextStream& FEBlend::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEBlend::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feBlend";
+ ts << indent << "[feBlend";
FilterEffect::externalRepresentation(ts);
ts << " mode=\"" << (m_mode == BlendModeNormal ? "normal" : compositeOperatorName(CompositeSourceOver, m_mode)) << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
- inputEffect(1)->externalRepresentation(ts, indent + 1);
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
+ inputEffect(1)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEBlend.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEBlend.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEBlend.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -44,7 +44,7 @@
void platformApplyNEON(unsigned char* srcPixelArrayA, unsigned char* srcPixelArrayB, unsigned char* dstPixelArray,
unsigned colorArrayLength);
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
FEBlend(Filter&, BlendMode);
Modified: trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -335,10 +335,9 @@
return ts;
}
-TextStream& FEColorMatrix::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEColorMatrix::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feColorMatrix";
+ ts << indent << "[feColorMatrix";
FilterEffect::externalRepresentation(ts);
ts << " type=\"" << m_type << "\"";
if (!m_values.isEmpty()) {
@@ -354,7 +353,9 @@
ts << "\"";
}
ts << "]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -56,7 +56,7 @@
void platformApplySoftware() override;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
ColorMatrixType m_type;
Vector<float> m_values;
Modified: trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -194,21 +194,21 @@
return ts;
}
-TextStream& FEComponentTransfer::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEComponentTransfer::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feComponentTransfer";
+ ts << indent << "[feComponentTransfer";
FilterEffect::externalRepresentation(ts);
ts << " \n";
- writeIndent(ts, indent + 2);
- ts << "{red: " << m_redFunction << "}\n";
- writeIndent(ts, indent + 2);
- ts << "{green: " << m_greenFunction << "}\n";
- writeIndent(ts, indent + 2);
- ts << "{blue: " << m_blueFunction << "}\n";
- writeIndent(ts, indent + 2);
- ts << "{alpha: " << m_alphaFunction << "}]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
+ {
+ TextStream::IndentScope indentScope(ts, 2);
+ ts << indent << "{red: " << m_redFunction << "}\n";
+ ts << indent <<"{green: " << m_greenFunction << "}\n";
+ ts << indent <<"{blue: " << m_blueFunction << "}\n";
+ ts << indent <<"{alpha: " << m_alphaFunction << "}]\n";
+ }
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -79,7 +79,7 @@
void platformApplySoftware() override;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
ComponentTransferFunction m_redFunction;
ComponentTransferFunction m_greenFunction;
Modified: trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -327,17 +327,18 @@
return ts;
}
-TextStream& FEComposite::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEComposite::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feComposite";
+ ts << indent << "[feComposite";
FilterEffect::externalRepresentation(ts);
ts << " operation=\"" << m_type << "\"";
if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC)
ts << " k1=\"" << m_k1 << "\" k2=\"" << m_k2 << "\" k3=\"" << m_k3 << "\" k4=\"" << m_k4 << "\"";
ts << "]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
- inputEffect(1)->externalRepresentation(ts, indent + 1);
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
+ inputEffect(1)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEComposite.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEComposite.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEComposite.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -70,7 +70,7 @@
void determineAbsolutePaintRect() override;
void platformApplySoftware() override;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
inline void platformArithmeticSoftware(const Uint8ClampedArray& source, Uint8ClampedArray& destination, float k1, float k2, float k3, float k4);
Modified: trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -455,10 +455,9 @@
return ts;
}
-TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feConvolveMatrix";
+ ts << indent << "[feConvolveMatrix";
FilterEffect::externalRepresentation(ts);
ts << " order=\"" << m_kernelSize << "\" "
<< "kernelMatrix=\"" << m_kernelMatrix << "\" "
@@ -468,7 +467,9 @@
<< "edgeMode=\"" << m_edgeMode << "\" "
<< "kernelUnitLength=\"" << m_kernelUnitLength << "\" "
<< "preserveAlpha=\"" << m_preserveAlpha << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -86,7 +86,7 @@
void platformApplySoftware() override;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
template<bool preserveAlphaValues>
ALWAYS_INLINE void fastSetInteriorPixels(PaintingData&, int clipRight, int clipBottom, int yStart, int yEnd);
Modified: trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -47,15 +47,16 @@
return true;
}
-TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feDiffuseLighting";
+ ts << indent << "[feDiffuseLighting";
FilterEffect::externalRepresentation(ts);
ts << " surfaceScale=\"" << m_surfaceScale << "\" "
<< "diffuseConstant=\"" << m_diffuseConstant << "\" "
<< "kernelUnitLength=\"" << m_kernelUnitLengthX << ", " << m_kernelUnitLengthY << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -35,7 +35,7 @@
float diffuseConstant() const { return m_diffuseConstant; }
bool setDiffuseConstant(float);
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
private:
FEDiffuseLighting(Filter&, const Color&, float, float, float, float, Ref<LightSource>&&);
Modified: trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -166,16 +166,17 @@
return ts;
}
-TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feDisplacementMap";
+ ts << indent << "[feDisplacementMap";
FilterEffect::externalRepresentation(ts);
ts << " scale=\"" << m_scale << "\" "
<< "xChannelSelector=\"" << m_xChannelSelector << "\" "
<< "yChannelSelector=\"" << m_yChannelSelector << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
- inputEffect(1)->externalRepresentation(ts, indent + 1);
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
+ inputEffect(1)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -60,11 +60,11 @@
void determineAbsolutePaintRect() override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
-
int xChannelIndex() const { return m_xChannelSelector - 1; }
int yChannelIndex() const { return m_yChannelSelector - 1; }
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
+
ChannelSelectorType m_xChannelSelector;
ChannelSelectorType m_yChannelSelector;
float m_scale;
Modified: trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -114,13 +114,14 @@
resultImage->context().drawImageBuffer(*sourceImage, drawingRegion);
}
-TextStream& FEDropShadow::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEDropShadow::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feDropShadow";
+ ts << indent <<"[feDropShadow";
FilterEffect::externalRepresentation(ts);
ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\" dx=\"" << m_dx << "\" dy=\"" << m_dy << "\" flood-color=\"" << m_shadowColor.nameForRenderTreeAsText() <<"\" flood-opacity=\"" << m_shadowOpacity << "]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -56,7 +56,7 @@
void determineAbsolutePaintRect() override;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
float m_stdX;
float m_stdY;
Modified: trunk/Source/WebCore/platform/graphics/filters/FEFlood.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEFlood.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEFlood.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -67,10 +67,9 @@
resultImage->context().fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), color);
}
-TextStream& FEFlood::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEFlood::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feFlood";
+ ts << indent << "[feFlood";
FilterEffect::externalRepresentation(ts);
ts << " flood-color=\"" << floodColor().nameForRenderTreeAsText() << "\" "
<< "flood-opacity=\"" << floodOpacity() << "\"]\n";
Modified: trunk/Source/WebCore/platform/graphics/filters/FEFlood.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEFlood.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEFlood.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -53,7 +53,7 @@
void determineAbsolutePaintRect() override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
Color m_floodColor;
float m_floodOpacity;
Modified: trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -539,13 +539,14 @@
platformApply(*resultPixelArray, *tmpImageData, kernelSize.width(), kernelSize.height(), paintSize);
}
-TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feGaussianBlur";
+ ts << indent << "[feGaussianBlur";
FilterEffect::externalRepresentation(ts);
ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -67,7 +67,7 @@
void determineAbsolutePaintRect() override;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
static void platformApplyWorker(PlatformApplyParameters*);
void platformApply(Uint8ClampedArray& ioBuffer, Uint8ClampedArray& tempBuffer, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
Modified: trunk/Source/WebCore/platform/graphics/filters/FEMerge.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEMerge.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEMerge.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -56,16 +56,17 @@
}
}
-TextStream& FEMerge::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEMerge::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feMerge";
+ ts << indent << "[feMerge";
FilterEffect::externalRepresentation(ts);
unsigned size = numberOfEffectInputs();
ASSERT(size > 0);
ts << " mergeNodes=\"" << size << "\"]\n";
+
+ TextStream::IndentScope indentScope(ts);
for (unsigned i = 0; i < size; ++i)
- inputEffect(i)->externalRepresentation(ts, indent + 1);
+ inputEffect(i)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEMerge.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEMerge.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEMerge.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -37,7 +37,7 @@
void platformApplySoftware() override;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/filters/FEMorphology.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEMorphology.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEMorphology.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -289,14 +289,15 @@
return ts;
}
-TextStream& FEMorphology::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEMorphology::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feMorphology";
+ ts << indent << "[feMorphology";
FilterEffect::externalRepresentation(ts);
ts << " operator=\"" << morphologyOperator() << "\" "
<< "radius=\"" << radiusX() << ", " << radiusY() << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEMorphology.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEMorphology.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEMorphology.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -54,7 +54,7 @@
void determineAbsolutePaintRect() override;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
bool platformApplyDegenerate(Uint8ClampedArray& dstPixelArray, const IntRect& imageRect, int radiusX, int radiusY);
Modified: trunk/Source/WebCore/platform/graphics/filters/FEOffset.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEOffset.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEOffset.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -81,13 +81,14 @@
resultImage->context().drawImageBuffer(*inBuffer, drawingRegion);
}
-TextStream& FEOffset::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEOffset::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feOffset";
+ ts << indent << "[feOffset";
FilterEffect::externalRepresentation(ts);
ts << " dx=\"" << dx() << "\" dy=\"" << dy() << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FEOffset.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FEOffset.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FEOffset.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -45,7 +45,7 @@
void determineAbsolutePaintRect() override;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
float m_dx;
float m_dy;
Modified: trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -55,15 +55,16 @@
return true;
}
-TextStream& FESpecularLighting::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FESpecularLighting::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feSpecularLighting";
+ ts << indent << "[feSpecularLighting";
FilterEffect::externalRepresentation(ts);
ts << " surfaceScale=\"" << m_surfaceScale << "\" "
<< "specualConstant=\"" << m_specularConstant << "\" "
<< "specularExponent=\"" << m_specularExponent << "\"]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
+
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -36,7 +36,7 @@
float specularExponent() const { return m_specularExponent; }
bool setSpecularExponent(float);
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
private:
FESpecularLighting(Filter&, const Color&, float, float, float, float, float, Ref<LightSource>&&);
Modified: trunk/Source/WebCore/platform/graphics/filters/FETile.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FETile.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FETile.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -86,14 +86,15 @@
filterContext.fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()));
}
-TextStream& FETile::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FETile::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feTile";
+ ts << indent << "[feTile";
FilterEffect::externalRepresentation(ts);
ts << "]\n";
- inputEffect(0)->externalRepresentation(ts, indent + 1);
+ TextStream::IndentScope indentScope(ts);
+ inputEffect(0)->externalRepresentation(ts);
+
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/FETile.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FETile.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FETile.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -41,7 +41,7 @@
void determineAbsolutePaintRect() override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/filters/FETurbulence.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FETurbulence.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FETurbulence.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -467,10 +467,9 @@
return ts;
}
-TextStream& FETurbulence::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FETurbulence::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[feTurbulence";
+ ts << indent << "[feTurbulence";
FilterEffect::externalRepresentation(ts);
ts << " type=\"" << type() << "\" "
<< "baseFrequency=\"" << baseFrequencyX() << ", " << baseFrequencyY() << "\" "
Modified: trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -112,7 +112,7 @@
void platformApplySoftware() override;
void determineAbsolutePaintRect() override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
void initPaint(PaintingData&);
StitchData computeStitching(IntSize tileSize, float& baseFrequencyX, float& baseFrequencyY) const;
Modified: trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -503,7 +503,7 @@
#endif
}
-TextStream& FilterEffect::externalRepresentation(TextStream& ts, int) const
+TextStream& FilterEffect::externalRepresentation(TextStream& ts) const
{
// FIXME: We should dump the subRegions of the filter primitives here later. This isn't
// possible at the moment, because we need more detailed informations from the target object.
Modified: trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -114,7 +114,7 @@
virtual FilterEffectType filterEffectType() const { return FilterEffectTypeUnknown; }
- virtual WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention = 0) const;
+ virtual WTF::TextStream& externalRepresentation(WTF::TextStream&) const;
// The following functions are SVG specific and will move to RenderSVGResourceFilterPrimitive.
// See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
Modified: trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -63,10 +63,9 @@
filterContext.drawImageBuffer(*imageBuffer, IntPoint(), CompositeDestinationIn);
}
-TextStream& SourceAlpha::externalRepresentation(TextStream& ts, int indent) const
+TextStream& SourceAlpha::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[SourceAlpha]\n";
+ ts << indent << "[SourceAlpha]\n";
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -38,7 +38,7 @@
void platformApplySoftware() override;
void determineAbsolutePaintRect() override;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
};
} //namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.cpp (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -60,10 +60,9 @@
resultImage->context().drawImageBuffer(*sourceImage, IntPoint());
}
-TextStream& SourceGraphic::externalRepresentation(TextStream& ts, int indent) const
+TextStream& SourceGraphic::externalRepresentation(TextStream& ts) const
{
- writeIndent(ts, indent);
- ts << "[SourceGraphic]\n";
+ ts << indent << "[SourceGraphic]\n";
return ts;
}
Modified: trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h (225184 => 225185)
--- trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -43,7 +43,7 @@
void determineAbsolutePaintRect() override;
void platformApplySoftware() override;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const override;
FilterEffectType filterEffectType() const override { return FilterEffectTypeSourceInput; }
};
Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (225184 => 225185)
--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -78,7 +78,7 @@
using namespace HTMLNames;
-static void writeLayers(TextStream&, const RenderLayer& rootLayer, RenderLayer&, const LayoutRect& paintDirtyRect, int indent = 0, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
+static void writeLayers(TextStream&, const RenderLayer& rootLayer, RenderLayer&, const LayoutRect& paintDirtyRect, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
static void printBorderStyle(TextStream& ts, const EBorderStyle borderStyle)
{
@@ -523,46 +523,48 @@
ts << "\n";
}
-void write(TextStream& ts, const RenderObject& o, int indent, RenderAsTextBehavior behavior)
+void write(TextStream& ts, const RenderObject& o, RenderAsTextBehavior behavior)
{
if (is<RenderSVGShape>(o)) {
- write(ts, downcast<RenderSVGShape>(o), indent, behavior);
+ write(ts, downcast<RenderSVGShape>(o), behavior);
return;
}
if (is<RenderSVGGradientStop>(o)) {
- writeSVGGradientStop(ts, downcast<RenderSVGGradientStop>(o), indent, behavior);
+ writeSVGGradientStop(ts, downcast<RenderSVGGradientStop>(o), behavior);
return;
}
if (is<RenderSVGResourceContainer>(o)) {
- writeSVGResourceContainer(ts, downcast<RenderSVGResourceContainer>(o), indent, behavior);
+ writeSVGResourceContainer(ts, downcast<RenderSVGResourceContainer>(o), behavior);
return;
}
if (is<RenderSVGContainer>(o)) {
- writeSVGContainer(ts, downcast<RenderSVGContainer>(o), indent, behavior);
+ writeSVGContainer(ts, downcast<RenderSVGContainer>(o), behavior);
return;
}
if (is<RenderSVGRoot>(o)) {
- write(ts, downcast<RenderSVGRoot>(o), indent, behavior);
+ write(ts, downcast<RenderSVGRoot>(o), behavior);
return;
}
if (is<RenderSVGText>(o)) {
- writeSVGText(ts, downcast<RenderSVGText>(o), indent, behavior);
+ writeSVGText(ts, downcast<RenderSVGText>(o), behavior);
return;
}
if (is<RenderSVGInlineText>(o)) {
- writeSVGInlineText(ts, downcast<RenderSVGInlineText>(o), indent, behavior);
+ writeSVGInlineText(ts, downcast<RenderSVGInlineText>(o), behavior);
return;
}
if (is<RenderSVGImage>(o)) {
- writeSVGImage(ts, downcast<RenderSVGImage>(o), indent, behavior);
+ writeSVGImage(ts, downcast<RenderSVGImage>(o), behavior);
return;
}
- writeIndent(ts, indent);
+ ts << indent;
RenderTreeAsText::writeRenderObject(ts, o, behavior);
ts << "\n";
+ TextStream::IndentScope indentScope(ts);
+
if (is<RenderText>(o)) {
auto& text = downcast<RenderText>(o);
if (auto layout = text.simpleLineLayout()) {
@@ -569,12 +571,12 @@
ASSERT(!text.firstTextBox());
auto resolver = runResolver(downcast<RenderBlockFlow>(*text.parent()), *layout);
for (auto run : resolver.rangeForRenderer(text)) {
- writeIndent(ts, indent + 1);
+ ts << indent;
writeSimpleLine(ts, text, run);
}
} else {
for (auto* box = text.firstTextBox(); box; box = box->nextTextBox()) {
- writeIndent(ts, indent + 1);
+ ts << indent;
writeTextRun(ts, text, *box);
}
}
@@ -583,7 +585,7 @@
for (auto& child : childrenOfType<RenderObject>(downcast<RenderElement>(o))) {
if (child.hasLayer())
continue;
- write(ts, child, indent + 1, behavior);
+ write(ts, child, behavior);
}
}
@@ -595,7 +597,7 @@
if (!(behavior & RenderAsTextDontUpdateLayout))
view.layoutContext().layout();
if (RenderLayer* layer = root->layer())
- writeLayers(ts, *layer, *layer, layer->rect(), indent + 1, behavior);
+ writeLayers(ts, *layer, *layer, layer->rect(), behavior);
}
}
}
@@ -608,15 +610,13 @@
};
static void writeLayer(TextStream& ts, const RenderLayer& layer, const LayoutRect& layerBounds, const LayoutRect& backgroundClipRect, const LayoutRect& clipRect,
- LayerPaintPhase paintPhase = LayerPaintPhaseAll, int indent = 0, RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal)
+ LayerPaintPhase paintPhase = LayerPaintPhaseAll, RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal)
{
IntRect adjustedLayoutBounds = snappedIntRect(layerBounds);
IntRect adjustedBackgroundClipRect = snappedIntRect(backgroundClipRect);
IntRect adjustedClipRect = snappedIntRect(clipRect);
- writeIndent(ts, indent);
-
- ts << "layer ";
+ ts << indent << "layer ";
if (behavior & RenderAsTextShowAddresses)
ts << static_cast<const void*>(&layer) << " ";
@@ -671,10 +671,12 @@
ts << "\n";
}
-static void writeLayerRenderers(TextStream& ts, const RenderLayer& layer, LayerPaintPhase paintPhase, int indent, RenderAsTextBehavior behavior)
+static void writeLayerRenderers(TextStream& ts, const RenderLayer& layer, LayerPaintPhase paintPhase, RenderAsTextBehavior behavior)
{
- if (paintPhase != LayerPaintPhaseBackground)
- write(ts, layer.renderer(), indent + 1, behavior);
+ if (paintPhase != LayerPaintPhaseBackground) {
+ TextStream::IndentScope indentScope(ts);
+ write(ts, layer.renderer(), behavior);
+ }
}
static LayoutSize maxLayoutOverflow(const RenderBox* box)
@@ -683,7 +685,7 @@
return LayoutSize(overflowRect.maxX(), overflowRect.maxY());
}
-static void writeLayers(TextStream& ts, const RenderLayer& rootLayer, RenderLayer& layer, const LayoutRect& paintRect, int indent, RenderAsTextBehavior behavior)
+static void writeLayers(TextStream& ts, const RenderLayer& rootLayer, RenderLayer& layer, const LayoutRect& paintRect, RenderAsTextBehavior behavior)
{
// FIXME: Apply overflow to the root layer to not break every test. Complete hack. Sigh.
LayoutRect paintDirtyRect(paintRect);
@@ -707,24 +709,25 @@
auto* negativeZOrderList = layer.negZOrderList();
bool paintsBackgroundSeparately = negativeZOrderList && negativeZOrderList->size() > 0;
if (shouldPaint && paintsBackgroundSeparately) {
- writeLayer(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), LayerPaintPhaseBackground, indent, behavior);
- writeLayerRenderers(ts, layer, LayerPaintPhaseBackground, indent, behavior);
+ writeLayer(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), LayerPaintPhaseBackground, behavior);
+ writeLayerRenderers(ts, layer, LayerPaintPhaseBackground, behavior);
}
if (negativeZOrderList) {
- int currIndent = indent;
if (behavior & RenderAsTextShowLayerNesting) {
- writeIndent(ts, indent);
- ts << " negative z-order list(" << negativeZOrderList->size() << ")\n";
- ++currIndent;
+ ts << indent << " negative z-order list(" << negativeZOrderList->size() << ")\n";
+ ts.increaseIndent();
}
for (auto* currLayer : *negativeZOrderList)
- writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, currIndent, behavior);
+ writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, behavior);
+
+ if (behavior & RenderAsTextShowLayerNesting)
+ ts.decreaseIndent();
}
if (shouldPaint) {
- writeLayer(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, indent, behavior);
+ writeLayer(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, behavior);
if (behavior & RenderAsTextShowLayerFragments) {
LayerFragments layerFragments;
@@ -731,27 +734,28 @@
layer.collectFragments(layerFragments, &rootLayer, paintDirtyRect, RenderLayer::PaginationInclusionMode::ExcludeCompositedPaginatedLayers, TemporaryClipRects, IgnoreOverlayScrollbarSize, RespectOverflowClip, offsetFromRoot);
if (layerFragments.size() > 1) {
+ TextStream::IndentScope indentScope(ts, 2);
for (unsigned i = 0; i < layerFragments.size(); ++i) {
const auto& fragment = layerFragments[i];
- writeIndent(ts, indent + 2);
- ts << " fragment " << i << ": bounds in layer " << fragment.layerBounds << " fragment bounds " << fragment.boundingBox << "\n";
+ ts << indent << " fragment " << i << ": bounds in layer " << fragment.layerBounds << " fragment bounds " << fragment.boundingBox << "\n";
}
}
}
- writeLayerRenderers(ts, layer, paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, indent, behavior);
+ writeLayerRenderers(ts, layer, paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, behavior);
}
if (auto* normalFlowList = layer.normalFlowList()) {
- int currIndent = indent;
if (behavior & RenderAsTextShowLayerNesting) {
- writeIndent(ts, indent);
- ts << " normal flow list(" << normalFlowList->size() << ")\n";
- ++currIndent;
+ ts << indent << " normal flow list(" << normalFlowList->size() << ")\n";
+ ts.increaseIndent();
}
for (auto* currLayer : *normalFlowList)
- writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, currIndent, behavior);
+ writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, behavior);
+
+ if (behavior & RenderAsTextShowLayerNesting)
+ ts.decreaseIndent();
}
if (auto* positiveZOrderList = layer.posZOrderList()) {
@@ -758,15 +762,16 @@
size_t layerCount = positiveZOrderList->size();
if (layerCount) {
- int currIndent = indent;
if (behavior & RenderAsTextShowLayerNesting) {
- writeIndent(ts, indent);
- ts << " positive z-order list(" << positiveZOrderList->size() << ")\n";
- ++currIndent;
+ ts << indent << " positive z-order list(" << positiveZOrderList->size() << ")\n";
+ ts.increaseIndent();
}
for (auto* currLayer : *positiveZOrderList)
- writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, currIndent, behavior);
+ writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, behavior);
+
+ if (behavior & RenderAsTextShowLayerNesting)
+ ts.decreaseIndent();
}
}
}
@@ -834,7 +839,7 @@
LOG(Layout, "externalRepresentation: dumping layer tree");
RenderLayer& layer = *renderer.layer();
- writeLayers(ts, layer, layer, layer.rect(), 0, behavior);
+ writeLayers(ts, layer, layer, layer.rect(), behavior);
writeSelection(ts, renderer);
return ts.release();
}
Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.h (225184 => 225185)
--- trunk/Source/WebCore/rendering/RenderTreeAsText.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -56,7 +56,7 @@
// You don't need pageWidthInPixels if you don't specify RenderAsTextInPrintingMode.
WEBCORE_EXPORT String externalRepresentation(Frame*, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
WEBCORE_EXPORT String externalRepresentation(Element*, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
-void write(WTF::TextStream&, const RenderObject&, int indent = 0, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
+void write(WTF::TextStream&, const RenderObject&, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
void writeDebugInfo(WTF::TextStream&, const RenderObject&, RenderAsTextBehavior = RenderAsTextBehaviorNormal);
class RenderTreeAsText {
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp (225184 => 225185)
--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -298,7 +298,7 @@
writeNameValuePair(ts, "color", text.style().visitedDependentColor(CSSPropertyColor).nameForRenderTreeAsText());
}
-static inline void writeSVGInlineTextBox(TextStream& ts, SVGInlineTextBox* textBox, int indent)
+static inline void writeSVGInlineTextBox(TextStream& ts, SVGInlineTextBox* textBox)
{
Vector<SVGTextFragment>& fragments = textBox->textFragments();
if (fragments.isEmpty())
@@ -307,10 +307,12 @@
const SVGRenderStyle& svgStyle = textBox->renderer().style().svgStyle();
String text = textBox->renderer().text();
+ TextStream::IndentScope indentScope(ts);
+
unsigned fragmentsSize = fragments.size();
for (unsigned i = 0; i < fragmentsSize; ++i) {
SVGTextFragment& fragment = fragments.at(i);
- writeIndent(ts, indent + 1);
+ ts << indent;
unsigned startOffset = fragment.characterOffset;
unsigned endOffset = fragment.characterOffset + fragment.length;
@@ -352,19 +354,26 @@
}
}
-static inline void writeSVGInlineTextBoxes(TextStream& ts, const RenderText& text, int indent)
+static inline void writeSVGInlineTextBoxes(TextStream& ts, const RenderText& text)
{
for (InlineTextBox* box = text.firstTextBox(); box; box = box->nextTextBox()) {
if (!is<SVGInlineTextBox>(*box))
continue;
- writeSVGInlineTextBox(ts, downcast<SVGInlineTextBox>(box), indent);
+ writeSVGInlineTextBox(ts, downcast<SVGInlineTextBox>(box));
}
}
-static void writeStandardPrefix(TextStream& ts, const RenderObject& object, int indent, RenderAsTextBehavior behavior)
+enum class WriteIndentOrNot {
+ No,
+ Yes
+};
+
+static void writeStandardPrefix(TextStream& ts, const RenderObject& object, RenderAsTextBehavior behavior, WriteIndentOrNot writeIndent = WriteIndentOrNot::Yes)
{
- writeIndent(ts, indent);
+ if (writeIndent == WriteIndentOrNot::Yes)
+ ts << indent;
+
ts << object.renderName();
if (behavior & RenderAsTextShowAddresses)
@@ -376,10 +385,12 @@
writeDebugInfo(ts, object, behavior);
}
-static void writeChildren(TextStream& ts, const RenderElement& parent, int indent, RenderAsTextBehavior behavior)
+static void writeChildren(TextStream& ts, const RenderElement& parent, RenderAsTextBehavior behavior)
{
+ TextStream::IndentScope indentScope(ts);
+
for (const auto& child : childrenOfType<RenderObject>(parent))
- write(ts, child, indent + 1, behavior);
+ write(ts, child, behavior);
}
static inline void writeCommonGradientProperties(TextStream& ts, SVGSpreadMethodType spreadMethod, const AffineTransform& gradientTransform, SVGUnitTypes::SVGUnitType gradientUnits)
@@ -393,9 +404,9 @@
ts << " [gradientTransform=" << gradientTransform << "]";
}
-void writeSVGResourceContainer(TextStream& ts, const RenderSVGResourceContainer& resource, int indent, RenderAsTextBehavior behavior)
+void writeSVGResourceContainer(TextStream& ts, const RenderSVGResourceContainer& resource, RenderAsTextBehavior behavior)
{
- writeStandardPrefix(ts, resource, indent, behavior);
+ writeStandardPrefix(ts, resource, behavior);
const AtomicString& id = resource.element().getIdAttribute();
writeNameAndQuotedValue(ts, "id", id);
@@ -414,8 +425,10 @@
FloatRect dummyRect;
RefPtr<SVGFilter> dummyFilter = SVGFilter::create(AffineTransform(), dummyRect, dummyRect, dummyRect, true);
if (auto builder = filter.buildPrimitives(*dummyFilter)) {
+ TextStream::IndentScope indentScope(ts);
+
if (FilterEffect* lastEffect = builder->lastEffect())
- lastEffect->externalRepresentation(ts, indent + 1);
+ lastEffect->externalRepresentation(ts);
}
} else if (resource.resourceType() == ClipperResourceType) {
const auto& clipper = static_cast<const RenderSVGResourceClipper&>(resource);
@@ -472,69 +485,69 @@
ts << " [center=" << centerPoint << "] [focal=" << focalPoint << "] [radius=" << radius << "] [focalRadius=" << focalRadius << "]\n";
} else
ts << "\n";
- writeChildren(ts, resource, indent, behavior);
+ writeChildren(ts, resource, behavior);
}
-void writeSVGContainer(TextStream& ts, const RenderSVGContainer& container, int indent, RenderAsTextBehavior behavior)
+void writeSVGContainer(TextStream& ts, const RenderSVGContainer& container, RenderAsTextBehavior behavior)
{
// Currently RenderSVGResourceFilterPrimitive has no meaningful output.
if (container.isSVGResourceFilterPrimitive())
return;
- writeStandardPrefix(ts, container, indent, behavior);
+ writeStandardPrefix(ts, container, behavior);
writePositionAndStyle(ts, container, behavior);
ts << "\n";
- writeResources(ts, container, indent, behavior);
- writeChildren(ts, container, indent, behavior);
+ writeResources(ts, container, behavior);
+ writeChildren(ts, container, behavior);
}
-void write(TextStream& ts, const RenderSVGRoot& root, int indent, RenderAsTextBehavior behavior)
+void write(TextStream& ts, const RenderSVGRoot& root, RenderAsTextBehavior behavior)
{
- writeStandardPrefix(ts, root, indent, behavior);
+ writeStandardPrefix(ts, root, behavior);
writePositionAndStyle(ts, root, behavior);
ts << "\n";
- writeChildren(ts, root, indent, behavior);
+ writeChildren(ts, root, behavior);
}
-void writeSVGText(TextStream& ts, const RenderSVGText& text, int indent, RenderAsTextBehavior behavior)
+void writeSVGText(TextStream& ts, const RenderSVGText& text, RenderAsTextBehavior behavior)
{
- writeStandardPrefix(ts, text, indent, behavior);
+ writeStandardPrefix(ts, text, behavior);
writeRenderSVGTextBox(ts, text);
ts << "\n";
- writeResources(ts, text, indent, behavior);
- writeChildren(ts, text, indent, behavior);
+ writeResources(ts, text, behavior);
+ writeChildren(ts, text, behavior);
}
-void writeSVGInlineText(TextStream& ts, const RenderSVGInlineText& text, int indent, RenderAsTextBehavior behavior)
+void writeSVGInlineText(TextStream& ts, const RenderSVGInlineText& text, RenderAsTextBehavior behavior)
{
- writeStandardPrefix(ts, text, indent, behavior);
+ writeStandardPrefix(ts, text, behavior);
ts << " " << enclosingIntRect(FloatRect(text.firstRunLocation(), text.floatLinesBoundingBox().size())) << "\n";
- writeResources(ts, text, indent, behavior);
- writeSVGInlineTextBoxes(ts, text, indent);
+ writeResources(ts, text, behavior);
+ writeSVGInlineTextBoxes(ts, text);
}
-void writeSVGImage(TextStream& ts, const RenderSVGImage& image, int indent, RenderAsTextBehavior behavior)
+void writeSVGImage(TextStream& ts, const RenderSVGImage& image, RenderAsTextBehavior behavior)
{
- writeStandardPrefix(ts, image, indent, behavior);
+ writeStandardPrefix(ts, image, behavior);
writePositionAndStyle(ts, image, behavior);
ts << "\n";
- writeResources(ts, image, indent, behavior);
+ writeResources(ts, image, behavior);
}
-void write(TextStream& ts, const RenderSVGShape& shape, int indent, RenderAsTextBehavior behavior)
+void write(TextStream& ts, const RenderSVGShape& shape, RenderAsTextBehavior behavior)
{
- writeStandardPrefix(ts, shape, indent, behavior);
+ writeStandardPrefix(ts, shape, behavior);
ts << shape << "\n";
- writeResources(ts, shape, indent, behavior);
+ writeResources(ts, shape, behavior);
}
-void writeSVGGradientStop(TextStream& ts, const RenderSVGGradientStop& stop, int indent, RenderAsTextBehavior behavior)
+void writeSVGGradientStop(TextStream& ts, const RenderSVGGradientStop& stop, RenderAsTextBehavior behavior)
{
- writeStandardPrefix(ts, stop, indent, behavior);
+ writeStandardPrefix(ts, stop, behavior);
ts << " [offset=" << stop.element().offset() << "] [color=" << stop.element().stopColorIncludingOpacity() << "]\n";
}
-void writeResources(TextStream& ts, const RenderObject& renderer, int indent, RenderAsTextBehavior behavior)
+void writeResources(TextStream& ts, const RenderObject& renderer, RenderAsTextBehavior behavior)
{
const RenderStyle& style = renderer.style();
const SVGRenderStyle& svgStyle = style.svgStyle();
@@ -543,21 +556,19 @@
// For now leave the DRT output as is, but later on we should change this so cycles are properly ignored in the DRT output.
if (!svgStyle.maskerResource().isEmpty()) {
if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(renderer.document(), svgStyle.maskerResource())) {
- writeIndent(ts, indent);
- ts << " ";
+ ts << indent << " ";
writeNameAndQuotedValue(ts, "masker", svgStyle.maskerResource());
ts << " ";
- writeStandardPrefix(ts, *masker, 0, behavior);
+ writeStandardPrefix(ts, *masker, behavior, WriteIndentOrNot::No);
ts << " " << masker->resourceBoundingBox(renderer) << "\n";
}
}
if (!svgStyle.clipperResource().isEmpty()) {
if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(renderer.document(), svgStyle.clipperResource())) {
- writeIndent(ts, indent);
- ts << " ";
+ ts << indent << " ";
writeNameAndQuotedValue(ts, "clipPath", svgStyle.clipperResource());
ts << " ";
- writeStandardPrefix(ts, *clipper, 0, behavior);
+ writeStandardPrefix(ts, *clipper, behavior, WriteIndentOrNot::No);
ts << " " << clipper->resourceBoundingBox(renderer) << "\n";
}
}
@@ -569,11 +580,10 @@
const auto& referenceFilterOperation = downcast<ReferenceFilterOperation>(filterOperation);
AtomicString id = SVGURIReference::fragmentIdentifierFromIRIString(referenceFilterOperation.url(), renderer.document());
if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(renderer.document(), id)) {
- writeIndent(ts, indent);
- ts << " ";
+ ts << indent << " ";
writeNameAndQuotedValue(ts, "filter", id);
ts << " ";
- writeStandardPrefix(ts, *filter, 0, behavior);
+ writeStandardPrefix(ts, *filter, behavior, WriteIndentOrNot::No);
ts << " " << filter->resourceBoundingBox(renderer) << "\n";
}
}
Modified: trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h (225184 => 225185)
--- trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -48,15 +48,15 @@
class SVGUnitTypes;
// functions used by the main RenderTreeAsText code
-void write(WTF::TextStream&, const RenderSVGShape&, int indent, RenderAsTextBehavior);
-void write(WTF::TextStream&, const RenderSVGRoot&, int indent, RenderAsTextBehavior);
-void writeSVGGradientStop(WTF::TextStream&, const RenderSVGGradientStop&, int indent, RenderAsTextBehavior);
-void writeSVGResourceContainer(WTF::TextStream&, const RenderSVGResourceContainer&, int indent, RenderAsTextBehavior);
-void writeSVGContainer(WTF::TextStream&, const RenderSVGContainer&, int indent, RenderAsTextBehavior);
-void writeSVGImage(WTF::TextStream&, const RenderSVGImage&, int indent, RenderAsTextBehavior);
-void writeSVGInlineText(WTF::TextStream&, const RenderSVGInlineText&, int indent, RenderAsTextBehavior);
-void writeSVGText(WTF::TextStream&, const RenderSVGText&, int indent, RenderAsTextBehavior);
-void writeResources(WTF::TextStream&, const RenderObject&, int indent, RenderAsTextBehavior);
+void write(WTF::TextStream&, const RenderSVGShape&, RenderAsTextBehavior);
+void write(WTF::TextStream&, const RenderSVGRoot&, RenderAsTextBehavior);
+void writeSVGGradientStop(WTF::TextStream&, const RenderSVGGradientStop&, RenderAsTextBehavior);
+void writeSVGResourceContainer(WTF::TextStream&, const RenderSVGResourceContainer&, RenderAsTextBehavior);
+void writeSVGContainer(WTF::TextStream&, const RenderSVGContainer&, RenderAsTextBehavior);
+void writeSVGImage(WTF::TextStream&, const RenderSVGImage&, RenderAsTextBehavior);
+void writeSVGInlineText(WTF::TextStream&, const RenderSVGInlineText&, RenderAsTextBehavior);
+void writeSVGText(WTF::TextStream&, const RenderSVGText&, RenderAsTextBehavior);
+void writeResources(WTF::TextStream&, const RenderObject&, RenderAsTextBehavior);
// helper operators specific to dumping the render tree. these are used in various classes to dump the render tree
// these could be defined in separate namespace to avoid matching these generic signatures unintentionally.
Modified: trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp (225184 => 225185)
--- trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp 2017-11-27 20:02:09 UTC (rev 225185)
@@ -137,7 +137,7 @@
resultImage->context().drawImage(*m_image, destRect, srcRect);
}
-TextStream& FEImage::externalRepresentation(TextStream& ts, int indent) const
+TextStream& FEImage::externalRepresentation(TextStream& ts) const
{
FloatSize imageSize;
if (m_image)
@@ -144,8 +144,7 @@
imageSize = m_image->size();
else if (RenderObject* renderer = referencedRenderer())
imageSize = enclosingIntRect(renderer->repaintRectInLocalCoordinates()).size();
- writeIndent(ts, indent);
- ts << "[feImage";
+ ts << indent << "[feImage";
FilterEffect::externalRepresentation(ts);
ts << " image-size=\"" << imageSize.width() << "x" << imageSize.height() << "\"]\n";
// FIXME: should this dump also object returned by SVGFEImage::image() ?
Modified: trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h (225184 => 225185)
--- trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h 2017-11-27 19:51:13 UTC (rev 225184)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h 2017-11-27 20:02:09 UTC (rev 225185)
@@ -49,7 +49,7 @@
void platformApplySoftware() final;
void determineAbsolutePaintRect() final;
- WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const final;
+ WTF::TextStream& externalRepresentation(WTF::TextStream&) const final;
RefPtr<Image> m_image;