Title: [235735] trunk/Source/WebCore
Revision
235735
Author
[email protected]
Date
2018-09-06 06:40:56 -0700 (Thu, 06 Sep 2018)

Log Message

[LFC] Adapt to the new const WeakPtr<>
https://bugs.webkit.org/show_bug.cgi?id=189334

Reviewed by Antti Koivisto.

* 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (235734 => 235735)


--- trunk/Source/WebCore/ChangeLog	2018-09-06 13:27:41 UTC (rev 235734)
+++ trunk/Source/WebCore/ChangeLog	2018-09-06 13:40:56 UTC (rev 235735)
@@ -1,3 +1,28 @@
+2018-09-05  Zalan Bujtas  <[email protected]>
+
+        [LFC] Adapt to the new const WeakPtr<>
+        https://bugs.webkit.org/show_bug.cgi?id=189334
+
+        Reviewed by Antti Koivisto.
+
+        * 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-06  Xabier Rodriguez Calvar  <[email protected]>
 
         [GStreamer] Extra ASSERTs at MainThreadNotifier

Modified: trunk/Source/WebCore/layout/FormattingContext.cpp (235734 => 235735)


--- trunk/Source/WebCore/layout/FormattingContext.cpp	2018-09-06 13:27:41 UTC (rev 235734)
+++ trunk/Source/WebCore/layout/FormattingContext.cpp	2018-09-06 13:40:56 UTC (rev 235735)
@@ -43,7 +43,7 @@
 WTF_MAKE_ISO_ALLOCATED_IMPL(FormattingContext);
 
 FormattingContext::FormattingContext(const Box& formattingContextRoot)
-    : m_root(makeWeakPtr(const_cast<Box&>(formattingContextRoot)))
+    : m_root(makeWeakPtr(formattingContextRoot))
 {
 }
 

Modified: trunk/Source/WebCore/layout/FormattingContext.h (235734 => 235735)


--- trunk/Source/WebCore/layout/FormattingContext.h	2018-09-06 13:27:41 UTC (rev 235734)
+++ trunk/Source/WebCore/layout/FormattingContext.h	2018-09-06 13:40:56 UTC (rev 235735)
@@ -122,7 +122,7 @@
     void computeOutOfFlowVerticalGeometry(const LayoutContext&, const Box&) const;
     void computeOutOfFlowHorizontalGeometry(LayoutContext&, const Box&) const;
 
-    WeakPtr<Box> m_root;
+    WeakPtr<const Box> m_root;
 };
 
 }

Modified: trunk/Source/WebCore/layout/LayoutContext.cpp (235734 => 235735)


--- trunk/Source/WebCore/layout/LayoutContext.cpp	2018-09-06 13:27:41 UTC (rev 235734)
+++ trunk/Source/WebCore/layout/LayoutContext.cpp	2018-09-06 13:40:56 UTC (rev 235735)
@@ -53,7 +53,7 @@
 {
     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)

Modified: trunk/Source/WebCore/layout/LayoutContext.h (235734 => 235735)


--- trunk/Source/WebCore/layout/LayoutContext.h	2018-09-06 13:27:41 UTC (rev 235734)
+++ trunk/Source/WebCore/layout/LayoutContext.h	2018-09-06 13:40:56 UTC (rev 235735)
@@ -90,7 +90,7 @@
 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;

Modified: trunk/Source/WebCore/layout/floats/FloatAvoider.cpp (235734 => 235735)


--- trunk/Source/WebCore/layout/floats/FloatAvoider.cpp	2018-09-06 13:27:41 UTC (rev 235734)
+++ trunk/Source/WebCore/layout/floats/FloatAvoider.cpp	2018-09-06 13:40:56 UTC (rev 235735)
@@ -39,7 +39,7 @@
 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())))

Modified: trunk/Source/WebCore/layout/floats/FloatAvoider.h (235734 => 235735)


--- trunk/Source/WebCore/layout/floats/FloatAvoider.h	2018-09-06 13:27:41 UTC (rev 235734)
+++ trunk/Source/WebCore/layout/floats/FloatAvoider.h	2018-09-06 13:40:56 UTC (rev 235735)
@@ -82,7 +82,7 @@
     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;

Modified: trunk/Source/WebCore/layout/floats/FloatingState.cpp (235734 => 235735)


--- trunk/Source/WebCore/layout/floats/FloatingState.cpp	2018-09-06 13:27:41 UTC (rev 235734)
+++ trunk/Source/WebCore/layout/floats/FloatingState.cpp	2018-09-06 13:40:56 UTC (rev 235735)
@@ -40,7 +40,7 @@
 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())))
 {
 }
@@ -47,7 +47,7 @@
 
 FloatingState::FloatingState(LayoutContext& layoutContext, const Box& formattingContextRoot)
     : m_layoutContext(layoutContext)
-    , m_formattingContextRoot(makeWeakPtr(const_cast<Box&>(formattingContextRoot)))
+    , m_formattingContextRoot(makeWeakPtr(formattingContextRoot))
 {
 }
 

Modified: trunk/Source/WebCore/layout/floats/FloatingState.h (235734 => 235735)


--- trunk/Source/WebCore/layout/floats/FloatingState.h	2018-09-06 13:27:41 UTC (rev 235734)
+++ trunk/Source/WebCore/layout/floats/FloatingState.h	2018-09-06 13:40:56 UTC (rev 235735)
@@ -71,7 +71,7 @@
         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 @@
     std::optional<LayoutUnit> bottom(const Box& formattingContextRoot, Clear) const;
 
     LayoutContext& m_layoutContext;
-    WeakPtr<Box> m_formattingContextRoot;
+    WeakPtr<const Box> m_formattingContextRoot;
     FloatList m_floats;
 };
 

Modified: trunk/Source/WebCore/layout/layouttree/LayoutContainer.cpp (235734 => 235735)


--- trunk/Source/WebCore/layout/layouttree/LayoutContainer.cpp	2018-09-06 13:27:41 UTC (rev 235734)
+++ trunk/Source/WebCore/layout/layouttree/LayoutContainer.cpp	2018-09-06 13:40:56 UTC (rev 235735)
@@ -96,7 +96,7 @@
     // 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));
 }
 
 }

Modified: trunk/Source/WebCore/layout/layouttree/LayoutContainer.h (235734 => 235735)


--- trunk/Source/WebCore/layout/layouttree/LayoutContainer.h	2018-09-06 13:27:41 UTC (rev 235734)
+++ trunk/Source/WebCore/layout/layouttree/LayoutContainer.h	2018-09-06 13:40:56 UTC (rev 235735)
@@ -53,7 +53,7 @@
     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 @@
 
     Box* m_firstChild { nullptr };
     Box* m_lastChild { nullptr };
-    Vector<WeakPtr<Box>> m_outOfFlowDescendants;
+    Vector<WeakPtr<const Box>> m_outOfFlowDescendants;
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to