WebKit Bugzilla
Attachment 349002 Details for
Bug 189334
: [LFC] Adapt to the new const WeakPtr<>
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189334-20180905212221.patch (text/plain), 9.10 KB, created by
zalan
on 2018-09-05 21:22:27 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-09-05 21:22:27 PDT
Size:
9.10 KB
patch
obsolete
>Subversion Revision: 235720 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 90b6832425187dcbc1fbb3bc0ff4eeae15cc680a..70b8ff7c0529cf1896525103458d1e0395477cc8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,28 @@ >+2018-09-05 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Adapt to the new const WeakPtr<> >+ https://bugs.webkit.org/show_bug.cgi?id=189334 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::FormattingContext): >+ * layout/FormattingContext.h: >+ * layout/LayoutContext.cpp: >+ (WebCore::Layout::LayoutContext::initializeRoot): >+ * layout/LayoutContext.h: >+ * layout/floats/FloatAvoider.cpp: >+ (WebCore::Layout::FloatAvoider::FloatAvoider): >+ * layout/floats/FloatAvoider.h: >+ * layout/floats/FloatingState.cpp: >+ (WebCore::Layout::FloatingState::FloatItem::FloatItem): >+ (WebCore::Layout::FloatingState::FloatingState): >+ * layout/floats/FloatingState.h: >+ * layout/layouttree/LayoutContainer.cpp: >+ (WebCore::Layout::Container::addOutOfFlowDescendant): >+ * layout/layouttree/LayoutContainer.h: >+ (WebCore::Layout::Container::outOfFlowDescendants const): >+ > 2018-09-05 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] ComputeFloat* methods should take a const FloatingContext& >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index 32c2d06e13c4969322ee025a5d99c48924b5714a..9529b319c75d620256bd26deb4782f0c44cefb5b 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -43,7 +43,7 @@ namespace Layout { > WTF_MAKE_ISO_ALLOCATED_IMPL(FormattingContext); > > FormattingContext::FormattingContext(const Box& formattingContextRoot) >- : m_root(makeWeakPtr(const_cast<Box&>(formattingContextRoot))) >+ : m_root(makeWeakPtr(formattingContextRoot)) > { > } > >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index e85bf2fb94e5b1f91d11c2ae4c776a0497d8b422..0292830e8a3b04eceb90a0c7caf58744fb33b6d5 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -122,7 +122,7 @@ private: > void computeOutOfFlowVerticalGeometry(const LayoutContext&, const Box&) const; > void computeOutOfFlowHorizontalGeometry(LayoutContext&, const Box&) const; > >- WeakPtr<Box> m_root; >+ WeakPtr<const Box> m_root; > }; > > } >diff --git a/Source/WebCore/layout/LayoutContext.cpp b/Source/WebCore/layout/LayoutContext.cpp >index fe6785ee85fc0cca79cc43c13a220c3e1ae57383..33d103d3c07df85c84399eae4968e88cc250673d 100644 >--- a/Source/WebCore/layout/LayoutContext.cpp >+++ b/Source/WebCore/layout/LayoutContext.cpp >@@ -53,7 +53,7 @@ void LayoutContext::initializeRoot(const Container& root, const LayoutSize& cont > { > ASSERT(root.establishesFormattingContext()); > >- m_root = makeWeakPtr(const_cast<Container&>(root)); >+ m_root = makeWeakPtr(root); > auto& displayBox = displayBoxForLayoutBox(root); > > // FIXME: m_root could very well be a formatting context root with ancestors and resolvable border and padding (as opposed to the topmost root) >diff --git a/Source/WebCore/layout/LayoutContext.h b/Source/WebCore/layout/LayoutContext.h >index cadf61f2b9de502f99c886d9e1ec046f47e6a2e4..e6f8f3bae27be7459aaad2212f0e2581deeabc3d 100644 >--- a/Source/WebCore/layout/LayoutContext.h >+++ b/Source/WebCore/layout/LayoutContext.h >@@ -90,7 +90,7 @@ public: > private: > void layoutFormattingContextSubtree(const Box&); > >- WeakPtr<Container> m_root; >+ WeakPtr<const Container> m_root; > HashSet<const Container*> m_formattingContextRootListForLayout; > HashMap<const Box*, std::unique_ptr<FormattingState>> m_formattingStates; > mutable HashMap<const Box*, std::unique_ptr<Display::Box>> m_layoutToDisplayBox; >diff --git a/Source/WebCore/layout/floats/FloatAvoider.cpp b/Source/WebCore/layout/floats/FloatAvoider.cpp >index f07f40bc1d157684c18f515a10fe48256e069571..4d32e9ee6bbd467fef29d24bbc51e476c0b96af9 100644 >--- a/Source/WebCore/layout/floats/FloatAvoider.cpp >+++ b/Source/WebCore/layout/floats/FloatAvoider.cpp >@@ -39,7 +39,7 @@ namespace Layout { > WTF_MAKE_ISO_ALLOCATED_IMPL(FloatAvoider); > > FloatAvoider::FloatAvoider(const Box& layoutBox, const FloatingState& floatingState, const LayoutContext& layoutContext) >- : m_layoutBox(makeWeakPtr(const_cast<Box&>(layoutBox))) >+ : m_layoutBox(makeWeakPtr(layoutBox)) > , m_floatingState(floatingState) > , m_absoluteDisplayBox(FormattingContext::mapBoxToAncestor(layoutContext, layoutBox, downcast<Container>(floatingState.root()))) > , m_containingBlockAbsoluteDisplayBox(FormattingContext::mapBoxToAncestor(layoutContext, *layoutBox.containingBlock(), downcast<Container>(floatingState.root()))) >diff --git a/Source/WebCore/layout/floats/FloatAvoider.h b/Source/WebCore/layout/floats/FloatAvoider.h >index dcfb173f6339ae99e2764b55d812a7dc542c20d1..a58eea25f5e12bc55368ef6b6d08c564ed574135 100644 >--- a/Source/WebCore/layout/floats/FloatAvoider.h >+++ b/Source/WebCore/layout/floats/FloatAvoider.h >@@ -82,7 +82,7 @@ protected: > const Display::Box& displayBox() const { return m_absoluteDisplayBox; } > > private: >- WeakPtr<Box> m_layoutBox; >+ WeakPtr<const Box> m_layoutBox; > const FloatingState& m_floatingState; > Display::Box m_absoluteDisplayBox; > Display::Box m_containingBlockAbsoluteDisplayBox; >diff --git a/Source/WebCore/layout/floats/FloatingState.cpp b/Source/WebCore/layout/floats/FloatingState.cpp >index 5b17cfb26ab4c703579fbadea69c1028f79aea0b..fd2ee7906758f114d022e1eb716c61cffadf0fde 100644 >--- a/Source/WebCore/layout/floats/FloatingState.cpp >+++ b/Source/WebCore/layout/floats/FloatingState.cpp >@@ -40,14 +40,14 @@ namespace Layout { > WTF_MAKE_ISO_ALLOCATED_IMPL(FloatingState); > > FloatingState::FloatItem::FloatItem(const Box& layoutBox, const FloatingState& floatingState) >- : m_layoutBox(makeWeakPtr(const_cast<Box&>(layoutBox))) >+ : m_layoutBox(makeWeakPtr(layoutBox)) > , m_absoluteDisplayBox(FormattingContext::mapBoxToAncestor(floatingState.layoutContext(), layoutBox, downcast<Container>(floatingState.root()))) > { > } > > FloatingState::FloatingState(LayoutContext& layoutContext, const Box& formattingContextRoot) > : m_layoutContext(layoutContext) >- , m_formattingContextRoot(makeWeakPtr(const_cast<Box&>(formattingContextRoot))) >+ , m_formattingContextRoot(makeWeakPtr(formattingContextRoot)) > { > } > >diff --git a/Source/WebCore/layout/floats/FloatingState.h b/Source/WebCore/layout/floats/FloatingState.h >index 6eb8de4fe17ba683b29d7c390c19613fd6c01d86..7f32c56054918f52b43453b306f0f2777e23ec3a 100644 >--- a/Source/WebCore/layout/floats/FloatingState.h >+++ b/Source/WebCore/layout/floats/FloatingState.h >@@ -71,7 +71,7 @@ public: > PositionInContextRoot bottom() const { return m_absoluteDisplayBox.bottom(); } > > private: >- WeakPtr<Box> m_layoutBox; >+ WeakPtr<const Box> m_layoutBox; > Display::Box m_absoluteDisplayBox; > }; > using FloatList = Vector<FloatItem>; >@@ -87,7 +87,7 @@ private: > std::optional<LayoutUnit> bottom(const Box& formattingContextRoot, Clear) const; > > LayoutContext& m_layoutContext; >- WeakPtr<Box> m_formattingContextRoot; >+ WeakPtr<const Box> m_formattingContextRoot; > FloatList m_floats; > }; > >diff --git a/Source/WebCore/layout/layouttree/LayoutContainer.cpp b/Source/WebCore/layout/layouttree/LayoutContainer.cpp >index b973a991d175aa886aeed61c298054b07768f790..252fc8e39e5d433b7d595da08f6370532ef5f0ba 100644 >--- a/Source/WebCore/layout/layouttree/LayoutContainer.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutContainer.cpp >@@ -96,7 +96,7 @@ void Container::addOutOfFlowDescendant(const Box& outOfFlowBox) > // Since we layout the out-of-flow boxes at the end of the formatting context layout, > // it's okay to store them at the formatting context root level -as opposed to the containing block level. > ASSERT(establishesFormattingContext()); >- m_outOfFlowDescendants.append(makeWeakPtr(const_cast<Box&>(outOfFlowBox))); >+ m_outOfFlowDescendants.append(makeWeakPtr(outOfFlowBox)); > } > > } >diff --git a/Source/WebCore/layout/layouttree/LayoutContainer.h b/Source/WebCore/layout/layouttree/LayoutContainer.h >index 000bd4c23f3b7cbe3a4b4e12b02746381a720244..d6ce22b69cb17cb778288563cfe013dcbe92aeec 100644 >--- a/Source/WebCore/layout/layouttree/LayoutContainer.h >+++ b/Source/WebCore/layout/layouttree/LayoutContainer.h >@@ -53,7 +53,7 @@ public: > bool hasInFlowChild() const { return firstInFlowChild(); } > bool hasInFlowOrFloatingChild() const { return firstInFlowOrFloatingChild(); } > >- const Vector<WeakPtr<Box>>& outOfFlowDescendants() const { return m_outOfFlowDescendants; } >+ const Vector<WeakPtr<const Box>>& outOfFlowDescendants() const { return m_outOfFlowDescendants; } > > protected: > Container(std::optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags); >@@ -65,7 +65,7 @@ private: > > Box* m_firstChild { nullptr }; > Box* m_lastChild { nullptr }; >- Vector<WeakPtr<Box>> m_outOfFlowDescendants; >+ Vector<WeakPtr<const 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 189334
: 349002