Changeset 263268 in webkit
- Timestamp:
- Jun 19, 2020, 8:39:55 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r263266 r263268 1 2020-06-19 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][TFC] Do not special-case empty tables 4 https://bugs.webkit.org/show_bug.cgi?id=213378 5 6 Reviewed by Antti Koivisto. 7 8 * fast/layoutformattingcontext/table-min-max-width-empty-content-simple-expected.html: Added. 9 * fast/layoutformattingcontext/table-min-max-width-empty-content-simple.html: Added. 10 1 11 2020-06-19 Jason Lawrence <lawrence.j@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r263265 r263268 1 2020-06-19 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][TFC] Do not special-case empty tables 4 https://bugs.webkit.org/show_bug.cgi?id=213378 5 6 Reviewed by Antti Koivisto. 7 8 Now that min/max-width support is added, empty tables can just go through the normal width computation path. 9 10 Test: fast/layoutformattingcontext/table-min-max-width-empty-content-simple.html 11 12 * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: 13 (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): 14 1 15 2020-06-10 Sergio Villar Senin <svillar@igalia.com> 2 16 -
trunk/Source/WebCore/layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp
r263260 r263268 145 145 { 146 146 ASSERT(tableBox.isTableBox()); 147 if (!tableBox.hasChild()) {148 auto computedWidthAndMargin = geometry().computedWidthAndMargin(tableBox, horizontalConstraints, { });149 auto& displayBox = formattingState().displayBox(tableBox);150 displayBox.setContentBoxWidth(computedWidthAndMargin.contentWidth);151 displayBox.setHorizontalMargin(computedWidthAndMargin.usedMargin);152 displayBox.setHorizontalComputedMargin(computedWidthAndMargin.computedMargin);153 return;154 }155 156 147 // This is a special table "fit-content size" behavior handling. Not in the spec though. 157 148 // Table returns its final width as min/max. Use this final width value to computed horizontal margins etc. … … 161 152 intrinsicWidthConstraints = *precomputedIntrinsicWidthConstraints; 162 153 else { 163 intrinsicWidthConstraints = LayoutContext::createFormattingContext(tableBox, layoutState())->computedIntrinsicWidthConstraints(); 154 if (tableBox.hasChild()) 155 intrinsicWidthConstraints = LayoutContext::createFormattingContext(tableBox, layoutState())->computedIntrinsicWidthConstraints(); 164 156 formattingStateForTableBox.setIntrinsicWidthConstraints(intrinsicWidthConstraints); 165 157 } 166 158 159 auto availableHorizontalSpace = horizontalConstraints.logicalWidth; 167 160 auto geometry = this->geometry(); 168 auto computedWidth = geometry.computedWidth(tableBox, horizontalConstraints.logicalWidth);169 auto computedMaxWidth = geometry.computedMaxWidth(tableBox, horizontalConstraints.logicalWidth);170 auto computedMinWidth = geometry.computedMinWidth(tableBox, horizontalConstraints.logicalWidth);161 auto computedWidth = geometry.computedWidth(tableBox, availableHorizontalSpace); 162 auto computedMaxWidth = geometry.computedMaxWidth(tableBox, availableHorizontalSpace); 163 auto computedMinWidth = geometry.computedMinWidth(tableBox, availableHorizontalSpace); 171 164 // Use the generic shrink-to-fit-width logic as the initial width for the table. 172 auto usedWidth = std::min(std::max(intrinsicWidthConstraints.minimum, horizontalConstraints.logicalWidth), intrinsicWidthConstraints.maximum);165 auto usedWidth = std::min(std::max(intrinsicWidthConstraints.minimum, availableHorizontalSpace), intrinsicWidthConstraints.maximum); 173 166 if (computedWidth || computedMinWidth || computedMaxWidth) { 174 167 if (computedWidth) {
Note:
See TracChangeset
for help on using the changeset viewer.