Title: [209292] trunk/Source/WebCore
Revision
209292
Author
[email protected]
Date
2016-12-02 18:44:49 -0800 (Fri, 02 Dec 2016)

Log Message

Put names on layers in release builds
https://bugs.webkit.org/show_bug.cgi?id=165347

Reviewed by Tim Horton.

Put names on GraphicsLayers (and therefore CALayers) in release builds. Release names
are a simpler, truncated version of debug names, with <tagname> id class names.

Non-primary layer names converted to lowercase and "layer" removed.

Fix comments that refer to gdb.

Use ENABLE(TREE_DEBUGGING) in more places.

* dom/Node.h:
* dom/Position.h:
* dom/Range.h:
* editing/FrameSelection.h:
* editing/VisiblePosition.h:
* editing/VisibleSelection.h:
* history/HistoryItem.h:
* page/FrameTree.h:
* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setName):
(WebCore::GraphicsLayerCA::setContentsToSolidColor):
(WebCore::GraphicsLayerCA::updateNames):
(WebCore::GraphicsLayerCA::updateBackdropFilters):
(WebCore::GraphicsLayerCA::updateContentsImage):
(WebCore::GraphicsLayerCA::updateClippingStrategy):
(WebCore::GraphicsLayerCA::updateContentsRects):
(WebCore::GraphicsLayerCA::changeLayerTypeTo):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::tileGridContainerLayerName):
(WebCore::TileController::zoomedOutTileGridContainerLayerName):
(WebCore::TileController::createTileLayer):
* rendering/CounterNode.h:
* rendering/InlineBox.h:
* rendering/InlineFlowBox.h:
* rendering/RenderCounter.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::name):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateAncestorClippingLayer):
(WebCore::RenderLayerBacking::updateDescendantClippingLayer):
(WebCore::RenderLayerBacking::updateForegroundLayer):
(WebCore::RenderLayerBacking::updateBackgroundLayer):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
* rendering/RenderObject.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209291 => 209292)


