Title: [272162] branches/safari-611-branch/Source/WebCore
Revision
272162
Author
[email protected]
Date
2021-02-01 12:11:59 -0800 (Mon, 01 Feb 2021)

Log Message

Cherry-pick r271906. rdar://problem/73838863

    Make showRenderTree() dump FloatingObjects
    https://bugs.webkit.org/show_bug.cgi?id=220991

    Reviewed by Zalan Bujtas.

    It's useful to see which RenderBlockFlows have floating object sets and which
    floating objects they contain, so dump that in render tree dumps.

    Other minor logging/initializer cleanup.

    * rendering/FloatingObjects.cpp:
    (WebCore::operator<<):
    (WebCore::FloatingObjects::FloatingObjects):
    * rendering/FloatingObjects.h:
    * rendering/RenderBlockFlow.cpp:
    (WebCore::RenderBlockFlow::outputFloatingObjects const):
    * rendering/RenderBlockFlow.h:
    * rendering/RenderObject.cpp:
    (WebCore::RenderObject::outputRenderSubTreeAndMark const):
    * rendering/RenderView.cpp:

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

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (272161 => 272162)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-01 20:11:55 UTC (rev 272161)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-01 20:11:59 UTC (rev 272162)
@@ -1,5 +1,56 @@
 2021-02-01  Alan Coon  <[email protected]>
 
+        Cherry-pick r271906. rdar://problem/73838863
+
+    Make showRenderTree() dump FloatingObjects
+    https://bugs.webkit.org/show_bug.cgi?id=220991
+    
+    Reviewed by Zalan Bujtas.
+    
+    It's useful to see which RenderBlockFlows have floating object sets and which
+    floating objects they contain, so dump that in render tree dumps.
+    
+    Other minor logging/initializer cleanup.
+    
+    * rendering/FloatingObjects.cpp:
+    (WebCore::operator<<):
+    (WebCore::FloatingObjects::FloatingObjects):
+    * rendering/FloatingObjects.h:
+    * rendering/RenderBlockFlow.cpp:
+    (WebCore::RenderBlockFlow::outputFloatingObjects const):
+    * rendering/RenderBlockFlow.h:
+    * rendering/RenderObject.cpp:
+    (WebCore::RenderObject::outputRenderSubTreeAndMark const):
+    * rendering/RenderView.cpp:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-01-26  Simon Fraser  <[email protected]>
+
+            Make showRenderTree() dump FloatingObjects
+            https://bugs.webkit.org/show_bug.cgi?id=220991
+
+            Reviewed by Zalan Bujtas.
+
+            It's useful to see which RenderBlockFlows have floating object sets and which
+            floating objects they contain, so dump that in render tree dumps.
+
+            Other minor logging/initializer cleanup.
+
+            * rendering/FloatingObjects.cpp:
+            (WebCore::operator<<):
+            (WebCore::FloatingObjects::FloatingObjects):
+            * rendering/FloatingObjects.h:
+            * rendering/RenderBlockFlow.cpp:
+            (WebCore::RenderBlockFlow::outputFloatingObjects const):
+            * rendering/RenderBlockFlow.h:
+            * rendering/RenderObject.cpp:
+            (WebCore::RenderObject::outputRenderSubTreeAndMark const):
+            * rendering/RenderView.cpp:
+
+2021-02-01  Alan Coon  <[email protected]>
+
         Cherry-pick r272059. rdar://problem/73838832
 
     REGRESSION(r262893): feComponentTransfer is not rendered correctly on Retina display

Modified: branches/safari-611-branch/Source/WebCore/rendering/FloatingObjects.cpp (272161 => 272162)


--- branches/safari-611-branch/Source/WebCore/rendering/FloatingObjects.cpp	2021-02-01 20:11:55 UTC (rev 272161)
+++ branches/safari-611-branch/Source/WebCore/rendering/FloatingObjects.cpp	2021-02-01 20:11:59 UTC (rev 272162)
@@ -104,7 +104,7 @@
 
 TextStream& operator<<(TextStream& stream, const FloatingObject& object)
 {
-    return stream << &object << " (" << object.frameRect().x().toInt() << 'x' << object.frameRect().y().toInt() << ' ' << object.frameRect().maxX().toInt() << 'x' << object.frameRect().maxY().toInt() << ')';
+    return stream << &object << " renderer " << &object.renderer() << " " << object.frameRect() << " shouldPaint " << object.shouldPaint();
 }
 
 #endif
@@ -257,9 +257,7 @@
 }
 
 FloatingObjects::FloatingObjects(const RenderBlockFlow& renderer)
