Changeset 271134 in webkit


Ignore:
Timestamp:
Jan 4, 2021, 10:13:28 AM (5 years ago)
Author:
Simon Fraser
Message:

[LFC Display] Give display boxes a parent pointer
https://bugs.webkit.org/show_bug.cgi?id=220210

Reviewed by Zalan Bujtas.

Future code will need to be able to do ancestor tree walks ("find enclosing"),
so give Display::Box a pointer to its parent ContainerBox.

  • display/DisplayTreeBuilder.cpp:

(WebCore::Display::TreeBuilder::insert const):

  • display/css/DisplayBox.h:

(WebCore::Display::Box::parent const):
(WebCore::Display::Box::setParent):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r271133 r271134  
     12020-12-31  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [LFC Display] Give display boxes a parent pointer
     4        https://bugs.webkit.org/show_bug.cgi?id=220210
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Future code will need to be able to do ancestor tree walks ("find enclosing"),
     9        so give Display::Box a pointer to its parent ContainerBox.
     10
     11        * display/DisplayTreeBuilder.cpp:
     12        (WebCore::Display::TreeBuilder::insert const):
     13        * display/css/DisplayBox.h:
     14        (WebCore::Display::Box::parent const):
     15        (WebCore::Display::Box::setParent):
     16
    1172020-12-30  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Source/WebCore/display/DisplayTreeBuilder.cpp

    r271133 r271134  
    265265void TreeBuilder::insert(std::unique_ptr<Box>&& box, InsertionPosition& insertionPosition) const
    266266{
     267    box->setParent(&insertionPosition.container);
    267268    if (insertionPosition.currentChild) {
    268269        auto boxPtr = box.get();
  • trunk/Source/WebCore/display/css/DisplayBox.h

    r271133 r271134  
    3636namespace Display {
    3737
     38class ContainerBox;
    3839class Tree;
    3940
     
    7071    bool participatesInZOrderSorting() const;
    7172
     73    ContainerBox* parent() const { return m_parent; }
     74    void setParent(ContainerBox* parent) { m_parent = parent; }
     75
    7276    const Box* nextSibling() const { return m_nextSibling.get(); }
    7377    void setNextSibling(std::unique_ptr<Box>&&);
     
    8185    AbsoluteFloatRect m_absoluteBoxRect;
    8286    Style m_style;
     87    ContainerBox* m_parent { nullptr };
    8388    std::unique_ptr<Box> m_nextSibling;
    8489    OptionSet<TypeFlags> m_typeFlags;
Note: See TracChangeset for help on using the changeset viewer.