Changeset 249438 in webkit


Ignore:
Timestamp:
Sep 3, 2019 12:48:03 PM (5 years ago)
Author:
Alan Bujtas
Message:

[LFC][Floats] Do not pass FloatingState to FloatItem
https://bugs.webkit.org/show_bug.cgi?id=201406
<rdar://problem/54957097>

Reviewed by Antti Koivisto.

This is in preparation for transitioning the floating codebase to use the formatting context for
retrieving display boxes. Now FloatItems don't need the FloatingState to compute absolute display boxes.

  • layout/floats/FloatingState.cpp:

(WebCore::Layout::FloatingState::FloatItem::FloatItem):
(WebCore::Layout::FloatingState::append):

  • layout/floats/FloatingState.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r249437 r249438  
     12019-09-03  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][Floats] Do not pass FloatingState to FloatItem
     4        https://bugs.webkit.org/show_bug.cgi?id=201406
     5        <rdar://problem/54957097>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        This is in preparation for transitioning the floating codebase to use the formatting context for
     10        retrieving display boxes. Now FloatItems don't need the FloatingState to compute absolute display boxes. 
     11
     12        * layout/floats/FloatingState.cpp:
     13        (WebCore::Layout::FloatingState::FloatItem::FloatItem):
     14        (WebCore::Layout::FloatingState::append):
     15        * layout/floats/FloatingState.h:
     16
    1172019-09-03  Zalan Bujtas  <zalan@apple.com>
    218
  • trunk/Source/WebCore/layout/floats/FloatingState.cpp

    r249433 r249438  
    4040WTF_MAKE_ISO_ALLOCATED_IMPL(FloatingState);
    4141
    42 FloatingState::FloatItem::FloatItem(const Box& layoutBox, const FloatingState& floatingState)
     42FloatingState::FloatItem::FloatItem(const Box& layoutBox, Display::Box absoluteDisplayBox)
    4343    : m_layoutBox(makeWeakPtr(layoutBox))
    44     , m_absoluteDisplayBox(FormattingContext::mapBoxToAncestor(floatingState.layoutState(), layoutBox, downcast<Container>(floatingState.root())))
     44    , m_absoluteDisplayBox(absoluteDisplayBox)
    4545{
    4646}
     
    8484    ASSERT(is<Container>(*m_formattingContextRoot));
    8585
    86     auto newFloatItem = FloatItem { layoutBox, *this };
     86    auto newFloatItem = FloatItem { layoutBox, FormattingContext::mapBoxToAncestor(layoutState(), layoutBox, downcast<Container>(root()))};
    8787    if (m_floats.isEmpty())
    8888        return m_floats.append(newFloatItem);
  • trunk/Source/WebCore/layout/floats/FloatingState.h

    r249433 r249438  
    6060    class FloatItem {
    6161    public:
    62         FloatItem(const Box&, const FloatingState&);
     62        FloatItem(const Box&, Display::Box absoluteDisplayBox);
    6363
    6464        bool operator==(const Box& layoutBox) const { return m_layoutBox.get() == &layoutBox; }
Note: See TracChangeset for help on using the changeset viewer.