WebKit Bugzilla
Attachment 339718 Details for
Bug 185377
: [LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185377-20180507072748.patch (text/plain), 8.88 KB, created by
zalan
on 2018-05-07 07:27:49 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-05-07 07:27:49 PDT
Size:
8.88 KB
patch
obsolete
>Subversion Revision: 231403 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b20d52b4d02a2bbc126d85eb4cb6b53df23a60f0..ad74da7076230be39c6ee48884ac39dc523f0ba7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-05-07 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation >+ https://bugs.webkit.org/show_bug.cgi?id=185377 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): >+ * layout/FormattingContext.h: >+ (WebCore::Layout::FormattingContext::layoutContext const): >+ * layout/LayoutContext.cpp: >+ (WebCore::Layout::LayoutContext::updateLayout): >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::layout const): >+ * layout/blockformatting/BlockFormattingContext.h: >+ * layout/inlineformatting/InlineFormattingContext.cpp: >+ (WebCore::Layout::InlineFormattingContext::layout const): >+ * layout/inlineformatting/InlineFormattingContext.h: >+ > 2018-05-06 Zalan Bujtas <zalan@apple.com> > > [LFC] Add assertions for stale Display::Box geometry >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index 63f1b500b3521cb23c7abcfc9ff65f0882c116d6..2411857889263e668fef3747184e4a81bdc84cc9 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -29,6 +29,8 @@ > #if ENABLE(LAYOUT_FORMATTING_CONTEXT) > > #include "LayoutBox.h" >+#include "LayoutContainer.h" >+#include "LayoutContext.h" > #include <wtf/IsoMallocInlines.h> > > namespace WebCore { >@@ -118,6 +120,22 @@ void FormattingContext::placeInFlowPositionedChildren(const Container&) const > > void FormattingContext::layoutOutOfFlowDescendants() const > { >+ if (!is<Container>(m_root.get())) >+ return; >+ auto& layoutContext = this->layoutContext(); >+ for (auto& outOfFlowBox : downcast<Container>(*m_root).outOfFlowDescendants()) { >+ auto& layoutBox = *outOfFlowBox; >+ auto& displayBox = layoutContext.createDisplayBox(layoutBox); >+ >+ computeOutOfFlowPosition(layoutBox, displayBox); >+ computeOutOfFlowWidth(layoutBox, displayBox); >+ >+ ASSERT(layoutBox.establishesFormattingContext()); >+ auto formattingContext = layoutContext.formattingContext(layoutBox); >+ formattingContext->layout(layoutContext.establishedFormattingState(layoutBox, *formattingContext)); >+ >+ computeOutOfFlowHeight(layoutBox, displayBox); >+ } > } > > } >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index 5379ebdb3baddf805b6f3ac221b71c5afa6850e3..8f858cda8b39e4cd117989a6cc90e375c6b49070 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -51,7 +51,7 @@ public: > FormattingContext(const Box& formattingContextRoot, LayoutContext&); > virtual ~FormattingContext(); > >- virtual void layout(LayoutContext&, FormattingState&) const = 0; >+ virtual void layout(FormattingState&) const = 0; > virtual std::unique_ptr<FormattingState> createFormattingState(Ref<FloatingState>&&) const = 0; > virtual Ref<FloatingState> createOrFindFloatingState() const = 0; > >@@ -63,7 +63,7 @@ protected: > using LayoutQueue = Vector<std::unique_ptr<LayoutPair>>; > > const Box& root() const { return *m_root; } >- const LayoutContext& layoutContext() const { return m_layoutContext; } >+ LayoutContext& layoutContext() const { return m_layoutContext; } > > virtual void computeStaticPosition(const Box&, Display::Box&) const; > virtual void computeInFlowPositionedPosition(const Box&, Display::Box&) const; >diff --git a/Source/WebCore/layout/LayoutContext.cpp b/Source/WebCore/layout/LayoutContext.cpp >index 608949447952caf5095199e927ff9acca9ec470e..e78668e4dd95299add3d61d83d7ff9ba52ef5784 100644 >--- a/Source/WebCore/layout/LayoutContext.cpp >+++ b/Source/WebCore/layout/LayoutContext.cpp >@@ -57,7 +57,7 @@ void LayoutContext::updateLayout() > RELEASE_ASSERT(layoutRoot->establishesFormattingContext()); > auto context = formattingContext(*layoutRoot); > auto& state = establishedFormattingState(*layoutRoot, *context); >- context->layout(*this, state); >+ context->layout(state); > } > m_formattingContextRootListForLayout.clear(); > } >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index 464c0b0e05b9aaa740a16cac215491ab0cf67d27..d5105c0ebc6932f2a44ba27d02e76f16ade0e8a6 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -47,7 +47,7 @@ BlockFormattingContext::BlockFormattingContext(const Box& formattingContextRoot, > { > } > >-void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingState& formattingState) const >+void BlockFormattingContext::layout(FormattingState& formattingState) const > { > // 9.4.1 Block formatting contexts > // In a block formatting context, boxes are laid out one after the other, vertically, beginning at the top of a containing block. >@@ -60,6 +60,7 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat > FloatingContext floatingContext(formattingState.floatingState()); > // This is a post-order tree traversal layout. > // The root container layout is done in the formatting context it lives in, not that one it creates, so let's start with the first child. >+ auto& layoutContext = this->layoutContext(); > if (auto* firstChild = formattingRoot.firstInFlowOrFloatingChild()) > layoutQueue.append(std::make_unique<LayoutPair>(LayoutPair {*firstChild, layoutContext.createDisplayBox(*firstChild)})); > // 1. Go all the way down to the leaf node >@@ -77,7 +78,7 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat > computeStaticPosition(layoutBox, layoutPair.displayBox); > if (layoutBox.establishesFormattingContext()) { > auto formattingContext = layoutContext.formattingContext(layoutBox); >- formattingContext->layout(layoutContext, layoutContext.establishedFormattingState(layoutBox, *formattingContext)); >+ formattingContext->layout(layoutContext.establishedFormattingState(layoutBox, *formattingContext)); > break; > } > if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowOrFloatingChild()) >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index 03cff356364e3da1203a4f0895c4a4c5a0a3cbc4..3008efae7274281ed1bc3a79222b4cd5f8a82de0 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -45,7 +45,7 @@ class BlockFormattingContext : public FormattingContext { > public: > BlockFormattingContext(const Box& formattingContextRoot, LayoutContext&); > >- void layout(LayoutContext&, FormattingState&) const override; >+ void layout(FormattingState&) const override; > std::unique_ptr<FormattingState> createFormattingState(Ref<FloatingState>&&) const override; > Ref<FloatingState> createOrFindFloatingState() const override; > >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >index f934f68ab536702f01be9681de75bc0e0d559faa..4e656359a69bcf2a512a88be77435b5b451f0aa6 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp >@@ -44,7 +44,7 @@ InlineFormattingContext::InlineFormattingContext(const Box& formattingContextRoo > { > } > >-void InlineFormattingContext::layout(LayoutContext&, FormattingState&) const >+void InlineFormattingContext::layout(FormattingState&) const > { > } > >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >index 9760b8d05501b1cd21ad3d5e43d3fe204ef470ce..2863c53402f36ca3e4ac392321593e92890a9b5a 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h >@@ -43,7 +43,7 @@ class InlineFormattingContext : public FormattingContext { > public: > InlineFormattingContext(const Box& formattingContextRoot, LayoutContext&); > >- void layout(LayoutContext&, FormattingState&) const override; >+ void layout(FormattingState&) const override; > std::unique_ptr<FormattingState> createFormattingState(Ref<FloatingState>&&) const override; > Ref<FloatingState> createOrFindFloatingState() const override; >
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185377
:
339718
|
339797