Allow tree dumping functions to be used in release builds by switching a flag
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Mar 2015 06:19:30 +0000 (06:19 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Mar 2015 06:19:30 +0000 (06:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=142379

Reviewed by Zalan Bujtas.

There are various tree dumping functions that are useful for debugging, and sometimes
you want to be able to use them in release builds. Currently they are surrounded by
in config.h

* config.h:
* dom/DocumentMarkerController.cpp:
* dom/DocumentMarkerController.h:
* dom/Element.cpp:
* dom/Element.h:
* dom/Node.cpp:
* dom/Node.h:
* dom/Position.cpp: Position::debugPosition(const char* msg) was available in release builds, but this changes
is to respect ENABLE_TREE_DEBUGGING, which I think is correct.
* dom/Position.h:
* dom/Range.cpp:
* dom/Range.h:
* dom/Text.cpp:
* dom/Text.h:
* rendering/CounterNode.cpp:
* rendering/CounterNode.h:
* rendering/InlineBox.cpp:
* rendering/InlineBox.h:
* rendering/InlineFlowBox.cpp:
* rendering/InlineFlowBox.h:
* rendering/InlineTextBox.cpp:
* rendering/InlineTextBox.h:
* rendering/RenderBlockFlow.cpp:
* rendering/RenderBlockFlow.h:
* rendering/RenderCounter.cpp:
* rendering/RenderCounter.h:
* rendering/RenderLayer.cpp:
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateForegroundLayer):
(WebCore::RenderLayerBacking::updateBackgroundLayer):
* rendering/RenderLayerCompositor.cpp:
(WebCore::CompositingState::CompositingState):
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
* rendering/RenderObject.cpp:
* rendering/RenderObject.h: showTreeCharacterOffset was unused.
* rendering/RootInlineBox.cpp:
* rendering/RootInlineBox.h:
* rendering/SimpleLineLayoutFunctions.cpp:
* rendering/SimpleLineLayoutFunctions.h:
* rendering/svg/SVGResources.cpp:
* rendering/svg/SVGResources.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181139 268f45cc-cd09-0410-ab3c-d52691b4dbfc

38 files changed:
Source/WebCore/ChangeLog
Source/WebCore/config.h
Source/WebCore/dom/DocumentMarkerController.cpp
Source/WebCore/dom/DocumentMarkerController.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/Position.cpp
Source/WebCore/dom/Position.h
Source/WebCore/dom/Range.cpp
Source/WebCore/dom/Range.h
Source/WebCore/dom/Text.cpp
Source/WebCore/dom/Text.h
Source/WebCore/rendering/CounterNode.cpp
Source/WebCore/rendering/CounterNode.h
Source/WebCore/rendering/InlineBox.cpp
Source/WebCore/rendering/InlineBox.h
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/InlineFlowBox.h
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/InlineTextBox.h
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockFlow.h
Source/WebCore/rendering/RenderCounter.cpp
Source/WebCore/rendering/RenderCounter.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/RootInlineBox.h
Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
Source/WebCore/rendering/SimpleLineLayoutFunctions.h
Source/WebCore/rendering/svg/SVGResources.cpp
Source/WebCore/rendering/svg/SVGResources.h

index 6dca011..5c092aa 100644 (file)
@@ -1,3 +1,65 @@
+2015-03-05  Simon Fraser  <simon.fraser@apple.com>
+
+        Allow tree dumping functions to be used in release builds by switching a flag
+        https://bugs.webkit.org/show_bug.cgi?id=142379
+
+        Reviewed by Zalan Bujtas.
+
+        There are various tree dumping functions that are useful for debugging, and sometimes
+        you want to be able to use them in release builds. Currently they are surrounded by
+        #ifndef NDEBUG. Change this to #if ENABLE(TREE_DEBUGGING), which is defined to 0 or 1
+        in config.h
+
+        * config.h:
+        * dom/DocumentMarkerController.cpp:
+        * dom/DocumentMarkerController.h:
+        * dom/Element.cpp:
+        * dom/Element.h:
+        * dom/Node.cpp:
+        * dom/Node.h:
+        * dom/Position.cpp: Position::debugPosition(const char* msg) was available in release builds, but this changes
+        is to respect ENABLE_TREE_DEBUGGING, which I think is correct.
+        * dom/Position.h:
+        * dom/Range.cpp:
+        * dom/Range.h:
+        * dom/Text.cpp:
+        * dom/Text.h:
+        * rendering/CounterNode.cpp:
+        * rendering/CounterNode.h:
+        * rendering/InlineBox.cpp:
+        * rendering/InlineBox.h:
+        * rendering/InlineFlowBox.cpp:
+        * rendering/InlineFlowBox.h:
+        * rendering/InlineTextBox.cpp:
+        * rendering/InlineTextBox.h:
+        * rendering/RenderBlockFlow.cpp:
+        * rendering/RenderBlockFlow.h:
+        * rendering/RenderCounter.cpp:
+        * rendering/RenderCounter.h:
+        * rendering/RenderLayer.cpp:
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::createGraphicsLayer):
+        (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
+        (WebCore::RenderLayerBacking::updateForegroundLayer):
+        (WebCore::RenderLayerBacking::updateBackgroundLayer):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::CompositingState::CompositingState):
+        (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
+        (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
+        (WebCore::RenderLayerCompositor::updateLayerForHeader):
+        (WebCore::RenderLayerCompositor::updateLayerForFooter):
+        (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
+        (WebCore::RenderLayerCompositor::ensureRootLayer):
+        * rendering/RenderObject.cpp:
+        * rendering/RenderObject.h: showTreeCharacterOffset was unused.
+        * rendering/RootInlineBox.cpp:
+        * rendering/RootInlineBox.h:
+        * rendering/SimpleLineLayoutFunctions.cpp:
+        * rendering/SimpleLineLayoutFunctions.h:
+        * rendering/svg/SVGResources.cpp:
+        * rendering/svg/SVGResources.h:
+
 2015-03-05  Brent Fulgham  <bfulgham@apple.com>
 
         [Mac] 'Gliding' phase of scroll snap points is incorrect on desktop
index 4876084..50d9b18 100644 (file)
@@ -135,3 +135,8 @@ typedef float CGFloat;
 
 #endif
 
+#ifdef NDEBUG
+#define ENABLE_TREE_DEBUGGING 0
+#else
+#define ENABLE_TREE_DEBUGGING 1
+#endif
index 096c120..4a3ccf8 100644 (file)
@@ -724,7 +724,7 @@ void DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange(Range*
     }
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 void DocumentMarkerController::showMarkers() const
 {
     fprintf(stderr, "%d nodes have markers:\n", m_markers.size());
@@ -745,7 +745,7 @@ void DocumentMarkerController::showMarkers() const
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 void showDocumentMarkers(const WebCore::DocumentMarkerController* controller)
 {
     if (controller)
index 769dd92..32ca300 100644 (file)
@@ -89,7 +89,7 @@ public:
     WEBCORE_EXPORT Vector<IntRect> renderedRectsForMarkers(DocumentMarker::MarkerType);
     void clearDescriptionOnMarkersIntersectingRange(Range*, DocumentMarker::MarkerTypes);
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     void showMarkers() const;
 #endif
 
@@ -108,7 +108,7 @@ private:
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 void showDocumentMarkers(const WebCore::DocumentMarkerController*);
 #endif
 
index 7dfecbd..8ca1f1e 100644 (file)
@@ -1685,7 +1685,7 @@ void Element::finishParsingChildren()
         styleResolver->popParentElement(this);
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 void Element::formatForDebugger(char* buffer, unsigned length) const
 {
     StringBuilder result;
index f9115bf..e36605b 100644 (file)
@@ -625,7 +625,7 @@ private:
     void addAttributeInternal(const QualifiedName&, const AtomicString& value, SynchronizationOfLazyAttribute);
     void removeAttributeInternal(unsigned index, SynchronizationOfLazyAttribute);
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     virtual void formatForDebugger(char* buffer, unsigned length) const override;
 #endif
 
index 3572487..873f31e 100644 (file)
@@ -1486,7 +1486,7 @@ FloatPoint Node::convertFromPage(const FloatPoint& p) const
     return p;
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 static void appendAttributeDesc(const Node* node, StringBuilder& stringBuilder, const QualifiedName& name, const char* attrDesc)
 {
@@ -1654,7 +1654,7 @@ void Node::showTreeForThisAcrossFrame() const
     showSubTreeAcrossFrame(rootNode, this, "");
 }
 
-#endif
+#endif // ENABLE(TREE_DEBUGGING)
 
 // --------
 
@@ -2222,7 +2222,7 @@ bool Node::inRenderedDocument() const
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 void showTree(const WebCore::Node* node)
 {
@@ -2236,4 +2236,4 @@ void showNodePath(const WebCore::Node* node)
         node->showNodePathForThis();
 }
 
-#endif
+#endif // ENABLE(TREE_DEBUGGING)
index 2465b06..71afc4d 100644 (file)
@@ -488,7 +488,7 @@ public:
     //
     virtual void removedFrom(ContainerNode& insertionPoint);
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     virtual void formatForDebugger(char* buffer, unsigned length) const;
 
     void showNode(const char* prefix = "") const;
@@ -496,7 +496,7 @@ public:
     void showNodePathForThis() const;
     void showTreeAndMark(const Node* markedNode1, const char* markedLabel1, const Node* markedNode2 = nullptr, const char* markedLabel2 = nullptr) const;
     void showTreeForThisAcrossFrame() const;
-#endif
+#endif // ENABLE(TREE_DEBUGGING)
 
     void invalidateNodeListAndCollectionCachesInAncestors(const QualifiedName* attrName = nullptr, Element* attributeOwnerElement = nullptr);
     NodeListsNodeData* nodeLists();
@@ -733,7 +733,7 @@ inline ContainerNode* Node::parentNodeGuaranteedHostFree() const
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 // Outside the WebCore namespace for ease of invocation from gdb.
 void showTree(const WebCore::Node*);
 void showNodePath(const WebCore::Node*);
index 1fd4265..e044043 100644 (file)
@@ -1346,6 +1346,7 @@ TextDirection Position::primaryDirection() const
     return LTR;
 }
 
+#if ENABLE(TREE_DEBUGGING)
 
 void Position::debugPosition(const char* msg) const
 {
@@ -1355,8 +1356,6 @@ void Position::debugPosition(const char* msg) const
         fprintf(stderr, "Position [%s]: %s [%p] at %d\n", msg, deprecatedNode()->nodeName().utf8().data(), deprecatedNode(), m_offset);
 }
 
-#ifndef NDEBUG
-
 void Position::formatForDebugger(char* buffer, unsigned length) const
 {
     StringBuilder result;
@@ -1409,11 +1408,9 @@ void Position::showTreeForThis() const
 
 #endif
 
-
-
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 void showTree(const WebCore::Position& pos)
 {
index b69564c..9d6bd2e 100644 (file)
@@ -202,7 +202,7 @@ public:
     
     void debugPosition(const char* msg = "") const;
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     void formatForDebugger(char* buffer, unsigned length) const;
     void showAnchorTypeAndOffset() const;
     void showTreeForThis() const;
@@ -342,7 +342,7 @@ inline bool offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode)
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 // Outside the WebCore namespace for ease of invocation from gdb.
 void showTree(const WebCore::Position&);
 void showTree(const WebCore::Position*);
index 4ce102d..2673add 100644 (file)
@@ -1919,7 +1919,7 @@ void Range::collectSelectionRects(Vector<SelectionRect>& rects)
 }
 #endif
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 void Range::formatForDebugger(char* buffer, unsigned length) const
 {
     StringBuilder result;
@@ -2251,7 +2251,7 @@ FloatRect Range::boundingRect() const
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 void showTree(const WebCore::Range* range)
 {
index 68ad0b7..5d4fb29 100644 (file)
@@ -151,7 +151,7 @@ public:
     Ref<ClientRectList> getClientRects() const;
     Ref<ClientRect> getBoundingClientRect() const;
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     void formatForDebugger(char* buffer, unsigned length) const;
 #endif
 
@@ -187,7 +187,7 @@ bool rangesOverlap(const Range*, const Range*);
 
 } // namespace
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 // Outside the WebCore namespace for ease of invocation from gdb.
 void showTree(const WebCore::Range*);
 #endif
index f90f03f..a0a5c6f 100644 (file)
@@ -216,7 +216,7 @@ Ref<Text> Text::createWithLengthLimit(Document& document, const String& data, un
     return result;
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 void Text::formatForDebugger(char* buffer, unsigned length) const
 {
     StringBuilder result;
index b2df340..a967436 100644 (file)
@@ -67,7 +67,7 @@ private:
 
     virtual Ref<Text> virtualCreate(const String&);
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     virtual void formatForDebugger(char* buffer, unsigned length) const override;
 #endif
 };
index 01ec9a3..326ac98 100644 (file)
@@ -350,7 +350,7 @@ void CounterNode::removeChild(CounterNode* oldChild)
         next->recount();
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 static void showTreeAndMark(const CounterNode* node)
 {
@@ -374,7 +374,7 @@ static void showTreeAndMark(const CounterNode* node)
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 void showCounterTree(const WebCore::CounterNode* counter)
 {
index 997c248..03d9e3d 100644 (file)
@@ -93,7 +93,7 @@ private:
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 // Outside the WebCore namespace for ease of invocation from gdb.
 void showCounterTree(const WebCore::CounterNode*);
 #endif
index 4dbddba..efb0910 100644 (file)
@@ -30,7 +30,7 @@
 #include "RenderLineBreak.h"
 #include "RootInlineBox.h"
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 #include <stdio.h>
 #endif
 
@@ -84,7 +84,7 @@ void InlineBox::removeFromParent()
         parent()->removeChild(this);
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 const char* InlineBox::boxName() const
 {
@@ -119,7 +119,7 @@ void InlineBox::showLineBox(bool mark, int depth) const
     fprintf(stderr, "%s  (%.2f, %.2f) (%.2f, %.2f) (%p)\n", boxName(), x(), y(), width(), height(), this);
 }
 
-#endif
+#endif // ENABLE(TREE_DEBUGGING)
 
 float InlineBox::logicalHeight() const
 {
@@ -328,7 +328,7 @@ LayoutPoint InlineBox::flipForWritingMode(const LayoutPoint& point)
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 void showNodeTree(const WebCore::InlineBox* inlineBox)
 {
index 1f7369b..46e68af 100644 (file)
@@ -73,7 +73,7 @@ public:
     virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) = 0;
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom) = 0;
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     void showNodeTreeForThis() const;
     void showLineTreeForThis() const;
     
@@ -446,7 +446,7 @@ SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
     static bool isType(const WebCore::InlineBox& box) { return box.predicate; } \
 SPECIALIZE_TYPE_TRAITS_END()
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 // Outside the WebCore namespace for ease of invocation from gdb.
 void showNodeTree(const WebCore::InlineBox*);
 void showLineTree(const WebCore::InlineBox*);
index dd90eaa..ae0c9ca 100644 (file)
@@ -1687,7 +1687,7 @@ void InlineFlowBox::computeReplacedAndTextLineTopAndBottom(LayoutUnit& lineTop,
     }
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 const char* InlineFlowBox::boxName() const
 {
@@ -1701,6 +1701,10 @@ void InlineFlowBox::showLineTreeAndMark(const InlineBox* markedBox, int depth) c
         box->showLineTreeAndMark(markedBox, depth + 1);
 }
 
+#endif
+
+#ifndef NDEBUG
+
 void InlineFlowBox::checkConsistency() const
 {
     assertNotDeleted();
index ed61692..0679989 100644 (file)
@@ -70,7 +70,7 @@ public:
     virtual ~InlineFlowBox();
 #endif
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     virtual void showLineTreeAndMark(const InlineBox* markedBox, int depth) const override;
     virtual const char* boxName() const override;
 #endif
@@ -367,7 +367,7 @@ inline void InlineFlowBox::setHasBadChildList()
 
 SPECIALIZE_TYPE_TRAITS_INLINE_BOX(InlineFlowBox, isInlineFlowBox())
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 // Outside the WebCore namespace for ease of invocation from gdb.
 void showTree(const WebCore::InlineFlowBox*);
 #endif
index 70566f0..4eb0d79 100644 (file)
@@ -1393,7 +1393,7 @@ TextRun InlineTextBox::constructTextRun(const RenderStyle& style, const FontCasc
     return run;
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 const char* InlineTextBox::boxName() const
 {
index dd17193..afecc40 100644 (file)
@@ -94,7 +94,7 @@ public:
 
     virtual void dirtyOwnLineBoxes() { dirtyLineBoxes(); }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     virtual void showLineBox(bool mark, int depth) const override final;
     virtual const char* boxName() const override final;
 #endif
index 5b6a2c5..27943ed 100644 (file)
@@ -3556,7 +3556,7 @@ void RenderBlockFlow::ensureLineBoxes()
         clearNeedsLayout();
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 void RenderBlockFlow::showLineTreeAndMark(const InlineBox* markedBox, int depth) const
 {
     for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRootBox())
index 2bf602a..2adfd70 100644 (file)
@@ -363,7 +363,7 @@ public:
     void deleteLineBoxesBeforeSimpleLineLayout();
     void ensureLineBoxes();
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     void showLineTreeAndMark(const InlineBox* markedBox, int depth) const;
 #endif
 
index fb1cfa5..918a4f8 100644 (file)
@@ -35,7 +35,7 @@
 #include "RenderView.h"
 #include <wtf/StdLibExtras.h>
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 #include <stdio.h>
 #endif
 
@@ -600,7 +600,7 @@ void RenderCounter::rendererStyleChanged(RenderElement& renderer, const RenderSt
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 void showCounterRendererTree(const WebCore::RenderObject* renderer, const char* counterName)
 {
index 61300fd..75dcfc8 100644 (file)
@@ -63,7 +63,7 @@ private:
 
 SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderCounter, isCounter())
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 // Outside the WebCore namespace for ease of invocation from gdb.
 void showCounterRendererTree(const WebCore::RenderObject*, const char* counterName = 0);
 #endif
index 5c00fb3..3a60d64 100644 (file)
@@ -7047,7 +7047,7 @@ RenderNamedFlowFragment* RenderLayer::currentRenderNamedFlowFragment() const
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 void showLayerTree(const WebCore::RenderLayer* layer)
 {
index 6251cbc..e7349ca 100644 (file)
@@ -1172,7 +1172,7 @@ void makeMatrixRenderable(TransformationMatrix&, bool has3DRendering);
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 // Outside the WebCore namespace for ease of invocation from gdb.
 void showLayerTree(const WebCore::RenderLayer*);
 void showLayerTree(const WebCore::RenderObject*);
index 27617c1..db32a3f 100644 (file)
@@ -169,7 +169,7 @@ std::unique_ptr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(const Str
 
     std::unique_ptr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFactory, *this, layerType);
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     graphicsLayer->setName(name);
 #else
     UNUSED_PARAM(name);
@@ -275,7 +275,7 @@ void RenderLayerBacking::updateDebugIndicators(bool showBorder, bool showRepaint
 void RenderLayerBacking::createPrimaryGraphicsLayer()
 {
     String layerName;
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     layerName = m_owningLayer.name();
 #endif
     
@@ -1366,7 +1366,7 @@ bool RenderLayerBacking::updateForegroundLayer(bool needsForegroundLayer)
     if (needsForegroundLayer) {
         if (!m_foregroundLayer) {
             String layerName;
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
             layerName = m_owningLayer.name() + " (foreground)";
 #endif
             m_foregroundLayer = createGraphicsLayer(layerName);
@@ -1395,7 +1395,7 @@ bool RenderLayerBacking::updateBackgroundLayer(bool needsBackgroundLayer)
     if (needsBackgroundLayer) {
         if (!m_backgroundLayer) {
             String layerName;
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
             layerName = m_owningLayer.name() + " (background)";
 #endif
             m_backgroundLayer = createGraphicsLayer(layerName);
@@ -1407,7 +1407,7 @@ bool RenderLayerBacking::updateBackgroundLayer(bool needsBackgroundLayer)
         
         if (!m_contentsContainmentLayer) {
             String layerName;
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
             layerName = m_owningLayer.name() + " (contents containment)";
 #endif
             m_contentsContainmentLayer = createGraphicsLayer(layerName);
index 672eb26..c482871 100644 (file)
@@ -71,7 +71,7 @@
 #include "RenderScrollbar.h"
 #endif
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 #include "RenderTreeAsText.h"
 #endif
 
@@ -225,7 +225,7 @@ struct CompositingState {
 #if ENABLE(CSS_COMPOSITING)
         , m_hasNotIsolatedCompositedBlendingDescendants(false)
 #endif
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
         , m_depth(0)
 #endif
     {
@@ -238,7 +238,7 @@ struct CompositingState {
 #if ENABLE(CSS_COMPOSITING)
         , m_hasNotIsolatedCompositedBlendingDescendants(other.m_hasNotIsolatedCompositedBlendingDescendants)
 #endif
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
         , m_depth(other.m_depth + 1)
 #endif
     {
@@ -250,7 +250,7 @@ struct CompositingState {
 #if ENABLE(CSS_COMPOSITING)
     bool m_hasNotIsolatedCompositedBlendingDescendants;
 #endif
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     int m_depth;
 #endif
 };
@@ -3015,7 +3015,7 @@ GraphicsLayer* RenderLayerCompositor::updateLayerForTopOverhangArea(bool wantsLa
 
     if (!m_layerForTopOverhangArea) {
         m_layerForTopOverhangArea = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
         m_layerForTopOverhangArea->setName("top overhang area");
 #endif
         m_scrollLayer->addChildBelow(m_layerForTopOverhangArea.get(), m_rootContentLayer.get());
@@ -3039,7 +3039,7 @@ GraphicsLayer* RenderLayerCompositor::updateLayerForBottomOverhangArea(bool want
 
     if (!m_layerForBottomOverhangArea) {
         m_layerForBottomOverhangArea = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
         m_layerForBottomOverhangArea->setName("bottom overhang area");
 #endif
         m_scrollLayer->addChildBelow(m_layerForBottomOverhangArea.get(), m_rootContentLayer.get());
@@ -3070,7 +3070,7 @@ GraphicsLayer* RenderLayerCompositor::updateLayerForHeader(bool wantsLayer)
 
     if (!m_layerForHeader) {
         m_layerForHeader = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
         m_layerForHeader->setName("header");
 #endif
         m_scrollLayer->addChildAbove(m_layerForHeader.get(), m_rootContentLayer.get());
@@ -3111,7 +3111,7 @@ GraphicsLayer* RenderLayerCompositor::updateLayerForFooter(bool wantsLayer)
 
     if (!m_layerForFooter) {
         m_layerForFooter = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
         m_layerForFooter->setName("footer");
 #endif
         m_scrollLayer->addChildAbove(m_layerForFooter.get(), m_rootContentLayer.get());
@@ -3179,7 +3179,7 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
     if (requiresOverhangAreasLayer()) {
         if (!m_layerForOverhangAreas) {
             m_layerForOverhangAreas = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
             m_layerForOverhangAreas->setName("overhang areas");
 #endif
             m_layerForOverhangAreas->setDrawsContent(false);
@@ -3208,7 +3208,7 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
     if (requiresContentShadowLayer()) {
         if (!m_contentShadowLayer) {
             m_contentShadowLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
             m_contentShadowLayer->setName("content shadow");
 #endif
             m_contentShadowLayer->setSize(m_rootContentLayer->size());
@@ -3228,7 +3228,7 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
         if (!m_layerForHorizontalScrollbar) {
             m_layerForHorizontalScrollbar = GraphicsLayer::create(graphicsLayerFactory(), *this);
             m_layerForHorizontalScrollbar->setShowDebugBorder(m_showDebugBorders);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
             m_layerForHorizontalScrollbar->setName("horizontal scrollbar container");
 
 #endif
@@ -3252,7 +3252,7 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
         if (!m_layerForVerticalScrollbar) {
             m_layerForVerticalScrollbar = GraphicsLayer::create(graphicsLayerFactory(), *this);
             m_layerForVerticalScrollbar->setShowDebugBorder(m_showDebugBorders);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
             m_layerForVerticalScrollbar->setName("vertical scrollbar container");
 #endif
 #if PLATFORM(COCOA) && USE(CA)
@@ -3299,7 +3299,7 @@ void RenderLayerCompositor::ensureRootLayer()
 
     if (!m_rootContentLayer) {
         m_rootContentLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
         m_rootContentLayer->setName("content root");
 #endif
         IntRect overflowRect = snappedIntRect(m_renderView.layoutOverflowRect());
@@ -3324,19 +3324,19 @@ void RenderLayerCompositor::ensureRootLayer()
 
             // Create a layer to host the clipping layer and the overflow controls layers.
             m_overflowControlsHostLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
             m_overflowControlsHostLayer->setName("overflow controls host");
 #endif
 
             // Create a clipping layer if this is an iframe
             m_clipLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
             m_clipLayer->setName("frame clipping");
 #endif
             m_clipLayer->setMasksToBounds(true);
             
             m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
             m_scrollLayer->setName("frame scrolling");
 #endif
             // Hook them up
index ebb70a4..d744820 100644 (file)
@@ -1351,7 +1351,7 @@ void RenderObject::computeFloatRectForRepaint(const RenderLayerModelObject*, Flo
     ASSERT_NOT_REACHED();
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 static void showRenderTreeLegend()
 {
@@ -2497,7 +2497,7 @@ void RenderObject::calculateBorderStyleColor(const EBorderStyle& style, const Bo
 
 } // namespace WebCore
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 
 void showNodeTree(const WebCore::RenderObject* object)
 {
index 0d85a17..ba70022 100644 (file)
@@ -136,10 +136,6 @@ struct AnnotatedRegionValue {
 };
 #endif
 
-#ifndef NDEBUG
-const int showTreeCharacterOffset = 39;
-#endif
-
 // Base class for all rendering tree objects.
 class RenderObject : public CachedImageClient {
     WTF_MAKE_FAST_ALLOCATED;
@@ -271,7 +267,7 @@ private:
     void setLayerNeedsFullRepaintForPositionedMovementLayout();
 
 public:
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     void showNodeTreeForThis() const;
     void showRenderTreeForThis() const;
     void showLineTreeForThis() const;
@@ -1111,7 +1107,7 @@ SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
     static bool isType(const WebCore::RenderObject& renderer) { return renderer.predicate; } \
 SPECIALIZE_TYPE_TRAITS_END()
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 // Outside the WebCore namespace for ease of invocation from gdb.
 void showNodeTree(const WebCore::RenderObject*);
 void showLineTree(const WebCore::RenderObject*);
index c2706a2..4244cce 100644 (file)
@@ -1152,7 +1152,7 @@ Node* RootInlineBox::getLogicalEndBoxWithNode(InlineBox*& endBox) const
     return 0;
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 const char* RootInlineBox::boxName() const
 {
     return "RootInlineBox";
index 3e9c888..3bd15ca 100644 (file)
@@ -190,7 +190,7 @@ public:
     Node* getLogicalStartBoxWithNode(InlineBox*&) const;
     Node* getLogicalEndBoxWithNode(InlineBox*&) const;
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     virtual const char* boxName() const override final;
 #endif
 private:
index f3c4a5f..9f1dded 100644 (file)
@@ -179,7 +179,7 @@ Vector<FloatQuad> collectTextAbsoluteQuads(const RenderText& textRenderer, const
     return quads;
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 static void printPrefix(int& printedCharacters, int depth)
 {
     fprintf(stderr, "------- --");
index 2a96464..ef389c6 100644 (file)
@@ -63,7 +63,7 @@ Vector<FloatQuad> collectTextAbsoluteQuads(const RenderText&, const Layout&, boo
 LayoutUnit lineHeightFromFlow(const RenderBlockFlow&);
 LayoutUnit baselineFromFlow(const RenderBlockFlow&);
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 void showLineLayoutForFlow(const RenderBlockFlow&, const Layout&, int depth);
 #endif
 
index 569d2ae..ab61dd3 100644 (file)
@@ -31,7 +31,7 @@
 #include "SVGRenderStyle.h"
 #include "SVGURIReference.h"
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 #include <stdio.h>
 #endif
 
@@ -612,7 +612,7 @@ void SVGResources::resetLinkedResource()
     m_linkedResource = 0;
 }
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
 void SVGResources::dump(const RenderObject* object)
 {
     ASSERT(object);
index 785ef5a..8db1d4e 100644 (file)
@@ -71,7 +71,7 @@ public:
     void removeClientFromCache(RenderElement&, bool markForInvalidation = true) const;
     void resourceDestroyed(RenderSVGResourceContainer&);
 
-#ifndef NDEBUG
+#if ENABLE(TREE_DEBUGGING)
     void dump(const RenderObject*);
 #endif