Changeset 231958 in webkit
- Timestamp:
- May 18, 2018 9:32:14 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r231955 r231958 1 2018-05-18 Zalan Bujtas <zalan@apple.com> 2 3 [LFC] Implement height computation for non-replaced floating elements. 4 https://bugs.webkit.org/show_bug.cgi?id=185767 5 6 Reviewed by Antti Koivisto. 7 8 * layout/FormattingContext.cpp: 9 (WebCore::Layout::FormattingContext::computeFloatingHeight const): 10 (WebCore::Layout::FormattingContext::computeFloatingNonReplacedHeight const): 11 (WebCore::Layout::FormattingContext::contentHeightForFormattingContextRoot const): 12 * layout/FormattingContext.h: 13 1 14 2018-05-18 Dirk Schulze <krit@webkit.org> 2 15 -
trunk/Source/WebCore/layout/FormattingContext.cpp
r231953 r231958 109 109 { 110 110 if (!layoutBox.replaced()) { 111 ASSERT_NOT_IMPLEMENTED_YET();111 computeFloatingNonReplacedHeight(layoutContext, layoutBox, displayBox); 112 112 return; 113 113 } … … 216 216 217 217 displayBox.setHeight(computedHeightValue); 218 } 219 220 void FormattingContext::computeFloatingNonReplacedHeight(LayoutContext& layoutContext, const Box& layoutBox, Display::Box& displayBox) const 221 { 222 ASSERT(layoutBox.isFloatingPositioned() && !layoutBox.replaced()); 223 // 10.6.6 Complicated cases 224 // 225 // Floating, non-replaced elements. 226 // 227 // If 'height' is 'auto', the height depends on the element's descendants per 10.6.7. 228 auto height = layoutBox.style().logicalHeight(); 229 displayBox.setHeight(height.isAuto() ? contentHeightForFormattingContextRoot(layoutContext, layoutBox) : LayoutUnit(height.value())); 218 230 } 219 231 … … 318 330 LayoutUnit FormattingContext::contentHeightForFormattingContextRoot(LayoutContext& layoutContext, const Box& layoutBox) const 319 331 { 320 ASSERT(layoutBox.style().logicalHeight().isAuto()); 321 322 if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowOrFloatingChild()) 323 return 0; 324 325 auto& formattingRootContainer = downcast<Container>(layoutBox); 332 ASSERT(layoutBox.style().logicalHeight().isAuto() && layoutBox.establishesFormattingContext()); 326 333 // 10.6.7 'Auto' heights for block formatting context roots 327 334 … … 333 340 // then the height is increased to include those edges. Only floats that participate in this block formatting context are taken 334 341 // into account, e.g., floats inside absolutely positioned descendants or other floats are not. 342 if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowOrFloatingChild()) 343 return 0; 344 345 auto& formattingRootContainer = downcast<Container>(layoutBox); 335 346 if (formattingRootContainer.establishesInlineFormattingContext()) 336 347 return 0; -
trunk/Source/WebCore/layout/FormattingContext.h
r231953 r231958 97 97 void computeOutOfFlowReplacedWidth(LayoutContext&, const Box&, Display::Box&) const; 98 98 99 void computeFloatingNonReplacedHeight(LayoutContext&, const Box&, Display::Box&) const; 99 100 void computeFloatingNonReplacedWidth(LayoutContext&, const Box&, Display::Box&) const; 100 101
Note: See TracChangeset
for help on using the changeset viewer.