REGRESSION(r111742): box-sizing: border-box doesn't work on fixed table layout
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2012 19:30:43 +0000 (19:30 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 May 2012 19:30:43 +0000 (19:30 +0000)
commitd6debfca5065e0a1de8e0e002530e45e116ef932
treef168cea42950cd74783d442a8f8c6cd2f2b42c35
parent69e3e60f9c117bd078a5d63e35eee1c53878191e
REGRESSION(r111742): box-sizing: border-box doesn't work on fixed table layout
https://bugs.webkit.org/show_bug.cgi?id=87536

Reviewed by Tony Chang.

Source/WebCore:

Tests: fast/table/fixed-table-layout/cell-box-sizing-fixed-table-layout.html
       fast/table/fixed-table-layout/column-box-sizing-fixed-table-layout.html
       fast/table/fixed-table-layout/column-group-box-sizing-fixed-table-layout.html
       fast/table/fixed-table-layout/column-in-column-group-box-sizing-fixed-table-layout.html

The change in r111742 completely ignored border-sizing (following the table's code lead unfortunately).
The issue is that we would count the borders and paddings twice for the border-box case which would lead
to the content-box including them too. From a web-author, this behavior is equivalent to ignoring box-sizing.

* rendering/FixedTableLayout.cpp:
(WebCore::FixedTableLayout::calcWidthArray):
Reworked the function to properly use computeBorderBoxLogicalWidth() for correctness. This matches
what RenderBox and the rendering code does generally. Also refactored the code to avoid the need
for local variables and make it more readable.

LayoutTests:

* fast/table/fixed-table-layout/cell-box-sizing-fixed-table-layout-expected.html: Added.
* fast/table/fixed-table-layout/cell-box-sizing-fixed-table-layout.html: Added.
This test covers the regression.

* fast/table/fixed-table-layout/column-box-sizing-fixed-table-layout-expected.html: Added.
* fast/table/fixed-table-layout/column-box-sizing-fixed-table-layout.html: Added.
* fast/table/fixed-table-layout/column-group-box-sizing-fixed-table-layout-expected.html: Added.
* fast/table/fixed-table-layout/column-group-box-sizing-fixed-table-layout.html: Added.
* fast/table/fixed-table-layout/column-in-column-group-box-sizing-fixed-table-layout-expected.html: Added.
* fast/table/fixed-table-layout/column-in-column-group-box-sizing-fixed-table-layout.html: Added.
Those test ensured I didn't regress and document our current behavior ie that column and column group fixed
width apply to the cell's border-box.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/table/fixed-table-layout/cell-box-sizing-fixed-table-layout-expected.html [new file with mode: 0644]
LayoutTests/fast/table/fixed-table-layout/cell-box-sizing-fixed-table-layout.html [new file with mode: 0644]
LayoutTests/fast/table/fixed-table-layout/column-box-sizing-fixed-table-layout-expected.html [new file with mode: 0644]
LayoutTests/fast/table/fixed-table-layout/column-box-sizing-fixed-table-layout.html [new file with mode: 0644]
LayoutTests/fast/table/fixed-table-layout/column-group-box-sizing-fixed-table-layout-expected.html [new file with mode: 0644]
LayoutTests/fast/table/fixed-table-layout/column-group-box-sizing-fixed-table-layout.html [new file with mode: 0644]
LayoutTests/fast/table/fixed-table-layout/column-in-column-group-box-sizing-fixed-table-layout-expected.html [new file with mode: 0644]
LayoutTests/fast/table/fixed-table-layout/column-in-column-group-box-sizing-fixed-table-layout.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/FixedTableLayout.cpp