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

Changeset 249085 in webkit


Ignore:
Timestamp:
Aug 24, 2019, 6:34:50 AM (7 years ago)
Author:
Alan Bujtas
Message:

[LFC] Box::isAnonymous() can not rely on the lack of ElementType.
https://bugs.webkit.org/show_bug.cgi?id=201106
<rdar://problem/54660287>

Reviewed by Antti Koivisto.

Add bool m_isAnonymous member to mark anonymous layout boxes. Anonymous boxes are not rare enough to include this variable in RareData.

  • layout/layouttree/LayoutBox.h:

(WebCore::Layout::Box::setIsAnonymous):

  • layout/layouttree/LayoutTreeBuilder.cpp:

(WebCore::Layout::TreeBuilder::createLayoutBox):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r249084 r249085  
     12019-08-24  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Box::isAnonymous() can not rely on the lack of ElementType.
     4        https://bugs.webkit.org/show_bug.cgi?id=201106
     5        <rdar://problem/54660287>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Add bool m_isAnonymous member to mark anonymous layout boxes. Anonymous boxes are not rare enough to include this variable in RareData.
     10
     11        * layout/layouttree/LayoutBox.h:
     12        (WebCore::Layout::Box::setIsAnonymous):
     13        * layout/layouttree/LayoutTreeBuilder.cpp:
     14        (WebCore::Layout::TreeBuilder::createLayoutBox):
     15
    1162019-08-24  Antti Koivisto  <antti@apple.com>
    217
  • trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp

    r249081 r249085  
    4444    , m_baseTypeFlags(baseTypeFlags)
    4545    , m_hasRareData(false)
     46    , m_isAnonymous(false)
    4647{
    4748    if (isReplaced())
  • trunk/Source/WebCore/layout/layouttree/LayoutBox.h

    r249081 r249085  
    4646        Document,
    4747        Body,
    48         TableWrapperBox, // The table generates a principal block container box called the table wrapper box that contains the table box and any caption boxes. 
     48        TableWrapperBox, // The table generates a principal block container box called the table wrapper box that contains the table box and any caption boxes.
    4949        TableBox, // The table box is a block-level box that contains the table's internal table boxes.
    5050        TableColumn,
     
    160160    void setPreviousSibling(Box& previousSibling) { m_previousSibling = &previousSibling; }
    161161
     162    void setIsAnonymous() { m_isAnonymous = true; }
     163
    162164protected:
    163165    Box(Optional<ElementAttributes>, RenderStyle&&, BaseTypeFlags);
     
    196198    unsigned m_baseTypeFlags : 6;
    197199    bool m_hasRareData : 1;
     200    bool m_isAnonymous : 1;
    198201};
    199202
  • trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp

    r249082 r249085  
    132132        else
    133133            childLayoutBox = makeUnique<Box>(downcast<RenderText>(childRenderer).originalText(), RenderStyle::createAnonymousStyleWithDisplay(parentRenderer.style(), DisplayType::Inline));
     134        childLayoutBox->setIsAnonymous();
    134135        return childLayoutBox;
    135136    }
     
    143144        // Construct the principal table wrapper box (and not the table box itself).
    144145        childLayoutBox = makeUnique<Container>(Box::ElementAttributes { Box::ElementType::TableWrapperBox }, RenderStyle::clone(renderer.style()));
     146        childLayoutBox->setIsAnonymous();
    145147    } else if (is<RenderReplaced>(renderer)) {
    146148        if (displayType == DisplayType::Block)
     
    190192            childLayoutBox->setColumnSpan(columnSpan);
    191193    }
     194
     195    if (childRenderer.isAnonymous())
     196        childLayoutBox->setIsAnonymous();
    192197
    193198    return childLayoutBox;
Note: See TracChangeset for help on using the changeset viewer.