Fix table sizing when 'max-width' is used.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Jan 2014 08:09:07 +0000 (08:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Jan 2014 08:09:07 +0000 (08:09 +0000)
commit8bde0835dc513e622c11baf3b74236334db2c75e
tree10f94325abf02050a1bc9d0b7e9d2439cdcc91c4
parentf60310ae4b07bf7887f5e1d2c32cb972fab600fc
Fix table sizing when 'max-width' is used.
https://bugs.webkit.org/show_bug.cgi?id=115156

Patch by László Langó <lango@inf.u-szeged.hu> on 2014-01-31
Reviewed by Andreas Kling.

Source/WebCore:

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.

Backported from Blink:
https://chromium.googlesource.com/chromium/blink/+/0bca0dec4895aeeb2054ba36316e984e4ebed06f

Test: fast/table/html-table-width-max-width-constrained.html

* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateLogicalWidth):
(WebCore::RenderTable::computePreferredLogicalWidths):

LayoutTests:

* fast/table/css-table-max-width-expected.txt:
* fast/table/css-table-max-width.html:
* fast/table/html-table-width-max-width-constrained-expected.txt: Added.
* fast/table/html-table-width-max-width-constrained.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/table/css-table-max-width-expected.txt
LayoutTests/fast/table/css-table-max-width.html
LayoutTests/fast/table/html-table-width-max-width-constrained-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/html-table-width-max-width-constrained.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTable.cpp