Tables without any descendant and auto logical width should have a 0px logical width
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Sep 2012 17:51:22 +0000 (17:51 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Sep 2012 17:51:22 +0000 (17:51 +0000)
commite1c6e1ccabf261885d0141e639efd5851ddfbd61
tree90bba56c1b6a49556d65788ee258666ca44b9d0f
parentd2606c62d32db60ec5045c7ca1a04ae4065b240a
Tables without any descendant and auto logical width should have a 0px logical width
https://bugs.webkit.org/show_bug.cgi?id=95521

Reviewed by Abhishek Arya.

Source/WebCore:

The code would wrongly add the border-spacing in the row direction to the table's logical
width even if we didn't have a column. The new behavior matches FireFox and Opera. IE
matches our old behavior for inline tables but our new behavior for normal tables which
is a bug on their side.

Tests: fast/table/empty-table-should-take-no-space.html
       fast/table/fixed-table-layout/empty-table-should-take-no-space-fixed-layout.html

* rendering/RenderTable.h:
(WebCore::RenderTable::borderSpacingInRowDirection):
Added this new helper function to return the right border-spacing. Added a FIXME as the code always
return the horizontal dimension which is wrong in vertical-writing mode.

(WebCore::RenderTable::bordersPaddingAndSpacingInRowDirection):
Changed to call borderSpacingInRowDirection. Added a comment as to why we don't add border-spacing on
border-collapse: separate tables.

LayoutTests:

* fast/table/empty-table-should-take-no-space-expected.html: Added.
* fast/table/empty-table-should-take-no-space.html: Added.
* fast/table/fixed-table-layout/empty-table-should-take-no-space-fixed-layout-expected.html: Added.
* fast/table/fixed-table-layout/empty-table-should-take-no-space-fixed-layout.html: Added.
2 new tests to check that empty tables have 0px logical width.

* platform/chromium-linux/tables/mozilla/bugs/bug56563-expected.png:
* platform/chromium-win/tables/mozilla/bugs/bug56563-expected.txt:
* platform/mac/tables/mozilla/bugs/bug56563-expected.txt:
* platform/qt/tables/mozilla/bugs/bug56563-expected.txt:
* tables/mozilla/bugs/bug56563-expected.txt:
Progression. The table now is 2px wide as it has a 1px right & left border.

* platform/chromium-linux/fast/invalid/residual-style-expected.txt:
Progression. The changes are due to the tables shrinking which is expected.

* platform/chromium-linux/fast/forms/file/file-input-disabled-expected.txt:
* platform/chromium-mac/fast/forms/file/file-input-disabled-expected.txt:
* platform/chromium-mac/tables/mozilla/bugs/bug113235-2-expected.txt:
* platform/chromium-win-xp/fast/forms/file-input-disabled-expected.txt:
* platform/chromium-win/fast/forms/file/file-input-disabled-expected.txt:
* platform/chromium-win/fast/invalid/017-expected.txt:
* platform/chromium-win/fast/invalid/018-expected.txt:
* platform/chromium-win/fast/invalid/020-expected.txt:
* platform/chromium-win/fast/invalid/table-inside-stray-table-content-expected.txt:
* platform/chromium-win/tables/mozilla/bugs/bug113235-2-expected.txt:
* platform/chromium-win/tables/mozilla/bugs/bug23994-expected.txt:
* platform/chromium-win/tables/mozilla/bugs/bug56405-expected.txt:
* platform/efl/fast/forms/file/file-input-disabled-expected.txt:
* platform/efl/fast/invalid/017-expected.txt:
* platform/efl/fast/invalid/018-expected.txt:
* platform/efl/fast/invalid/020-expected.txt:
* platform/efl/fast/invalid/table-inside-stray-table-content-expected.txt:
* platform/efl/fast/invalid/table-residual-style-crash-expected.txt:
* platform/efl/tables/mozilla/bugs/bug23994-expected.txt:
* platform/efl/tables/mozilla/bugs/bug56405-expected.txt:
* platform/gtk/fast/forms/file/file-input-disabled-expected.txt:
* platform/gtk/fast/invalid/017-expected.txt:
* platform/gtk/fast/invalid/018-expected.txt:
* platform/gtk/fast/invalid/020-expected.txt:
* platform/gtk/fast/invalid/table-inside-stray-table-content-expected.txt:
* platform/gtk/fast/invalid/table-residual-style-crash-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug23994-expected.txt:
* platform/gtk/tables/mozilla/bugs/bug56405-expected.txt:
* platform/mac/fast/forms/file/file-input-disabled-expected.txt:
* platform/mac/fast/invalid/017-expected.txt:
* platform/mac/fast/invalid/018-expected.txt:
* platform/mac/fast/invalid/020-expected.txt:
* platform/mac/fast/invalid/table-inside-stray-table-content-expected.txt:
* platform/mac/fast/invalid/table-residual-style-crash-expected.txt:
* platform/mac/tables/mozilla/bugs/bug113235-2-expected.txt:
* platform/mac/tables/mozilla/bugs/bug23994-expected.txt:
* platform/mac/tables/mozilla/bugs/bug56405-expected.txt:
* platform/qt/fast/forms/file/file-input-disabled-expected.txt:
* platform/qt/fast/invalid/017-expected.txt:
* platform/qt/fast/invalid/018-expected.txt:
* platform/qt/fast/invalid/020-expected.txt:
* platform/qt/fast/invalid/table-inside-stray-table-content-expected.txt:
* platform/qt/fast/invalid/table-residual-style-crash-expected.txt:
* platform/qt/tables/mozilla/bugs/bug113235-2-expected.txt:
* platform/qt/tables/mozilla/bugs/bug23994-expected.txt:
* platform/qt/tables/mozilla/bugs/bug56405-expected.txt:
* platform/win/fast/forms/file-input-disabled-expected.txt:
* platform/win/fast/forms/file/file-input-disabled-expected.txt:
* tables/mozilla/bugs/bug113235-2-expected.txt:
Progression. The tables now have a 0px logical width. In some cases, we add the border-spacing in the
block-flow direction if we have a row. This is not consistently handled by browsers and not very well
defined in CSS.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
62 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/table/empty-table-should-take-no-space-expected.html [new file with mode: 0755]
LayoutTests/fast/table/empty-table-should-take-no-space.html [new file with mode: 0755]
LayoutTests/fast/table/fixed-table-layout/empty-table-should-take-no-space-fixed-layout-expected.html [new file with mode: 0755]
LayoutTests/fast/table/fixed-table-layout/empty-table-should-take-no-space-fixed-layout.html [new file with mode: 0755]
LayoutTests/platform/chromium-linux/fast/forms/file/file-input-disabled-expected.txt
LayoutTests/platform/chromium-linux/fast/invalid/residual-style-expected.txt
LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug56563-expected.png
LayoutTests/platform/chromium-mac/fast/forms/file/file-input-disabled-expected.txt
LayoutTests/platform/chromium-mac/tables/mozilla/bugs/bug113235-2-expected.txt
LayoutTests/platform/chromium-win-xp/fast/forms/file-input-disabled-expected.txt
LayoutTests/platform/chromium-win/fast/forms/file/file-input-disabled-expected.txt
LayoutTests/platform/chromium-win/fast/invalid/017-expected.txt
LayoutTests/platform/chromium-win/fast/invalid/018-expected.txt
LayoutTests/platform/chromium-win/fast/invalid/020-expected.txt
LayoutTests/platform/chromium-win/fast/invalid/table-inside-stray-table-content-expected.txt
LayoutTests/platform/chromium-win/tables/mozilla/bugs/bug113235-2-expected.txt
LayoutTests/platform/chromium-win/tables/mozilla/bugs/bug23994-expected.txt
LayoutTests/platform/chromium-win/tables/mozilla/bugs/bug56405-expected.txt
LayoutTests/platform/chromium-win/tables/mozilla/bugs/bug56563-expected.txt
LayoutTests/platform/efl/fast/forms/file/file-input-disabled-expected.txt
LayoutTests/platform/efl/fast/invalid/017-expected.txt
LayoutTests/platform/efl/fast/invalid/018-expected.txt
LayoutTests/platform/efl/fast/invalid/020-expected.txt
LayoutTests/platform/efl/fast/invalid/table-inside-stray-table-content-expected.txt
LayoutTests/platform/efl/fast/invalid/table-residual-style-crash-expected.txt
LayoutTests/platform/efl/tables/mozilla/bugs/bug23994-expected.txt
LayoutTests/platform/efl/tables/mozilla/bugs/bug56405-expected.txt
LayoutTests/platform/gtk/fast/forms/file/file-input-disabled-expected.txt
LayoutTests/platform/gtk/fast/invalid/017-expected.txt
LayoutTests/platform/gtk/fast/invalid/018-expected.txt
LayoutTests/platform/gtk/fast/invalid/020-expected.txt
LayoutTests/platform/gtk/fast/invalid/table-inside-stray-table-content-expected.txt
LayoutTests/platform/gtk/fast/invalid/table-residual-style-crash-expected.txt
LayoutTests/platform/gtk/tables/mozilla/bugs/bug23994-expected.txt
LayoutTests/platform/gtk/tables/mozilla/bugs/bug56405-expected.txt
LayoutTests/platform/mac/fast/forms/file/file-input-disabled-expected.txt
LayoutTests/platform/mac/fast/invalid/017-expected.txt
LayoutTests/platform/mac/fast/invalid/018-expected.txt
LayoutTests/platform/mac/fast/invalid/020-expected.txt
LayoutTests/platform/mac/fast/invalid/table-inside-stray-table-content-expected.txt
LayoutTests/platform/mac/fast/invalid/table-residual-style-crash-expected.txt
LayoutTests/platform/mac/tables/mozilla/bugs/bug113235-2-expected.txt
LayoutTests/platform/mac/tables/mozilla/bugs/bug23994-expected.txt
LayoutTests/platform/mac/tables/mozilla/bugs/bug56405-expected.txt
LayoutTests/platform/mac/tables/mozilla/bugs/bug56563-expected.txt
LayoutTests/platform/qt/fast/forms/file/file-input-disabled-expected.txt
LayoutTests/platform/qt/fast/invalid/017-expected.txt
LayoutTests/platform/qt/fast/invalid/018-expected.txt
LayoutTests/platform/qt/fast/invalid/020-expected.txt
LayoutTests/platform/qt/fast/invalid/table-inside-stray-table-content-expected.txt
LayoutTests/platform/qt/fast/invalid/table-residual-style-crash-expected.txt
LayoutTests/platform/qt/tables/mozilla/bugs/bug113235-2-expected.txt
LayoutTests/platform/qt/tables/mozilla/bugs/bug23994-expected.txt
LayoutTests/platform/qt/tables/mozilla/bugs/bug56405-expected.txt
LayoutTests/platform/qt/tables/mozilla/bugs/bug56563-expected.txt
LayoutTests/platform/win/fast/forms/file-input-disabled-expected.txt
LayoutTests/platform/win/fast/forms/file/file-input-disabled-expected.txt
LayoutTests/tables/mozilla/bugs/bug113235-2-expected.txt
LayoutTests/tables/mozilla/bugs/bug56563-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTable.h