WebKit Bugzilla
Attachment 347243 Details for
Bug 188631
: [LFC] Add showLayoutTree() that does not require LayoutContext.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188631-20180815215222.patch (text/plain), 6.24 KB, created by
zalan
on 2018-08-15 21:52:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-08-15 21:52:24 PDT
Size:
6.24 KB
patch
obsolete
>Subversion Revision: 234903 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 45f39ffa7cb52927e6309e931190956946750dd3..f8b2e085804b4c83ce365277d2a74a44060a4582 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-08-15 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Add showLayoutTree() that does not require LayoutContext. >+ https://bugs.webkit.org/show_bug.cgi?id=188631 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/layouttree/LayoutBox.cpp: >+ (WebCore::Layout::Box::formattingContextRoot const): >+ (WebCore::Layout::Box::initialContainingBlock const): >+ * layout/layouttree/LayoutBox.h: >+ * layout/layouttree/LayoutTreeBuilder.cpp: >+ (WebCore::Layout::outputLayoutTree): >+ (WebCore::Layout::showLayoutTree): >+ (WebCore::Layout::TreeBuilder::showLayoutTree): Deleted. >+ * layout/layouttree/LayoutTreeBuilder.h: >+ > 2018-08-15 Christopher Reid <chris.reid@sony.com> > > [Curl] Implement default cookie path handling correctly as outlined in RFC6265. >diff --git a/Source/WebCore/layout/Verification.cpp b/Source/WebCore/layout/Verification.cpp >index 23d60af7a1ca90b22d91d8b20a7c3add291ee2e1..fd9aba869e98ad27322aafa9f6818efce028d0d0 100644 >--- a/Source/WebCore/layout/Verification.cpp >+++ b/Source/WebCore/layout/Verification.cpp >@@ -194,7 +194,7 @@ void LayoutContext::verifyAndOutputMismatchingLayoutTree(const RenderView& rende > return; > #if ENABLE(TREE_DEBUGGING) > showRenderTree(&renderView); >- TreeBuilder::showLayoutTree(*this, *m_root.get()); >+ showLayoutTree(*m_root.get(), this); > #endif > WTFLogAlways("%s", stream.release().utf8().data()); > } >diff --git a/Source/WebCore/layout/layouttree/LayoutBox.cpp b/Source/WebCore/layout/layouttree/LayoutBox.cpp >index f8f447c8a51344f651e89872dc436cdef120bb6d..e1d26fadfa8511119186a793f03807eaabf6e27b 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBox.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutBox.cpp >@@ -162,9 +162,21 @@ const Container& Box::formattingContextRoot() const > // Initial containing block always establishes a formatting context. > if (isInitialContainingBlock()) > return downcast<Container>(*this); >+ > RELEASE_ASSERT_NOT_REACHED(); > } > >+const Container& Box::initialContainingBlock() const >+{ >+ if (isInitialContainingBlock()) >+ return downcast<Container>(*this); >+ >+ auto* parent = this->parent(); >+ for (; parent->parent(); parent = parent->parent()) { } >+ >+ return *parent; >+} >+ > bool Box::isDescendantOf(const Container& container) const > { > for (auto* ancestor = containingBlock(); ancestor; ancestor = ancestor->containingBlock()) { >diff --git a/Source/WebCore/layout/layouttree/LayoutBox.h b/Source/WebCore/layout/layouttree/LayoutBox.h >index bcfc086f807fba9ccc1b0fc7c3ae3a68dc9937f7..0d1831b759079f9358e97f312b6398f722d23714 100644 >--- a/Source/WebCore/layout/layouttree/LayoutBox.h >+++ b/Source/WebCore/layout/layouttree/LayoutBox.h >@@ -68,6 +68,8 @@ public: > > const Container* containingBlock() const; > const Container& formattingContextRoot() const; >+ const Container& initialContainingBlock() const; >+ > bool isDescendantOf(const Container&) const; > > bool isAnonymous() const { return !m_elementAttributes; } >diff --git a/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp b/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp >index 1e31fe896036fbdef0a0258ff30f14aa5740da44..59e1b194bd96a4a2dc4cb1a7e79c25aff686b302 100644 >--- a/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp >@@ -143,23 +143,30 @@ static void outputLayoutBox(TextStream& stream, const Box& layoutBox, const Disp > stream.nextLine(); > } > >-static void outputLayoutTree(const LayoutContext& layoutContext, TextStream& stream, const Container& rootContainer, unsigned depth) >+static void outputLayoutTree(const LayoutContext* layoutContext, TextStream& stream, const Container& rootContainer, unsigned depth) > { > for (auto& child : childrenOfType<Box>(rootContainer)) { >- outputLayoutBox(stream, child, layoutContext.displayBoxForLayoutBox(child), depth); >+ outputLayoutBox(stream, child, layoutContext ? layoutContext->displayBoxForLayoutBox(child) : nullptr, depth); > if (is<Container>(child)) > outputLayoutTree(layoutContext, stream, downcast<Container>(child), depth + 1); > } > } > >-void TreeBuilder::showLayoutTree(const LayoutContext& layoutContext, const Container& layoutBox) >+void showLayoutTree(const Box& layoutBox, const LayoutContext* layoutContext) > { > TextStream stream(TextStream::LineMode::MultipleLine, TextStream::Formatting::SVGStyleRect); >- outputLayoutBox(stream, layoutBox, layoutContext.displayBoxForLayoutBox(layoutBox), 0); >- outputLayoutTree(layoutContext, stream, layoutBox, 1); >+ >+ auto& initialContainingBlock = layoutBox.initialContainingBlock(); >+ outputLayoutBox(stream, initialContainingBlock, layoutContext ? layoutContext->displayBoxForLayoutBox(initialContainingBlock) : nullptr, 0); >+ outputLayoutTree(layoutContext, stream, initialContainingBlock, 1); > WTFLogAlways("%s", stream.release().utf8().data()); > } > >+void showLayoutTree(const Box& layoutBox) >+{ >+ showLayoutTree(layoutBox, nullptr); >+} >+ > void printLayoutTreeForLiveDocuments() > { > for (const auto* document : Document::allDocuments()) { >diff --git a/Source/WebCore/layout/layouttree/LayoutTreeBuilder.h b/Source/WebCore/layout/layouttree/LayoutTreeBuilder.h >index a8b1cfd49a3498fc6fe74178fbb8699e569449c0..92d33655523d31d65eab451b6ef7618e65fe8f38 100644 >--- a/Source/WebCore/layout/layouttree/LayoutTreeBuilder.h >+++ b/Source/WebCore/layout/layouttree/LayoutTreeBuilder.h >@@ -34,19 +34,21 @@ class RenderView; > > namespace Layout { > >+class Box; > class Container; > class LayoutContext; > > class TreeBuilder { > public: > static std::unique_ptr<Container> createLayoutTree(const RenderView&); >- static void showLayoutTree(const LayoutContext&, const Container&); > > private: > static void createSubTree(const RenderElement& rootRenderer, Container& rootContainer); > }; > > #if ENABLE(TREE_DEBUGGING) >+void showLayoutTree(const Box&, const LayoutContext*); >+void showLayoutTree(const Box&); > void printLayoutTreeForLiveDocuments(); > #endif >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
koivisto
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188631
: 347243