WebKit Bugzilla
Attachment 338774 Details for
Bug 184988
: [LFC] Implement Layout::Container functions.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-184988-20180425130616.patch (text/plain), 5.45 KB, created by
zalan
on 2018-04-25 13:06:16 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-04-25 13:06:16 PDT
Size:
5.45 KB
patch
obsolete
>Subversion Revision: 230999 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 02d5da80c4c4ead356aa05f8be40f79939b0b71f..0be2d87b503bb1b900d6f5ee29e3cd0407579f3f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2018-04-25 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Implement Layout::Container functions. >+ https://bugs.webkit.org/show_bug.cgi?id=184988 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/layouttree/LayoutContainer.cpp: >+ (WebCore::Layout::Container::Container): >+ (WebCore::Layout::Container::firstInFlowChild const): >+ (WebCore::Layout::Container::firstInFlowOrFloatingChild const): >+ (WebCore::Layout::Container::lastInFlowChild const): >+ (WebCore::Layout::Container::lastInFlowOrFloatingChild const): >+ (WebCore::Layout::Container::setFirstChild): >+ (WebCore::Layout::Container::setLastChild): >+ (WebCore::Layout::Container::setOutOfFlowDescendants): >+ * layout/layouttree/LayoutContainer.h: >+ (WebCore::Layout::Container::firstChild const): >+ (WebCore::Layout::Container::lastChild const): >+ (WebCore::Layout::Container::hasChild const): >+ (WebCore::Layout::Container::hasInFlowChild const): >+ (WebCore::Layout::Container::hasInFlowOrFloatingChild const): >+ (WebCore::Layout::Container::outOfFlowDescendants): >+ > 2018-04-25 Zalan Bujtas <zalan@apple.com> > > [LFC] Implement Layout::Box functions. >diff --git a/Source/WebCore/layout/layouttree/LayoutContainer.cpp b/Source/WebCore/layout/layouttree/LayoutContainer.cpp >index 936e5f981a9b5414592ad18464bc69e32c8f96b7..76067dca65ed5ae210fa6b22e963842c91b071e3 100644 >--- a/Source/WebCore/layout/layouttree/LayoutContainer.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutContainer.cpp >@@ -25,3 +25,77 @@ > > #include "config.h" > #include "LayoutContainer.h" >+ >+#if ENABLE(LAYOUT_FORMATTING_CONTEXT) >+ >+#include "RenderStyle.h" >+#include <wtf/IsoMallocInlines.h> >+ >+namespace WebCore { >+namespace Layout { >+ >+WTF_MAKE_ISO_ALLOCATED_IMPL(Container); >+ >+Container::Container(RenderStyle&& style) >+ : Box(WTFMove(style)) >+{ >+} >+ >+const Box* Container::firstInFlowChild() const >+{ >+ if (auto* firstChild = this->firstChild()) { >+ if (firstChild->isInFlow()) >+ return firstChild; >+ return firstChild->nextInFlowSibling(); >+ } >+ return nullptr; >+} >+ >+const Box* Container::firstInFlowOrFloatingChild() const >+{ >+ if (auto* firstChild = this->firstChild()) { >+ if (firstChild->isInFlow() || firstChild->isFloatingPositioned()) >+ return firstChild; >+ return firstChild->nextInFlowOrFloatingSibling(); >+ } >+ return nullptr; >+} >+ >+const Box* Container::lastInFlowChild() const >+{ >+ if (auto* lastChild = this->lastChild()) { >+ if (lastChild->isInFlow()) >+ return lastChild; >+ return lastChild->previousInFlowSibling(); >+ } >+ return nullptr; >+} >+ >+const Box* Container::lastInFlowOrFloatingChild() const >+{ >+ if (auto* lastChild = this->lastChild()) { >+ if (lastChild->isInFlow() || lastChild->isFloatingPositioned()) >+ return lastChild; >+ return lastChild->previousInFlowOrFloatingSibling(); >+ } >+ return nullptr; >+} >+ >+void Container::setFirstChild(Box& childBox) >+{ >+ m_firstChild = &childBox; >+} >+ >+void Container::setLastChild(Box& childBox) >+{ >+ m_lastChild = &childBox; >+} >+ >+void Container::setOutOfFlowDescendants(Vector<WeakPtr<Box>>&& descendantList) >+{ >+ m_outOfFlowDescendants = WTFMove(descendantList); >+} >+ >+} >+} >+#endif >diff --git a/Source/WebCore/layout/layouttree/LayoutContainer.h b/Source/WebCore/layout/layouttree/LayoutContainer.h >index 71f11ea1da49129d8d9e85a75f1836ff568d8f78..bb9df4a5e30ce707a58675eae065c818d8ba3b88 100644 >--- a/Source/WebCore/layout/layouttree/LayoutContainer.h >+++ b/Source/WebCore/layout/layouttree/LayoutContainer.h >@@ -29,6 +29,7 @@ > > #include "LayoutBox.h" > #include <wtf/IsoMalloc.h> >+#include <wtf/WeakPtr.h> > > namespace WebCore { > >@@ -39,23 +40,31 @@ namespace Layout { > class Container : public Box { > WTF_MAKE_ISO_ALLOCATED(Container); > public: >+ friend class TreeBuilder; >+ > Container(RenderStyle&&); > >- void setFirstChild(Layout::Box&); >- void setLastChild(Layout::Box&); >+ const Box* firstChild() const { return m_firstChild; } >+ const Box* firstInFlowChild() const; >+ const Box* firstInFlowOrFloatingChild() const; >+ const Box* lastChild() const { return m_lastChild; } >+ const Box* lastInFlowChild() const; >+ const Box* lastInFlowOrFloatingChild() const; >+ >+ bool hasChild() const { return firstChild(); } >+ bool hasInFlowChild() const { return firstInFlowChild(); } >+ bool hasInFlowOrFloatingChild() const { return firstInFlowOrFloatingChild(); } > >- Box* firstChild() const; >- Box* firstInFlowChild() const; >- Box* firstInFlowOrFloatingChild() const; >- Box* lastChild() const; >- Box* lastInFlowChild() const; >- Box* lastInFlowOrFloatingChild() const; >+ const Vector<WeakPtr<Box>>& outOfFlowDescendants() { return m_outOfFlowDescendants; } > >- bool hasChild() const; >- bool hasInFlowChild() const; >- bool hasInFlowOrFloatingChild() const; >+private: >+ void setFirstChild(Box&); >+ void setLastChild(Box&); >+ void setOutOfFlowDescendants(Vector<WeakPtr<Box>>&&); > >- Vector<Box&> outOfFlowDescendants() const; >+ Box* m_firstChild { nullptr }; >+ Box* m_lastChild { nullptr }; >+ Vector<WeakPtr<Box>> m_outOfFlowDescendants; > }; > > }
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 184988
: 338774