-    : m_leftObjectsCount(0)
-    , m_rightObjectsCount(0)
-    , m_horizontalWritingMode(renderer.isHorizontalWritingMode())
+    : m_horizontalWritingMode(renderer.isHorizontalWritingMode())
     , m_renderer(makeWeakPtr(renderer))
 {
 }

Modified: branches/safari-611-branch/Source/WebCore/rendering/FloatingObjects.h (272161 => 272162)


--- branches/safari-611-branch/Source/WebCore/rendering/FloatingObjects.h	2021-02-01 20:11:55 UTC (rev 272161)
+++ branches/safari-611-branch/Source/WebCore/rendering/FloatingObjects.h	2021-02-01 20:11:59 UTC (rev 272162)
@@ -181,9 +181,9 @@
 
     FloatingObjectSet m_set;
     std::unique_ptr<FloatingObjectTree> m_placedFloatsTree;
-    unsigned m_leftObjectsCount;
-    unsigned m_rightObjectsCount;
-    bool m_horizontalWritingMode;
+    unsigned m_leftObjectsCount { 0 };
+    unsigned m_rightObjectsCount { 0 };
+    bool m_horizontalWritingMode { false };
     WeakPtr<const RenderBlockFlow> m_renderer;
 };
 

Modified: branches/safari-611-branch/Source/WebCore/rendering/RenderBlockFlow.cpp (272161 => 272162)


--- branches/safari-611-branch/Source/WebCore/rendering/RenderBlockFlow.cpp	2021-02-01 20:11:55 UTC (rev 272161)
+++ branches/safari-611-branch/Source/WebCore/rendering/RenderBlockFlow.cpp	2021-02-01 20:11:59 UTC (rev 272162)
@@ -3760,6 +3760,22 @@
 }
 
 #if ENABLE(TREE_DEBUGGING)
+void RenderBlockFlow::outputFloatingObjects(WTF::TextStream& stream, int depth) const
+{
+    if (!floatingObjectSet())
+        return;
+
+    for (auto& floatingObject : *floatingObjectSet()) {
+        int printedCharacters = 0;
+        while (++printedCharacters <= depth * 2)
+            stream << " ";
+
+        stream << "             ";
+        stream << "floating object " << *floatingObject;
+        stream.nextLine();
+    }
+}
+
 void RenderBlockFlow::outputLineTreeAndMark(WTF::TextStream& stream, const InlineBox* markedBox, int depth) const
 {
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)

Modified: branches/safari-611-branch/Source/WebCore/rendering/RenderBlockFlow.h (272161 => 272162)


--- branches/safari-611-branch/Source/WebCore/rendering/RenderBlockFlow.h	2021-02-01 20:11:55 UTC (rev 272161)
+++ branches/safari-611-branch/Source/WebCore/rendering/RenderBlockFlow.h	2021-02-01 20:11:59 UTC (rev 272162)
@@ -368,6 +368,7 @@
     void generateLineBoxTree();
 
 #if ENABLE(TREE_DEBUGGING)
+    void outputFloatingObjects(WTF::TextStream&, int depth) const;
     void outputLineTreeAndMark(WTF::TextStream&, const InlineBox* markedBox, int depth) const;
 #endif
 

Modified: branches/safari-611-branch/Source/WebCore/rendering/RenderObject.cpp (272161 => 272162)


--- branches/safari-611-branch/Source/WebCore/rendering/RenderObject.cpp	2021-02-01 20:11:55 UTC (rev 272161)
+++ branches/safari-611-branch/Source/WebCore/rendering/RenderObject.cpp	2021-02-01 20:11:59 UTC (rev 272162)
@@ -1226,7 +1226,11 @@
 void RenderObject::outputRenderSubTreeAndMark(TextStream& stream, const RenderObject* markedObject, int depth) const
 {
     outputRenderObject(stream, markedObject == this, depth);
+
     if (is<RenderBlockFlow>(*this))
+        downcast<RenderBlockFlow>(*this).outputFloatingObjects(stream, depth + 1);
+
+    if (is<RenderBlockFlow>(*this))
         downcast<RenderBlockFlow>(*this).outputLineTreeAndMark(stream, nullptr, depth + 1);
 
     for (auto* child = firstChildSlow(); child; child = child->nextSibling())

Modified: branches/safari-611-branch/Source/WebCore/rendering/RenderView.cpp (272161 => 272162)


--- branches/safari-611-branch/Source/WebCore/rendering/RenderView.cpp	2021-02-01 20:11:55 UTC (rev 272161)
+++ branches/safari-611-branch/Source/WebCore/rendering/RenderView.cpp	2021-02-01 20:11:59 UTC (rev 272162)
@@ -24,7 +24,6 @@
 #include "Document.h"
 #include "Element.h"
 #include "FloatQuad.h"
-#include "FloatingObjects.h"
 #include "Frame.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to