--- trunk/Source/WebCore/ChangeLog	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/ChangeLog	2016-12-03 02:44:49 UTC (rev 209292)
@@ -1,3 +1,67 @@
+2016-12-02  Simon Fraser  <[email protected]>
+
+        Put names on layers in release builds
+        https://bugs.webkit.org/show_bug.cgi?id=165347
+
+        Reviewed by Tim Horton.
+
+        Put names on GraphicsLayers (and therefore CALayers) in release builds. Release names
+        are a simpler, truncated version of debug names, with <tagname> id class names.
+
+        Non-primary layer names converted to lowercase and "layer" removed.
+
+        Fix comments that refer to gdb.
+
+        Use ENABLE(TREE_DEBUGGING) in more places.
+
+        * dom/Node.h:
+        * dom/Position.h:
+        * dom/Range.h:
+        * editing/FrameSelection.h:
+        * editing/VisiblePosition.h:
+        * editing/VisibleSelection.h:
+        * history/HistoryItem.h:
+        * page/FrameTree.h:
+        * platform/graphics/GraphicsLayer.h:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::setName):
+        (WebCore::GraphicsLayerCA::setContentsToSolidColor):
+        (WebCore::GraphicsLayerCA::updateNames):
+        (WebCore::GraphicsLayerCA::updateBackdropFilters):
+        (WebCore::GraphicsLayerCA::updateContentsImage):
+        (WebCore::GraphicsLayerCA::updateClippingStrategy):
+        (WebCore::GraphicsLayerCA::updateContentsRects):
+        (WebCore::GraphicsLayerCA::changeLayerTypeTo):
+        * platform/graphics/ca/TileController.cpp:
+        (WebCore::TileController::tileGridContainerLayerName):
+        (WebCore::TileController::zoomedOutTileGridContainerLayerName):
+        (WebCore::TileController::createTileLayer):
+        * rendering/CounterNode.h:
+        * rendering/InlineBox.h:
+        * rendering/InlineFlowBox.h:
+        * rendering/RenderCounter.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::name):
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::createGraphicsLayer):
+        (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
+        (WebCore::RenderLayerBacking::updateAncestorClippingLayer):
+        (WebCore::RenderLayerBacking::updateDescendantClippingLayer):
+        (WebCore::RenderLayerBacking::updateForegroundLayer):
+        (WebCore::RenderLayerBacking::updateBackgroundLayer):
+        (WebCore::RenderLayerBacking::updateMaskingLayer):
+        (WebCore::RenderLayerBacking::updateChildClippingStrategy):
+        (WebCore::RenderLayerBacking::updateScrollingLayers):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
+        (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
+        (WebCore::RenderLayerCompositor::updateLayerForHeader):
+        (WebCore::RenderLayerCompositor::updateLayerForFooter):
+        (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
+        (WebCore::RenderLayerCompositor::ensureRootLayer):
+        * rendering/RenderObject.h:
+
 2016-12-02  Antoine Quint  <[email protected]>
 
         [Modern Media Controls] Update the media controls size as the media element is resized

Modified: trunk/Source/WebCore/dom/Node.h (209291 => 209292)


--- trunk/Source/WebCore/dom/Node.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/dom/Node.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -781,7 +781,7 @@
 } // namespace WebCore
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showTree(const WebCore::Node*);
 void showNodePath(const WebCore::Node*);
 #endif

Modified: trunk/Source/WebCore/dom/Position.h (209291 => 209292)


--- trunk/Source/WebCore/dom/Position.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/dom/Position.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -349,7 +349,7 @@
 } // namespace WebCore
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showTree(const WebCore::Position&);
 void showTree(const WebCore::Position*);
 #endif

Modified: trunk/Source/WebCore/dom/Range.h (209291 => 209292)


--- trunk/Source/WebCore/dom/Range.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/dom/Range.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -183,6 +183,6 @@
 } // namespace
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showTree(const WebCore::Range*);
 #endif

Modified: trunk/Source/WebCore/editing/FrameSelection.h (209291 => 209292)


--- trunk/Source/WebCore/editing/FrameSelection.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/editing/FrameSelection.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -379,7 +379,7 @@
 } // namespace WebCore
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showTree(const WebCore::FrameSelection&);
 void showTree(const WebCore::FrameSelection*);
 #endif

Modified: trunk/Source/WebCore/editing/VisiblePosition.h (209291 => 209292)


--- trunk/Source/WebCore/editing/VisiblePosition.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/editing/VisiblePosition.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -169,7 +169,7 @@
 } // namespace WebCore
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showTree(const WebCore::VisiblePosition*);
 void showTree(const WebCore::VisiblePosition&);
 #endif

Modified: trunk/Source/WebCore/editing/VisibleSelection.h (209291 => 209292)


--- trunk/Source/WebCore/editing/VisibleSelection.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/editing/VisibleSelection.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -156,7 +156,7 @@
 } // namespace WebCore
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showTree(const WebCore::VisibleSelection&);
 void showTree(const WebCore::VisibleSelection*);
 #endif

Modified: trunk/Source/WebCore/history/HistoryItem.h (209291 => 209292)


--- trunk/Source/WebCore/history/HistoryItem.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/history/HistoryItem.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -267,7 +267,7 @@
 
 } // namespace WebCore
 
-#ifndef NDEBUG
-// Outside the WebCore namespace for ease of invocation from gdb.
+#if ENABLE(TREE_DEBUGGING)
+// Outside the WebCore namespace for ease of invocation from the debugger.
 extern "C" int showTree(const WebCore::HistoryItem*);
 #endif

Modified: trunk/Source/WebCore/page/FrameTree.h (209291 => 209292)


--- trunk/Source/WebCore/page/FrameTree.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/page/FrameTree.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -109,7 +109,7 @@
 
 } // namespace WebCore
 
