⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 235735 in webkit


Ignore:
Timestamp:
Sep 6, 2018, 6:40:56 AM (8 years ago)
Author:
Alan Bujtas
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):

Location:
trunk/Source/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r235732 r235735  
     12018-09-05  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Adapt to the new const WeakPtr<>
     4        https://bugs.webkit.org/show_bug.cgi?id=189334
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * layout/FormattingContext.cpp:
     9        (WebCore::Layout::FormattingContext::FormattingContext):
     10        * layout/FormattingContext.h:
     11        * layout/LayoutContext.cpp:
     12        (WebCore::Layout::LayoutContext::initializeRoot):
     13        * layout/LayoutContext.h:
     14        * layout/floats/FloatAvoider.cpp:
     15        (WebCore::Layout::FloatAvoider::FloatAvoider):
     16        * layout/floats/FloatAvoider.h:
     17        * layout/floats/FloatingState.cpp:
     18        (WebCore::Layout::FloatingState::FloatItem::FloatItem):
     19        (WebCore::Layout::FloatingState::FloatingState):
     20        * layout/floats/FloatingState.h:
     21        * layout/layouttree/LayoutContainer.cpp:
     22        (WebCore::Layout::Container::addOutOfFlowDescendant):
     23        * layout/layouttree/LayoutContainer.h:
     24        (WebCore::Layout::Container::outOfFlowDescendants const):
     25
    1262018-09-06  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    227
  • trunk/Source/WebCore/layout/FormattingContext.cpp

    r235716 r235735  
    4444
    4545FormattingContext::FormattingContext(const Box& formattingContextRoot)
    46     : m_root(makeWeakPtr(const_cast<Box&>(formattingContextRoot)))
     46    : m_root(makeWeakPtr(formattingContextRoot))
    4747{
    4848}
  • trunk/Source/WebCore/layout/FormattingContext.h

    r235716 r235735  
    123123    void computeOutOfFlowHorizontalGeometry(LayoutContext&, const Box&) const;
    124124
    125     WeakPtr<Box> m_root;
     125    WeakPtr<const Box> m_root;
    126126};
    127127
  • trunk/Source/WebCore/layout/LayoutContext.cpp

    r235716 r235735  
    5454    ASSERT(root.establishesFormattingContext());
    5555
    56     m_root = makeWeakPtr(const_cast<Container&>(root));
     56    m_root = makeWeakPtr(root);
    5757    auto& displayBox = displayBoxForLayoutBox(root);
    5858
  • trunk/Source/WebCore/layout/LayoutContext.h

    r235716 r235735  
    9191    void layoutFormattingContextSubtree(const Box&);
    9292
    93     WeakPtr<Container> m_root;
     93    WeakPtr<const Container> m_root;
    9494    HashSet<const Container*> m_formattingContextRootListForLayout;
    9595    HashMap<const Box*, std::unique_ptr<FormattingState>> m_formattingStates;
  • trunk/Source/WebCore/layout/floats/FloatAvoider.cpp

    r235505 r235735  
    4040
    4141FloatAvoider::FloatAvoider(const Box& layoutBox, const FloatingState& floatingState, const LayoutContext& layoutContext)
    42     : m_layoutBox(makeWeakPtr(const_cast<Box&>(layoutBox)))
     42    : m_layoutBox(makeWeakPtr(layoutBox))
    4343    , m_floatingState(floatingState)
    4444    , m_absoluteDisplayBox(FormattingContext::mapBoxToAncestor(layoutContext, layoutBox, downcast<Container>(floatingState.root())))
  • trunk/Source/WebCore/layout/floats/FloatAvoider.h

    r235503 r235735  
    8383
    8484private:
    85     WeakPtr<Box> m_layoutBox;
     85    WeakPtr<const Box> m_layoutBox;
    8686    const FloatingState& m_floatingState;
    8787    Display::Box m_absoluteDisplayBox;
  • trunk/Source/WebCore/layout/floats/FloatingState.cpp

    r235681 r235735  
    4141
    4242FloatingState::FloatItem::FloatItem(const Box& layoutBox, const FloatingState& floatingState)
    43     : m_layoutBox(makeWeakPtr(const_cast<Box&>(layoutBox)))
     43    : m_layoutBox(makeWeakPtr(layoutBox))
    4444    , m_absoluteDisplayBox(FormattingContext::mapBoxToAncestor(floatingState.layoutContext(), layoutBox, downcast<Container>(floatingState.root())))
    4545{
    … …  
    4848FloatingState::FloatingState(LayoutContext& layoutContext, const Box& formattingContextRoot)
    4949    : m_layoutContext(layoutContext)
    50     , m_formattingContextRoot(makeWeakPtr(const_cast<Box&>(formattingContextRoot)))
     50    , m_formattingContextRoot(makeWeakPtr(formattingContextRoot))
    5151{
    5252}
  • trunk/Source/WebCore/layout/floats/FloatingState.h

    r235350 r235735  
    7272
    7373    private:
    74         WeakPtr<Box> m_layoutBox;
     74        WeakPtr<const Box> m_layoutBox;
    7575        Display::Box m_absoluteDisplayBox;
    7676    };
    … …  
    8888
    8989    LayoutContext& m_layoutContext;
    90     WeakPtr<Box> m_formattingContextRoot;
     90    WeakPtr<const Box> m_formattingContextRoot;
    9191    FloatList m_floats;
    9292};
  • trunk/Source/WebCore/layout/layouttree/LayoutContainer.cpp

    r233125 r235735  
    9797    // it's okay to store them at the formatting context root level -as opposed to the containing block level.
    9898    ASSERT(establishesFormattingContext());
    99     m_outOfFlowDescendants.append(makeWeakPtr(const_cast<Box&>(outOfFlowBox)));
     99    m_outOfFlowDescendants.append(makeWeakPtr(outOfFlowBox));
    100100}
    101101
  • trunk/Source/WebCore/layout/layouttree/LayoutContainer.h

    r233272 r235735  
    5454    bool hasInFlowOrFloatingChild() const { return firstInFlowOrFloatingChild(); }
    5555
    56     const Vector<WeakPtr<Box>>& outOfFlowDescendants() const { return m_outOfFlowDescendants; }
     56    const Vector<WeakPtr<const Box>>& outOfFlowDescendants() const { return m_outOfFlowDescendants; }
    5757
    5858protected:
    … …  
    6666    Box* m_firstChild { nullptr };
    6767    Box* m_lastChild { nullptr };
    68     Vector<WeakPtr<Box>> m_outOfFlowDescendants;
     68    Vector<WeakPtr<const Box>> m_outOfFlowDescendants;
    6969};
    7070
Note: See TracChangeset for help on using the changeset viewer.