Bug 115156 - Fix table sizing when 'max-width' is used
Summary: Fix table sizing when 'max-width' is used
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Noam Rosenthal
URL:
Keywords: BlinkMergeCandidate, InRadar
: 109462 203589 (view as bug list)
Depends on: 127997
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-25 00:55 PDT by Ryosuke Niwa
Modified: 2020-05-20 09:06 PDT (History)
17 users (show)

See Also:


Attachments
Patch (10.52 KB, patch)
2013-12-10 05:47 PST, László Langó
no flags Details | Formatted Diff | Diff
Patch (9.32 KB, patch)
2020-05-20 03:44 PDT, Noam Rosenthal
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 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.
Comment 1 László Langó 2013-12-10 05:47:12 PST
Created attachment 218857 [details]
Patch
Comment 2 László Langó 2014-01-15 06:18:48 PST
Can anyone review this?
Comment 3 Andreas Kling 2014-01-30 23:37:02 PST
Comment on attachment 218857 [details]
Patch

OK
Comment 4 WebKit Commit Bot 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>
Comment 5 WebKit Commit Bot 2014-01-31 00:04:31 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Alexey Proskuryakov 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)
Comment 7 WebKit Commit Bot 2014-01-31 09:35:52 PST
Re-opened since this is blocked by bug 127997
Comment 8 László Langó 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)
Comment 9 Noam Rosenthal 2020-05-20 02:41:46 PDT
*** Bug 203589 has been marked as a duplicate of this bug. ***
Comment 10 Noam Rosenthal 2020-05-20 03:44:14 PDT
Created attachment 399826 [details]
Patch
Comment 11 Noam Rosenthal 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.
Comment 12 Noam Rosenthal 2020-05-20 04:07:17 PDT
*** Bug 109462 has been marked as a duplicate of this bug. ***
Comment 13 Noam Rosenthal 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.
Comment 14 EWS 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].
Comment 15 Radar WebKit Bug Importer 2020-05-20 09:06:18 PDT
<rdar://problem/63449424>