WebKit Bugzilla
Attachment 339275 Details for
Bug 185185
: [LFC] Enable multiple layout roots for incremental layout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185185-20180501215547.patch (text/plain), 4.61 KB, created by
zalan
on 2018-05-01 21:55:48 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-05-01 21:55:48 PDT
Size:
4.61 KB
patch
obsolete
>Subversion Revision: 231175 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 895e2ef9312b218c2c6b621c7208ec1646ab2b6b..fef0ab82159be764d24f15fa70353ad30e1e0446 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2018-05-01 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Enable multiple layout roots. >+ https://bugs.webkit.org/show_bug.cgi?id=185185 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ m_formattingContextRootListForLayout tracks the entry point boxes per layout frame. >+ >+ * layout/FormattingState.h: >+ * layout/LayoutContext.cpp: >+ (WebCore::Layout::LayoutContext::updateLayout): >+ (WebCore::Layout::LayoutContext::addLayoutEntryPoint): >+ * layout/LayoutContext.h: >+ > 2018-04-30 JF Bastien <jfbastien@apple.com> > > Use some C++17 features >diff --git a/Source/WebCore/layout/FormattingState.h b/Source/WebCore/layout/FormattingState.h >index 10c3a4278a97244d5587853cef8995c7e6f6fcd6..954bc2d7367de986c15f8f362aecb82589645674 100644 >--- a/Source/WebCore/layout/FormattingState.h >+++ b/Source/WebCore/layout/FormattingState.h >@@ -35,7 +35,7 @@ namespace WebCore { > namespace Layout { > > class Box; >-class StyleDiff; >+enum class StyleDiff; > > class FormattingState { > WTF_MAKE_ISO_ALLOCATED(FormattingState); >diff --git a/Source/WebCore/layout/LayoutContext.cpp b/Source/WebCore/layout/LayoutContext.cpp >index 9c2d4b71f9015956c79b04e87cb9870727f29569..068094f5d296c74c6c2173a7646cb431e8f73b16 100644 >--- a/Source/WebCore/layout/LayoutContext.cpp >+++ b/Source/WebCore/layout/LayoutContext.cpp >@@ -48,9 +48,24 @@ LayoutContext::LayoutContext(const Box& root) > > void LayoutContext::updateLayout() > { >- auto context = formattingContext(*m_root); >- auto& state = establishedFormattingState(*m_root, *context); >- context->layout(*this, state); >+ ASSERT(!m_formattingContextRootListForLayout.isEmpty()); >+ for (auto layoutRoot : m_formattingContextRootListForLayout) { >+ RELEASE_ASSERT(layoutRoot.get()); >+ auto context = formattingContext(*layoutRoot); >+ auto& state = establishedFormattingState(*layoutRoot, *context); >+ context->layout(*this, state); >+ } >+ m_formattingContextRootListForLayout.clear(); >+} >+ >+void LayoutContext::addLayoutEntryPoint(const Box& formattingContextRoot) >+{ >+ ASSERT(formattingContextRoot.establishesFormattingContext()); >+#ifndef NDEBUG >+ for (auto layoutRoot : m_formattingContextRootListForLayout) >+ ASSERT(&formattingContextRoot != layoutRoot.get()); >+#endif >+ m_formattingContextRootListForLayout.append(makeWeakPtr(const_cast<Box&>(formattingContextRoot))); > } > > FormattingState& LayoutContext::formattingStateForBox(const Box& layoutBox) const >diff --git a/Source/WebCore/layout/LayoutContext.h b/Source/WebCore/layout/LayoutContext.h >index a99b15f7f89476cd19cbbe5a55f3215268f784a4..83848c61a9b6347152e6bc280fd6d6db70adb27b 100644 >--- a/Source/WebCore/layout/LayoutContext.h >+++ b/Source/WebCore/layout/LayoutContext.h >@@ -40,12 +40,14 @@ class Box; > > namespace Layout { > >-class StyleDiff; >+enum class StyleDiff; >+enum class LayoutType; > > // LayoutContext is the entry point for layout. It takes a (formatting root)container which acts as the root of the layout context. > // LayoutContext::layout() generates the display tree for the root container's subtree (it does not run layout on the root though). > // Note, while the root container is suppposed to be the entry point for the initial layout, it does not necessarily need to be the entry point of any >-// subsequent layouts (subtree layout). >+// subsequent layouts (subtree layout). A non-initial, subtree layout could be initiated on multiple formatting contexts. >+// Each formatting context has an entry point for layout, which potenitally means multiple entry points per layout frame. > // LayoutContext also holds the formatting states. They cache formatting context specific data to enable performant incremental layouts. > class LayoutContext { > WTF_MAKE_ISO_ALLOCATED(LayoutContext); >@@ -57,7 +59,10 @@ public: > void addDisplayBox(const Box&, Display::Box&); > Display::Box* displayBox(const Box&) const; > >- void markNeedsLayout(const Box&, StyleDiff); >+ void styleChanged(const Box&, StyleDiff); >+ >+ void addLayoutEntryPoint(const Box&); >+ void markNeedsLayout(const Box&, LayoutType); > bool needsLayout(const Box&) const; > > FormattingState& formattingStateForBox(const Box&) const; >@@ -66,6 +71,7 @@ public: > > private: > WeakPtr<Box> m_root; >+ Vector<WeakPtr<Box>> m_formattingContextRootListForLayout; > HashMap<const Box*, std::unique_ptr<FormattingState>> m_formattingStates; > }; >
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 185185
:
339275
|
339431