Bug 115156

Summary: Fix table sizing when 'max-width' is used
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: Layout and RenderingAssignee: Noam Rosenthal <noam>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, commit-queue, esprehn+autocc, ews-watchlist, glenn, hyatt, jchaffraix, kling, kondapallykalyan, llango.u-szeged, mmaxfield, noam, pdr, rniwa, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: BlinkMergeCandidate, InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 127997    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

Ryosuke Niwa
Reported 2013-04-25 00:55:21 PDT
https://chromium.googlesource.com/chromium/blink/+/0bca0dec4895aeeb2054ba36316e984e4ebed06f Fix table sizing when 'max-width' is used r143534 make <table> abide by 'max-width' all the time which is wrong. Per the CSS specification, a table should be wide enough to fit its content, regardless of 'max-width'. r140479 fixed part of the regression from that change but made the same fatal mistake by constraining min-content to fit 'max-width'. The fix is to avoid constraining min-content and ensure that the table logical width is at least its min-content size.
Attachments
Patch (10.52 KB, patch)
2013-12-10 05:47 PST, László Langó
no flags
Patch (9.32 KB, patch)
2020-05-20 03:44 PDT, Noam Rosenthal
no flags
László Langó
Comment 1 2013-12-10 05:47:12 PST
László Langó
Comment 2 2014-01-15 06:18:48 PST
Can anyone review this?
Andreas Kling
Comment 3 2014-01-30 23:37:02 PST
Comment on attachment 218857 [details] Patch OK
WebKit Commit Bot
Comment 4 2014-01-31 00:04:27 PST
Comment on attachment 218857 [details] Patch Clearing flags on attachment: 218857 Committed r163165: <http://trac.webkit.org/changeset/163165>
WebKit Commit Bot
Comment 5 2014-01-31 00:04:31 PST
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 6 2014-01-31 09:28:04 PST
This change made two regression tests assert: fast/table/multiple-captions-crash.xhtml fast/table/multiple-captions-crash2.xhtml Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 com.apple.JavaScriptCore 0x0000000105bf7daa WTFCrash + 42 (Assertions.cpp:333) 1 com.apple.WebCore 0x0000000108ae4712 WebCore::RenderTable::updateLogicalWidth() + 3618 (RenderTable.cpp:334) 2 com.apple.WebCore 0x0000000108ae53c9 WebCore::RenderTable::layout() + 569 (RenderTable.cpp:437) 3 com.apple.WebCore 0x0000000109148ebb WebCore::RenderBlockFlow::layoutBlockChild(WebCore::RenderBox&, WebCore::RenderBlockFlow::MarginInfo&, WebCore::LayoutUnit&, WebCore::LayoutUnit&) + 1323 (RenderBlockFlow.cpp:640) 4 com.apple.WebCore 0x0000000109146ada WebCore::RenderBlockFlow::layoutBlockChildren(bool, WebCore::LayoutUnit&) + 618 (RenderBlockFlow.cpp:557) 5 com.apple.WebCore 0x00000001091456b7 WebCore::RenderBlockFlow::layoutBlock(bool, WebCore::LayoutUnit) + 1191 (RenderBlockFlow.cpp:407) 6 com.apple.WebCore 0x000000010887c55d WebCore::RenderBlock::layout() + 125 (RenderBlock.cpp:1318) 7 com.apple.WebCore 0x0000000109148ebb WebCore::RenderBlockFlow::layoutBlockChild(WebCore::RenderBox&, WebCore::RenderBlockFlow::MarginInfo&, WebCore::LayoutUnit&, WebCore::LayoutUnit&) + 1323 (RenderBlockFlow.cpp:640) 8 com.apple.WebCore 0x0000000109146ada WebCore::RenderBlockFlow::layoutBlockChildren(bool, WebCore::LayoutUnit&) + 618 (RenderBlockFlow.cpp:557)
WebKit Commit Bot
Comment 7 2014-01-31 09:35:52 PST
Re-opened since this is blocked by bug 127997
László Langó
Comment 8 2014-02-03 03:10:28 PST
I cannot reproduce the assertions. (In reply to comment #6) > This change made two regression tests assert: > > fast/table/multiple-captions-crash.xhtml > fast/table/multiple-captions-crash2.xhtml > > Thread 0 Crashed:: Dispatch queue: com.apple.main-thread > 0 com.apple.JavaScriptCore 0x0000000105bf7daa WTFCrash + 42 (Assertions.cpp:333) > 1 com.apple.WebCore 0x0000000108ae4712 WebCore::RenderTable::updateLogicalWidth() + 3618 (RenderTable.cpp:334) > 2 com.apple.WebCore 0x0000000108ae53c9 WebCore::RenderTable::layout() + 569 (RenderTable.cpp:437) > 3 com.apple.WebCore 0x0000000109148ebb WebCore::RenderBlockFlow::layoutBlockChild(WebCore::RenderBox&, WebCore::RenderBlockFlow::MarginInfo&, WebCore::LayoutUnit&, WebCore::LayoutUnit&) + 1323 (RenderBlockFlow.cpp:640) > 4 com.apple.WebCore 0x0000000109146ada WebCore::RenderBlockFlow::layoutBlockChildren(bool, WebCore::LayoutUnit&) + 618 (RenderBlockFlow.cpp:557) > 5 com.apple.WebCore 0x00000001091456b7 WebCore::RenderBlockFlow::layoutBlock(bool, WebCore::LayoutUnit) + 1191 (RenderBlockFlow.cpp:407) > 6 com.apple.WebCore 0x000000010887c55d WebCore::RenderBlock::layout() + 125 (RenderBlock.cpp:1318) > 7 com.apple.WebCore 0x0000000109148ebb WebCore::RenderBlockFlow::layoutBlockChild(WebCore::RenderBox&, WebCore::RenderBlockFlow::MarginInfo&, WebCore::LayoutUnit&, WebCore::LayoutUnit&) + 1323 (RenderBlockFlow.cpp:640) > 8 com.apple.WebCore 0x0000000109146ada WebCore::RenderBlockFlow::layoutBlockChildren(bool, WebCore::LayoutUnit&) + 618 (RenderBlockFlow.cpp:557)
Noam Rosenthal
Comment 9 2020-05-20 02:41:46 PDT
*** Bug 203589 has been marked as a duplicate of this bug. ***
Noam Rosenthal
Comment 10 2020-05-20 03:44:14 PDT
Noam Rosenthal
Comment 11 2020-05-20 03:46:11 PDT
This bug makes the wikipedia infobox create horizontal scroll: https://en.wikipedia.org/wiki/Normal_distribution The patch is verified to fix that.
Noam Rosenthal
Comment 12 2020-05-20 04:07:17 PDT
*** Bug 109462 has been marked as a duplicate of this bug. ***
Noam Rosenthal
Comment 13 2020-05-20 04:09:30 PDT
(In reply to Alexey Proskuryakov from comment #6) > This change made two regression tests assert: > > fast/table/multiple-captions-crash.xhtml > fast/table/multiple-captions-crash2.xhtml > > Thread 0 Crashed:: Dispatch queue: com.apple.main-thread > 0 com.apple.JavaScriptCore 0x0000000105bf7daa WTFCrash + 42 > (Assertions.cpp:333) > 1 com.apple.WebCore 0x0000000108ae4712 > WebCore::RenderTable::updateLogicalWidth() + 3618 (RenderTable.cpp:334) > 2 com.apple.WebCore 0x0000000108ae53c9 > WebCore::RenderTable::layout() + 569 (RenderTable.cpp:437) > 3 com.apple.WebCore 0x0000000109148ebb > WebCore::RenderBlockFlow::layoutBlockChild(WebCore::RenderBox&, > WebCore::RenderBlockFlow::MarginInfo&, WebCore::LayoutUnit&, > WebCore::LayoutUnit&) + 1323 (RenderBlockFlow.cpp:640) > 4 com.apple.WebCore 0x0000000109146ada > WebCore::RenderBlockFlow::layoutBlockChildren(bool, WebCore::LayoutUnit&) + > 618 (RenderBlockFlow.cpp:557) > 5 com.apple.WebCore 0x00000001091456b7 > WebCore::RenderBlockFlow::layoutBlock(bool, WebCore::LayoutUnit) + 1191 > (RenderBlockFlow.cpp:407) > 6 com.apple.WebCore 0x000000010887c55d > WebCore::RenderBlock::layout() + 125 (RenderBlock.cpp:1318) > 7 com.apple.WebCore 0x0000000109148ebb > WebCore::RenderBlockFlow::layoutBlockChild(WebCore::RenderBox&, > WebCore::RenderBlockFlow::MarginInfo&, WebCore::LayoutUnit&, > WebCore::LayoutUnit&) + 1323 (RenderBlockFlow.cpp:640) > 8 com.apple.WebCore 0x0000000109146ada > WebCore::RenderBlockFlow::layoutBlockChildren(bool, WebCore::LayoutUnit&) + > 618 (RenderBlockFlow.cpp:557) There was a bug in the original patch from 2014 - (was modifying minPreferredWidth instead of maxPreferredWidth). The new patch should fix this.
EWS
Comment 14 2020-05-20 09:05:47 PDT
Committed r261924: <https://trac.webkit.org/changeset/261924> All reviewed patches have been landed. Closing bug and clearing flags on attachment 399826 [details].
Radar WebKit Bug Importer
Comment 15 2020-05-20 09:06:18 PDT
Note You need to log in before you can comment on or make changes to this bug.