-#ifndef NDEBUG
-// Outside the WebCore namespace for ease of invocation from gdb.
+#if ENABLE(TREE_DEBUGGING)
+// Outside the WebCore namespace for ease of invocation from the debugger.
 WEBCORE_EXPORT void showFrameTree(const WebCore::Frame*);
 #endif

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (209291 => 209292)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -680,7 +680,7 @@
 SPECIALIZE_TYPE_TRAITS_END()
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer);
 #endif
 

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (209291 => 209292)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2016-12-03 02:44:49 UTC (rev 209292)
@@ -451,13 +451,17 @@
 
 void GraphicsLayerCA::setName(const String& name)
 {
+#if ENABLE(TREE_DEBUGGING)
     String caLayerDescription;
 
     if (!m_layer->isPlatformCALayerRemote())
         caLayerDescription = String::format("CALayer(%p) ", m_layer->platformLayer());
 
-    String longName = caLayerDescription + String::format("GraphicsLayer(%p, %llu) ", this, primaryLayerID()) + name;
-    GraphicsLayer::setName(longName);
+    GraphicsLayer::setName(caLayerDescription + String::format("GraphicsLayer(%p, %llu) ", this, primaryLayerID()) + name);
+#else
+    GraphicsLayer::setName(name);
+#endif
+
     noteLayerPropertyChanged(NameChanged);
 }
 
@@ -1008,8 +1012,10 @@
         if (!m_contentsLayer || m_contentsLayerPurpose != ContentsLayerForBackgroundColor) {
             m_contentsLayerPurpose = ContentsLayerForBackgroundColor;
             m_contentsLayer = createPlatformCALayer(PlatformCALayer::LayerTypeLayer, this);
-#ifndef NDEBUG
-            m_contentsLayer->setName(String::format("Background Color Layer %llu", m_contentsLayer->layerID()));
+#if ENABLE(TREE_DEBUGGING)
+            m_contentsLayer->setName(String::format("contents color %llu", m_contentsLayer->layerID()));
+#else
+            m_contentsLayer->setName("contents color");
 #endif
             contentsLayerChanged = true;
         }
