Changeset 249590 in webkit
- Timestamp:
- Sep 6, 2019 1:51:21 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r249583 r249590 1 2019-09-06 Zalan Bujtas <zalan@apple.com> 2 3 [LFC] A formatting context root is always a containing block for relative: static boxes. 4 https://bugs.webkit.org/show_bug.cgi?id=201554 5 <rdar://problem/55123295> 6 7 Reviewed by Antti Koivisto. 8 9 "For other elements, if the element's position is 'relative' or 'static', the containing block is formed by the content 10 edge of the nearest ancestor box that is a block container or which establishes a formatting context." 11 12 * layout/layouttree/LayoutBox.cpp: 13 (WebCore::Layout::Box::containingBlock const): 14 * page/FrameViewLayoutContext.cpp: 15 (WebCore::layoutUsingFormattingContext): 16 1 17 2019-09-06 Sihui Liu <sihui_liu@apple.com> 2 18 -
trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp
r249288 r249590 189 189 // The containing block in which the root element lives is a rectangle called the initial containing block. 190 190 // For other elements, if the element's position is 'relative' or 'static', the containing block is formed by the 191 // content edge of the nearest block container ancestor box .191 // content edge of the nearest block container ancestor box or which establishes a formatting context. 192 192 // If the element has 'position: fixed', the containing block is established by the viewport 193 193 // If the element has 'position: absolute', the containing block is established by the nearest ancestor with a … … 197 197 198 198 if (!isPositioned() || isInFlowPositioned()) { 199 auto* nearestBlockContainer = parent(); 200 for (; nearestBlockContainer->parent() && !nearestBlockContainer->isBlockContainerBox(); nearestBlockContainer = nearestBlockContainer->parent()) { } 201 return nearestBlockContainer; 199 for (auto* nearestBlockContainerOrFormattingContextRoot = parent(); nearestBlockContainerOrFormattingContextRoot; nearestBlockContainerOrFormattingContextRoot = nearestBlockContainerOrFormattingContextRoot->parent()) { 200 if (nearestBlockContainerOrFormattingContextRoot->isBlockContainerBox() || nearestBlockContainerOrFormattingContextRoot->establishesFormattingContext()) 201 return nearestBlockContainerOrFormattingContextRoot; 202 } 203 // We should always manage to find the ICB. 204 ASSERT_NOT_REACHED(); 205 return nullptr; 202 206 } 203 207
Note: See TracChangeset
for help on using the changeset viewer.