Changeset 267039 in webkit


Ignore:
Timestamp:
Sep 14, 2020 2:00:54 PM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC][FFC] Each in-flow child of a flex container becomes a flex item.
https://bugs.webkit.org/show_bug.cgi?id=216494

Reviewed by Simon Fraser.

...and flex items form independent formatting contexts for their content.

  • layout/layouttree/LayoutBox.cpp:

(WebCore::Layout::Box::establishesIndependentFormattingContext const):
(WebCore::Layout::Box::isFlexItem const):

  • layout/layouttree/LayoutBox.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r267036 r267039  
     12020-09-14  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][FFC] Each in-flow child of a flex container becomes a flex item.
     4        https://bugs.webkit.org/show_bug.cgi?id=216494
     5
     6        Reviewed by Simon Fraser.
     7
     8        ...and flex items form independent formatting contexts for their content.
     9
     10        * layout/layouttree/LayoutBox.cpp:
     11        (WebCore::Layout::Box::establishesIndependentFormattingContext const):
     12        (WebCore::Layout::Box::isFlexItem const):
     13        * layout/layouttree/LayoutBox.h:
     14
    1152020-09-14  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp

    r267026 r267039  
    132132{
    133133    // FIXME: This is where we would check for 'contain' property.
    134     return isAbsolutelyPositioned();
     134    return isAbsolutelyPositioned() || isFlexItem();
    135135}
    136136
     
    316316}
    317317
     318bool Box::isFlexItem() const
     319{
     320    // Each in-flow child of a flex container becomes a flex item (https://www.w3.org/TR/css-flexbox-1/#flex-items).
     321    return isInFlow() && parent().isFlexBox();
     322}
     323
    318324bool Box::isBlockContainerBox() const
    319325{
  • trunk/Source/WebCore/layout/layouttree/LayoutBox.h

    r267026 r267039  
    127127    bool isTableCell() const { return style().display() == DisplayType::TableCell; }
    128128    bool isFlexBox() const { return style().display() == DisplayType::Flex; }
     129    bool isFlexItem() const;
    129130    bool isIFrame() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::IFrame; }
    130131    bool isImage() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::Image; }
Note: See TracChangeset for help on using the changeset viewer.