Changeset 261924 in webkit
- Timestamp:
- May 20, 2020 9:05:43 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r261922 r261924 1 2020-05-20 Noam Rosenthal <noam@webkit.org> 2 3 Fix table sizing when 'max-width' is used 4 https://bugs.webkit.org/show_bug.cgi?id=115156 5 6 Reviewed by Zalan Bujtas. 7 8 Based on a previous patch by László Langó <lango@inf.u-szeged.hu> 9 10 * fast/table/css-table-max-width-expected.txt: 11 * fast/table/css-table-max-width.html: 12 Change in behavior, test was expecting buggy behavior. 13 14 * fast/table/html-table-width-max-width-constrained-expected.txt: Added. 15 * fast/table/html-table-width-max-width-constrained.html: Added. 16 Test the desired behavior with content-constrained tables. 17 1 18 2020-05-20 Philippe Normand <pnormand@igalia.com> 2 19 -
trunk/LayoutTests/fast/table/css-table-max-width-expected.txt
r163175 r261924 11 11 PASS minGreatThanMaxWidthAutoLayout.getBoundingClientRect().width is 202 12 12 PASS onlyMaxWidthAutoLayout.getBoundingClientRect().width is 202 13 PASS maxWidthZeroAutoLayout.getBoundingClientRect().width is 013 PASS maxWidthZeroAutoLayout.getBoundingClientRect().width is 182 14 14 PASS maxGreatThanMinWidthFixedLayout.getBoundingClientRect().width is 202 15 15 PASS minGreatThanMaxWidthFixedLayout.getBoundingClientRect().width is 202 16 16 PASS onlyMaxWidthFixedLayout.getBoundingClientRect().width is 202 17 PASS maxWidthZeroFixedLayout.getBoundingClientRect().width is 017 PASS maxWidthZeroFixedLayout.getBoundingClientRect().width is 2 18 18 PASS successfullyParsed is true 19 19 -
trunk/LayoutTests/fast/table/css-table-max-width.html
r163175 r261924 43 43 qui officia deserunt mollit anim id est laborum. 44 44 </div> 45 <div id="maxWidthZeroAutoLayout" class="child" style="display:table; max-width:0; width:100%; ">45 <div id="maxWidthZeroAutoLayout" class="child" style="display:table; max-width:0; width:100%; font: 10px/1 Ahem;"> 46 46 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod 47 47 tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, … … 98 98 shouldBe("onlyMaxWidthAutoLayout.getBoundingClientRect().width","202"); 99 99 maxWidthZeroAutoLayout = document.getElementById("maxWidthZeroAutoLayout"); 100 shouldBe("maxWidthZeroAutoLayout.getBoundingClientRect().width"," 0");100 shouldBe("maxWidthZeroAutoLayout.getBoundingClientRect().width","182"); 101 101 maxGreatThanMinWidthFixedLayout = document.getElementById("maxGreatThanMinWidthFixedLayout"); 102 102 shouldBe("maxGreatThanMinWidthFixedLayout.getBoundingClientRect().width","202"); … … 106 106 shouldBe("onlyMaxWidthFixedLayout.getBoundingClientRect().width","202"); 107 107 maxWidthZeroFixedLayout = document.getElementById("maxWidthZeroFixedLayout"); 108 shouldBe("maxWidthZeroFixedLayout.getBoundingClientRect().width"," 0");108 shouldBe("maxWidthZeroFixedLayout.getBoundingClientRect().width","2"); 109 109 110 110 document.body.removeChild(document.getElementById('container')); -
trunk/Source/WebCore/ChangeLog
r261923 r261924 1 2020-05-20 Noam Rosenthal <noam@webkit.org> 2 3 Fix table sizing when 'max-width' is used 4 https://bugs.webkit.org/show_bug.cgi?id=115156 5 6 Reviewed by Zalan Bujtas. 7 8 Based on previous patch by László Langó <lango@inf.u-szeged.hu> 9 10 Test: fast/table/html-table-width-max-width-constrained.html 11 12 A table should always be wide enough to contain its content (preferred logical width). 13 This constraint should be stronger than the table style's specified min-width/width. 14 15 The behavior matches the spec, and behavior on Firefox/Chrome. 16 17 * rendering/RenderTable.cpp: 18 (WebCore::RenderTable::updateLogicalWidth): 19 Max-width should only affect the table's max preferred width. 20 21 (WebCore::RenderTable::computePreferredLogicalWidths): 22 Change the order of constraints so that content constraint is stronger than style width/max-width constraint. 23 1 24 2020-05-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 25 -
trunk/Source/WebCore/rendering/RenderTable.cpp
r260482 r261924 281 281 } 282 282 283 // Ensure we aren't smaller than our min preferred width.284 setLogicalWidth(std::max(logicalWidth(), minPreferredLogicalWidth()));285 286 287 283 // Ensure we aren't bigger than our max-width style. 288 284 Length styleMaxLogicalWidth = style().logicalMaxWidth(); … … 291 287 setLogicalWidth(std::min(logicalWidth(), computedMaxLogicalWidth)); 292 288 } 289 290 // Ensure we aren't smaller than our min preferred width. 291 setLogicalWidth(std::max(logicalWidth(), minPreferredLogicalWidth())); 293 292 294 293 // Ensure we aren't smaller than our min-width style. … … 828 827 if (styleToUse.logicalMaxWidth().isFixed()) { 829 828 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value())); 830 m_m inPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMaxWidth().value()));829 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, m_minPreferredLogicalWidth); 831 830 } 832 831
Note: See TracChangeset
for help on using the changeset viewer.