@@ -1703,13 +1709,13 @@
 {
     switch (structuralLayerPurpose()) {
     case StructuralLayerForPreserves3D:
-        m_structuralLayer->setName("Transform layer " + name());
+        m_structuralLayer->setName("preserve-3d: " + name());
         break;
     case StructuralLayerForReplicaFlattening:
-        m_structuralLayer->setName("Replica flattening layer " + name());
+        m_structuralLayer->setName("replica flattening: " + name());
         break;
     case StructuralLayerForBackdrop:
-        m_structuralLayer->setName("Backdrop hosting layer " + name());
+        m_structuralLayer->setName("backdrop hosting: " + name());
         break;
     case NoStructuralLayer:
         break;
@@ -1973,6 +1979,7 @@
         m_backdropLayer = createPlatformCALayer(PlatformCALayer::LayerTypeBackdropLayer, this);
         m_backdropLayer->setAnchorPoint(FloatPoint3D());
         m_backdropLayer->setMasksToBounds(true);
+        m_backdropLayer->setName("backdrop");
     }
 
     m_backdropLayer->setHidden(!m_contentsVisible);
@@ -2321,8 +2328,10 @@
     if (m_pendingContentsImage) {
         if (!m_contentsLayer.get()) {
             m_contentsLayer = createPlatformCALayer(PlatformCALayer::LayerTypeLayer, this);
-#ifndef NDEBUG
-            m_contentsLayer->setName(String::format("Image Layer %llu", m_contentsLayer->layerID()));
+#if ENABLE(TREE_DEBUGGING)
+            m_contentsLayer->setName(String::format("contents image %llu", m_contentsLayer->layerID()));
+#else
+            m_contentsLayer->setName("contents image");
 #endif
             setupContentsLayer(m_contentsLayer.get());
             // m_contentsLayer will be parented by updateSublayerList
@@ -2398,6 +2407,7 @@
     if (!shapeMaskLayer) {
         shapeMaskLayer = createPlatformCALayer(PlatformCALayer::LayerTypeShapeLayer, this);
         shapeMaskLayer->setAnchorPoint(FloatPoint3D());
+        shapeMaskLayer->setName("shape mask");
     }
     
     shapeMaskLayer->setPosition(FloatPoint());
@@ -2426,8 +2436,10 @@
         if (!m_contentsClippingLayer) {
             m_contentsClippingLayer = createPlatformCALayer(PlatformCALayer::LayerTypeLayer, this);
             m_contentsClippingLayer->setAnchorPoint(FloatPoint());
-#ifndef NDEBUG
-            m_contentsClippingLayer->setName(String::format("Contents Clipping Layer %llu", m_contentsClippingLayer->layerID()));
+#if ENABLE(TREE_DEBUGGING)
+            m_contentsClippingLayer->setName(String::format("contents clipping %llu", m_contentsClippingLayer->layerID()));
+#else
+            m_contentsClippingLayer->setName("contents clipping");
 #endif
             gainedOrLostClippingLayer = true;
         }
@@ -3586,16 +3598,12 @@
         | BackdropFiltersChanged
         | MaskLayerChanged
         | OpacityChanged
+        | NameChanged
         | DebugIndicatorsChanged;
     
     if (m_usingTiledBacking)
         m_uncommittedChanges |= CoverageRectChanged;
 
-#ifndef NDEBUG
-    String name = String::format("%sCALayer(%p) GraphicsLayer(%p, %llu) ", (newLayerType == PlatformCALayer::LayerTypeWebTiledLayer) ? "Tiled " : "", m_layer->platformLayer(), this, primaryLayerID()) + m_name;
-    m_layer->setName(name);
-#endif
-
     moveAnimations(oldLayer.get(), m_layer.get());
     
     // need to tell new layer to draw itself
@@ -3647,8 +3655,10 @@
         resultLayer = addResult.iterator->value.get();
     } else {
         resultLayer = cloneLayer(sourceLayer, cloneLevel);
-#ifndef NDEBUG
-        resultLayer->setName(String::format("Clone %d of layer %llu", cloneID[0U], sourceLayer->layerID()));
+#if ENABLE(TREE_DEBUGGING)
+        resultLayer->setName(String::format("clone %d of %llu", cloneID[0U], sourceLayer->layerID()));
+#else
+        resultLayer->setName("clone of " + m_name);
 #endif
         addResult.iterator->value = resultLayer;
     }

Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (209291 => 209292)


--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp	2016-12-03 02:44:49 UTC (rev 209292)
@@ -53,12 +53,12 @@
 
 String TileController::tileGridContainerLayerName()
 {
-    return ASCIILiteral("TileGrid Container Layer");
+    return ASCIILiteral("TileGrid container");
 }
 
 String TileController::zoomedOutTileGridContainerLayerName()
 {
-    return ASCIILiteral("Zoomed Out TileGrid Container Layer");
+    return ASCIILiteral("Zoomed-out TileGrid container");
 }
 
 TileController::TileController(PlatformCALayer* rootPlatformLayer)
@@ -702,10 +702,14 @@
     layer->setBorderWidth(m_tileDebugBorderWidth);
     layer->setEdgeAntialiasingMask(0);
     layer->setOpaque(m_tilesAreOpaque);
-#ifndef NDEBUG
-    layer->setName("Tile");
-#endif
 
+    StringBuilder nameBuilder;
+    nameBuilder.append("tile at ");
+    nameBuilder.appendNumber(tileRect.location().x());
+    nameBuilder.append(',');
+    nameBuilder.appendNumber(tileRect.location().y());
+    layer->setName(nameBuilder.toString());
+
     float temporaryScaleFactor = owningGraphicsLayer()->platformCALayerContentsScaleMultiplierForNewTiles(m_tileCacheLayer);
     m_hasTilesWithTemporaryScaleFactor |= temporaryScaleFactor != 1;
 

Modified: trunk/Source/WebCore/rendering/CounterNode.h (209291 => 209292)


--- trunk/Source/WebCore/rendering/CounterNode.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/rendering/CounterNode.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -92,6 +92,6 @@
 } // namespace WebCore
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showCounterTree(const WebCore::CounterNode*);
 #endif

Modified: trunk/Source/WebCore/rendering/InlineBox.h (209291 => 209292)


--- trunk/Source/WebCore/rendering/InlineBox.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/rendering/InlineBox.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -454,7 +454,7 @@
 SPECIALIZE_TYPE_TRAITS_END()
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showNodeTree(const WebCore::InlineBox*);
 void showLineTree(const WebCore::InlineBox*);
 #endif

Modified: trunk/Source/WebCore/rendering/InlineFlowBox.h (209291 => 209292)


--- trunk/Source/WebCore/rendering/InlineFlowBox.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/rendering/InlineFlowBox.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -374,6 +374,6 @@
 SPECIALIZE_TYPE_TRAITS_INLINE_BOX(InlineFlowBox, isInlineFlowBox())
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showTree(const WebCore::InlineFlowBox*);
 #endif

Modified: trunk/Source/WebCore/rendering/RenderCounter.h (209291 => 209292)


--- trunk/Source/WebCore/rendering/RenderCounter.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/rendering/RenderCounter.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -59,6 +59,6 @@
 SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderCounter, isCounter())
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showCounterRendererTree(const WebCore::RenderObject*, const char* counterName = nullptr);
 #endif

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (209291 => 209292)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2016-12-03 02:44:49 UTC (rev 209292)
@@ -386,11 +386,11 @@
 String RenderLayer::name() const
 {
     StringBuilder name;
-    name.append(renderer().renderName());
 
     if (Element* element = renderer().element()) {
-        name.append(' ');
-        name.append(element->tagName());
+        name.append(" <");
+        name.append(element->tagName().convertToLowercaseWithoutLocale());
+        name.append('>');
 
         if (element->hasID()) {
             name.appendLiteral(" id=\'");
@@ -400,14 +400,25 @@
 
         if (element->hasClass()) {
             name.appendLiteral(" class=\'");
-            for (size_t i = 0; i < element->classNames().size(); ++i) {
+            size_t classNamesToDump = element->classNames().size();
+            const size_t maxNumClassNames = 7;
+            bool addEllipsis = false;
+            if (classNamesToDump > maxNumClassNames) {
+                classNamesToDump = maxNumClassNames;
+                addEllipsis = true;
+            }
+            
+            for (size_t i = 0; i < classNamesToDump; ++i) {
                 if (i > 0)
                     name.append(' ');
                 name.append(element->classNames()[i]);
             }
+            if (addEllipsis)
+                name.append("...");
             name.append('\'');
         }
-    }
+    } else
+        name.append(renderer().renderName());
 
     if (isReflection())
         name.appendLiteral(" (reflection)");

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (209291 => 209292)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -1198,7 +1198,7 @@
 } // namespace WebCore
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from lldb.
 void showLayerTree(const WebCore::RenderLayer*);
 void showLayerTree(const WebCore::RenderObject*);
 #endif

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (209291 => 209292)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-12-03 02:44:49 UTC (rev 209292)
@@ -169,11 +169,8 @@
 
     std::unique_ptr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFactory, *this, layerType);
 
