Allow customization of TextStream-based logging for geometry types
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Nov 2016 20:22:37 +0000 (20:22 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Nov 2016 20:22:37 +0000 (20:22 +0000)
commit80fe65ae58d3878b3bf473ff409a1ac73f7ac7e2
tree4c7a23097820a6dff5d233c4c53a66b9fbc36929
parent6dcc5a7adbbb5b56734dea6963f16157ae82ce6e
Allow customization of TextStream-based logging for geometry types
https://bugs.webkit.org/show_bug.cgi?id=164460

Reviewed by Zalan Bujtas.

TextStream-based logging was constrained by the requirement to maintain compatibility
with DRT-style output, which includes cumbersome rect logging ("at (5,0) size 40x40")
and dumping LayoutRects as IntRects.

Add some formatting flags so that other TextStream clients (e.g. logging) can have
more readable output, and opt into automatic FormatNumberRespectingIntegers behavior.

TextStreams whose output appears in test results are given flags to avoid behavior
changes, but in the longer term test results should be updated.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::replayDisplayListAsText):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::scrollingStateTreeAsText):
* platform/graphics/FloatPoint.cpp:
(WebCore::operator<<):
* platform/graphics/FloatRect.cpp:
(WebCore::operator<<):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::layerTreeAsText):
* platform/graphics/IntRect.cpp:
(WebCore::operator<<):
* platform/graphics/LayoutPoint.cpp:
(WebCore::operator<<):
* platform/graphics/LayoutRect.cpp:
(WebCore::operator<<):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::replayDisplayListAsText):
* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::asText):
* platform/text/TextStream.cpp:
(WebCore::TextStream::operator<<):
* platform/text/TextStream.h:
(WebCore::TextStream::TextStream):
(WebCore::TextStream::formattingFlags):
(WebCore::TextStream::setFormattingFlags):
(WebCore::TextStream::hasFormattingFlag):
(WebCore::TextStream::increaseIndent):
(WebCore::TextStream::decreaseIndent):
* rendering/RenderTreeAsText.cpp:
(WebCore::externalRepresentation):
(WebCore::counterValueForElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
Source/WebCore/page/scrolling/ScrollingStateNode.cpp
Source/WebCore/platform/graphics/FloatPoint.cpp
Source/WebCore/platform/graphics/FloatRect.cpp
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/IntRect.cpp
Source/WebCore/platform/graphics/LayoutPoint.cpp
Source/WebCore/platform/graphics/LayoutRect.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/displaylists/DisplayList.cpp
Source/WebCore/platform/text/TextStream.cpp
Source/WebCore/platform/text/TextStream.h
Source/WebCore/rendering/RenderTreeAsText.cpp