Changeset 267059 in webkit
- Timestamp:
- Sep 14, 2020 5:40:18 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267057 r267059 1 2020-09-14 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][FFC] Block box flex items establish block formatting contexts 4 https://bugs.webkit.org/show_bug.cgi?id=216502 5 6 Reviewed by Simon Fraser. 7 8 1. The display value of a flex item is blockified: if the specified display of an in-flow child of an element 9 generating a flex container is an inline-level value, it computes to its block-level equivalent. 10 2. A block box that establishes an independent formatting context establishes a new block formatting context for its contents. 11 12 * layout/layouttree/LayoutBox.cpp: 13 (WebCore::Layout::Box::establishesBlockFormattingContext const): 14 (WebCore::Layout::Box::isBlockBox const): 15 * layout/layouttree/LayoutBox.h: 16 1 17 2020-09-14 Jer Noble <jer.noble@apple.com> 2 18 -
trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp
r267054 r267059 82 82 return true; 83 83 84 // A block box that establishes an independent formatting context establishes a new block formatting context for its contents. 85 if (isBlockBox() && establishesIndependentFormattingContext()) 86 return true; 87 84 88 // 9.4.1 Block formatting contexts 85 89 // Floats, absolutely positioned elements, block containers (such as inline-blocks, table-cells, and table-captions) 86 90 // that are not block boxes, and block boxes with 'overflow' other than 'visible' (except when that value has been propagated to the viewport) 87 91 // establish new block formatting contexts for their contents. 88 if (isFloatingPositioned() || isAbsolutelyPositioned()) {92 if (isFloatingPositioned()) { 89 93 // Not all floating or out-of-positioned block level boxes establish BFC. 90 94 // See [9.7 Relationships between 'display', 'position', and 'float'] for details. … … 92 96 } 93 97 94 if (isBlockContainer Box() && !isBlockLevelBox())98 if (isBlockContainer() && !isBlockLevelBox()) 95 99 return true; 96 100 … … 105 109 // 9.4.2 Inline formatting contexts 106 110 // An inline formatting context is established by a block container box that contains no block-level boxes. 107 if (!isBlockContainer Box())111 if (!isBlockContainer()) 108 112 return false; 109 113 … … 205 209 auto* ancestor = &parent(); 206 210 for (; !is<InitialContainingBlock>(*ancestor); ancestor = &ancestor->parent()) { 207 if (ancestor->isBlockContainer Box() || ancestor->establishesFormattingContext())211 if (ancestor->isBlockContainer() || ancestor->establishesFormattingContext()) 208 212 return *ancestor; 209 213 } … … 295 299 } 296 300 301 bool Box::isBlockBox() const 302 { 303 // A block-level box that is also a block container. 304 return isBlockLevelBox() && isBlockContainer(); 305 } 306 297 307 bool Box::isInlineLevelBox() const 298 308 { … … 322 332 } 323 333 324 bool Box::isBlockContainer Box() const334 bool Box::isBlockContainer() const 325 335 { 326 336 auto display = m_style.display(); -
trunk/Source/WebCore/layout/layouttree/LayoutBox.h
r267054 r267059 102 102 bool isAnonymous() const { return m_isAnonymous; } 103 103 104 // Block level elements generate block level boxes. 104 105 bool isBlockLevelBox() const; 106 // A block-level box that is also a block container. 107 bool isBlockBox() const; 108 // A block-level box is also a block container box unless it is a table box or the principal box of a replaced element. 109 bool isBlockContainer() const; 105 110 bool isInlineLevelBox() const; 106 111 bool isInlineBox() const; … … 108 113 bool isInlineBlockBox() const; 109 114 bool isInlineTableBox() const; 110 bool isBlockContainerBox() const;111 115 bool isInitialContainingBlock() const { return baseTypeFlags().contains(InitialContainingBlockFlag); } 112 116
Note: See TracChangeset
for help on using the changeset viewer.