-#if ENABLE(TREE_DEBUGGING)
     graphicsLayer->setName(name);
-#else
-    UNUSED_PARAM(name);
-#endif
+
 #if PLATFORM(COCOA) && USE(CA)
     graphicsLayer->setAcceleratesDrawing(compositor().acceleratedDrawingEnabled());
     graphicsLayer->setUsesDisplayListDrawing(compositor().displayListDrawingEnabled());
@@ -299,15 +296,16 @@
 
 void RenderLayerBacking::createPrimaryGraphicsLayer()
 {
-    String layerName;
-#if ENABLE(TREE_DEBUGGING)
-    layerName = m_owningLayer.name();
-#endif
-    
+    String layerName = m_owningLayer.name();
+    const unsigned maxLayerNameLength = 100;
+    if (layerName.length() > maxLayerNameLength) {
+        layerName.truncate(maxLayerNameLength);
+        layerName.append("...");
+    }
     m_graphicsLayer = createGraphicsLayer(layerName, m_usingTiledCacheLayer ? GraphicsLayer::Type::PageTiledBacking : GraphicsLayer::Type::Normal);
 
     if (m_usingTiledCacheLayer) {
-        m_childContainmentLayer = createGraphicsLayer("TiledBacking Flattening Layer");
+        m_childContainmentLayer = createGraphicsLayer("TiledBacking containment");
         m_graphicsLayer->addChild(m_childContainmentLayer.get());
     }
 
@@ -1328,7 +1326,7 @@
 
     if (needsAncestorClip) {
         if (!m_ancestorClippingLayer) {
-            m_ancestorClippingLayer = createGraphicsLayer("Ancestor clipping Layer");
+            m_ancestorClippingLayer = createGraphicsLayer("ancestor clipping");
             m_ancestorClippingLayer->setMasksToBounds(true);
             layersChanged = true;
         }
@@ -1349,7 +1347,7 @@
 
     if (needsDescendantClip) {
         if (!m_childContainmentLayer && !m_usingTiledCacheLayer) {
-            m_childContainmentLayer = createGraphicsLayer("Child clipping Layer");
+            m_childContainmentLayer = createGraphicsLayer("child clipping");
             m_childContainmentLayer->setMasksToBounds(true);
             layersChanged = true;
         }
@@ -1499,10 +1497,7 @@
     bool layerChanged = false;
     if (needsForegroundLayer) {
         if (!m_foregroundLayer) {
-            String layerName;
-#if ENABLE(TREE_DEBUGGING)
-            layerName = m_owningLayer.name() + " (foreground)";
-#endif
+            String layerName = m_owningLayer.name() + " (foreground)";
             m_foregroundLayer = createGraphicsLayer(layerName);
             m_foregroundLayer->setDrawsContent(true);
             m_foregroundLayer->setPaintingPhase(GraphicsLayerPaintForeground);
@@ -1528,10 +1523,7 @@
     bool layerChanged = false;
     if (needsBackgroundLayer) {
         if (!m_backgroundLayer) {
-            String layerName;
-#if ENABLE(TREE_DEBUGGING)
-            layerName = m_owningLayer.name() + " (background)";
-#endif
+            String layerName = m_owningLayer.name() + " (background)";
             m_backgroundLayer = createGraphicsLayer(layerName);
             m_backgroundLayer->setDrawsContent(true);
             m_backgroundLayer->setAnchorPoint(FloatPoint3D());
@@ -1540,10 +1532,7 @@
         }
         
         if (!m_contentsContainmentLayer) {
-            String layerName;
-#if ENABLE(TREE_DEBUGGING)
-            layerName = m_owningLayer.name() + " (contents containment)";
-#endif
+            String layerName = m_owningLayer.name() + " (contents containment)";
             m_contentsContainmentLayer = createGraphicsLayer(layerName);
             m_contentsContainmentLayer->setAppliesPageScale(true);
             m_graphicsLayer->setAppliesPageScale(false);
@@ -1598,7 +1587,7 @@
         }
 
         if (!m_maskLayer) {
-            m_maskLayer = createGraphicsLayer("Mask", requiredLayerType);
+            m_maskLayer = createGraphicsLayer("mask", requiredLayerType);
             m_maskLayer->setDrawsContent(paintsContent);
             m_maskLayer->setPaintingPhase(maskPhases);
             layerChanged = true;
@@ -1630,7 +1619,7 @@
             }
 
             if (!m_childClippingMaskLayer) {
-                m_childClippingMaskLayer = createGraphicsLayer("Child Clipping Mask Layer");
+                m_childClippingMaskLayer = createGraphicsLayer("child clipping mask");
                 m_childClippingMaskLayer->setDrawsContent(true);
                 m_childClippingMaskLayer->setPaintingPhase(GraphicsLayerPaintChildClippingMask);
                 clippingLayer()->setMaskLayer(m_childClippingMaskLayer.get());
@@ -1654,12 +1643,12 @@
 
     if (!m_scrollingLayer) {
         // Outer layer which corresponds with the scroll view.
-        m_scrollingLayer = createGraphicsLayer("Scrolling container", GraphicsLayer::Type::Scrolling);
+        m_scrollingLayer = createGraphicsLayer("scrolling container", GraphicsLayer::Type::Scrolling);
         m_scrollingLayer->setDrawsContent(false);
         m_scrollingLayer->setMasksToBounds(true);
 
         // Inner layer which renders the content that scrolls.
-        m_scrollingContentsLayer = createGraphicsLayer("Scrolled Contents");
+        m_scrollingContentsLayer = createGraphicsLayer("scrolled Contents");
         m_scrollingContentsLayer->setDrawsContent(true);
 
         GraphicsLayerPaintingPhase paintPhase = GraphicsLayerPaintOverflowContents | GraphicsLayerPaintCompositedScroll;

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (209291 => 209292)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2016-12-03 02:44:49 UTC (rev 209292)
@@ -3075,9 +3075,7 @@
 
     if (!m_layerForTopOverhangArea) {
         m_layerForTopOverhangArea = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#if ENABLE(TREE_DEBUGGING)
-        m_layerForTopOverhangArea->setName("top overhang area");
-#endif
+        m_layerForTopOverhangArea->setName("top overhang");
         m_scrollLayer->addChildBelow(m_layerForTopOverhangArea.get(), m_rootContentLayer.get());
     }
 
@@ -3099,9 +3097,7 @@
 
     if (!m_layerForBottomOverhangArea) {
         m_layerForBottomOverhangArea = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#if ENABLE(TREE_DEBUGGING)
-        m_layerForBottomOverhangArea->setName("bottom overhang area");
-#endif
+        m_layerForBottomOverhangArea->setName("bottom overhang");
         m_scrollLayer->addChildBelow(m_layerForBottomOverhangArea.get(), m_rootContentLayer.get());
     }
 
@@ -3130,9 +3126,7 @@
 
     if (!m_layerForHeader) {
         m_layerForHeader = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#if ENABLE(TREE_DEBUGGING)
         m_layerForHeader->setName("header");
-#endif
         m_scrollLayer->addChildAbove(m_layerForHeader.get(), m_rootContentLayer.get());
         m_renderView.frameView().addPaintPendingMilestones(DidFirstFlushForHeaderLayer);
     }
@@ -3171,9 +3165,7 @@
 
     if (!m_layerForFooter) {
         m_layerForFooter = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#if ENABLE(TREE_DEBUGGING)
         m_layerForFooter->setName("footer");
-#endif
         m_scrollLayer->addChildAbove(m_layerForFooter.get(), m_rootContentLayer.get());
     }
 
@@ -3278,9 +3270,7 @@
     if (requiresOverhangAreasLayer()) {
         if (!m_layerForOverhangAreas) {
             m_layerForOverhangAreas = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#if ENABLE(TREE_DEBUGGING)
             m_layerForOverhangAreas->setName("overhang areas");
-#endif
             m_layerForOverhangAreas->setDrawsContent(false);
 
             float topContentInset = m_renderView.frameView().topContentInset();
@@ -3307,9 +3297,7 @@
     if (requiresContentShadowLayer()) {
         if (!m_contentShadowLayer) {
             m_contentShadowLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#if ENABLE(TREE_DEBUGGING)
             m_contentShadowLayer->setName("content shadow");
-#endif
             m_contentShadowLayer->setSize(m_rootContentLayer->size());
             m_contentShadowLayer->setPosition(m_rootContentLayer->position());
             m_contentShadowLayer->setAnchorPoint(FloatPoint3D());
@@ -3327,10 +3315,7 @@
         if (!m_layerForHorizontalScrollbar) {
             m_layerForHorizontalScrollbar = GraphicsLayer::create(graphicsLayerFactory(), *this);
             m_layerForHorizontalScrollbar->setShowDebugBorder(m_showDebugBorders);
-#if ENABLE(TREE_DEBUGGING)
             m_layerForHorizontalScrollbar->setName("horizontal scrollbar container");
-
-#endif
 #if PLATFORM(COCOA) && USE(CA)
             m_layerForHorizontalScrollbar->setAcceleratesDrawing(acceleratedDrawingEnabled());
 #endif
@@ -3351,9 +3336,7 @@
         if (!m_layerForVerticalScrollbar) {
             m_layerForVerticalScrollbar = GraphicsLayer::create(graphicsLayerFactory(), *this);
             m_layerForVerticalScrollbar->setShowDebugBorder(m_showDebugBorders);
-#if ENABLE(TREE_DEBUGGING)
             m_layerForVerticalScrollbar->setName("vertical scrollbar container");
-#endif
 #if PLATFORM(COCOA) && USE(CA)
             m_layerForVerticalScrollbar->setAcceleratesDrawing(acceleratedDrawingEnabled());
 #endif
@@ -3374,9 +3357,7 @@
         if (!m_layerForScrollCorner) {
             m_layerForScrollCorner = GraphicsLayer::create(graphicsLayerFactory(), *this);
             m_layerForScrollCorner->setShowDebugBorder(m_showDebugBorders);
-#ifndef NDEBUG
             m_layerForScrollCorner->setName("scroll corner");
-#endif
 #if PLATFORM(COCOA) && USE(CA)
             m_layerForScrollCorner->setAcceleratesDrawing(acceleratedDrawingEnabled());
 #endif
@@ -3398,9 +3379,7 @@
 
     if (!m_rootContentLayer) {
         m_rootContentLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#if ENABLE(TREE_DEBUGGING)
         m_rootContentLayer->setName("content root");
-#endif
         IntRect overflowRect = snappedIntRect(m_renderView.layoutOverflowRect());
         m_rootContentLayer->setSize(FloatSize(overflowRect.maxX(), overflowRect.maxY()));
         m_rootContentLayer->setPosition(FloatPoint());
@@ -3423,21 +3402,16 @@
 
             // Create a layer to host the clipping layer and the overflow controls layers.
             m_overflowControlsHostLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#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);
-#if ENABLE(TREE_DEBUGGING)
             m_clipLayer->setName("frame clipping");
-#endif
             m_clipLayer->setMasksToBounds(true);
             
             m_scrollLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
-#if ENABLE(TREE_DEBUGGING)
             m_scrollLayer->setName("frame scrolling");
-#endif
+
             // Hook them up
             m_overflowControlsHostLayer->addChild(m_clipLayer.get());
             m_clipLayer->addChild(m_scrollLayer.get());

Modified: trunk/Source/WebCore/rendering/RenderObject.h (209291 => 209292)


--- trunk/Source/WebCore/rendering/RenderObject.h	2016-12-03 02:40:30 UTC (rev 209291)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2016-12-03 02:44:49 UTC (rev 209292)
@@ -1112,7 +1112,7 @@
 SPECIALIZE_TYPE_TRAITS_END()
 
 #if ENABLE(TREE_DEBUGGING)
-// Outside the WebCore namespace for ease of invocation from gdb.
+// Outside the WebCore namespace for ease of invocation from the debugger.
 void showNodeTree(const WebCore::RenderObject*);
 void showLineTree(const WebCore::RenderObject*);
 void showRenderTree(const WebCore::RenderObject*);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to