Changeset 246460 in webkit
- Timestamp:
- Jun 15, 2019, 7:09:16 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
layout/FormattingContextGeometry.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r246459 r246460 1 2019-06-15 Zalan Bujtas <zalan@apple.com> 2 3 [LFC] Fix available width for shrink-to-fit (for out-of-flow non-replaced box) 4 https://bugs.webkit.org/show_bug.cgi?id=198880 5 <rdar://problem/51773118> 6 7 Reviewed by Antti Koivisto. 8 9 This patch fixes the cases when the available width for the out-of-flow positioned box is not the same as the containing block's (padding)width. 10 11 * layout/FormattingContextGeometry.cpp: 12 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): 13 1 14 2019-06-15 Zalan Bujtas <zalan@apple.com> 2 15 -
trunk/Source/WebCore/layout/FormattingContextGeometry.cpp
r246459 r246460 485 485 if (!left && !width && right) { 486 486 // #1 487 width = shrinkToFitWidth(layoutState, layoutBox, usedValues); 487 // Calculate the available width by solving for 'width' after setting 'left' (in case 1) to 0 488 left = LayoutUnit { 0 }; 489 auto availableWidth = containingBlockWidth - (*left + usedHorizontalMargin.start + borderLeft + paddingLeft + paddingRight + borderRight + usedHorizontalMargin.end + *right); 490 width = shrinkToFitWidth(layoutState, layoutBox, UsedHorizontalValues { availableWidth, usedValues.width, usedValues.margin }); 488 491 left = containingBlockWidth - (usedHorizontalMargin.start + borderLeft + paddingLeft + *width + paddingRight + borderRight + usedHorizontalMargin.end + *right); 489 492 } else if (!left && !right && width) { … … 499 502 } else if (!width && !right && left) { 500 503 // #3 501 width = shrinkToFitWidth(layoutState, layoutBox, usedValues); 504 // Calculate the available width by solving for 'width' after setting 'right' (in case 3) to 0 505 right = LayoutUnit { 0 }; 506 auto availableWidth = containingBlockWidth - (*left + usedHorizontalMargin.start + borderLeft + paddingLeft + paddingRight + borderRight + usedHorizontalMargin.end + *right); 507 width = shrinkToFitWidth(layoutState, layoutBox, UsedHorizontalValues { availableWidth, usedValues.width, usedValues.margin }); 502 508 right = containingBlockWidth - (*left + usedHorizontalMargin.start + borderLeft + paddingLeft + *width + paddingRight + borderRight + usedHorizontalMargin.end); 503 509 } else if (!left && width && right) {
Note:
See TracChangeset
for help on using the changeset viewer.