diff options
author | commit-queue@webkit.org <commit-queue@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2012-02-01 19:38:23 +0000 |
---|---|---|
committer | commit-queue@webkit.org <commit-queue@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2012-02-01 19:38:23 +0000 |
commit | d54bb432e82f1d42c1bf814663ba9d49e69a293e (patch) | |
tree | 8e6dc87bcde9d33a65c757227bf094580a2be828 /third_party/WebKit/LayoutTests/fast/table/script-tests/min-width-css-inline-table.js | |
parent | b09ae09ccb8e4d4e35f86144dca9144c679f4399 (diff) | |
download | chromium_src-d54bb432e82f1d42c1bf814663ba9d49e69a293e.zip chromium_src-d54bb432e82f1d42c1bf814663ba9d49e69a293e.tar.gz chromium_src-d54bb432e82f1d42c1bf814663ba9d49e69a293e.tar.bz2 |
Source/WebCore: Add support for fixed and percent min-width on the table element for table-layout: auto to
match Firefox and Opera's behavior.
In FixedTableLayout.cpp, the computePreferredLogicalWidths method looks like it has
issues based on the comment: "FIXME: This entire calculation is incorrect for both
minwidth and maxwidth." (minwidth and maxwidth refer to the preferred widths, not the
min-width and max-width styles). I have not implemented min-width for FixedTableLayout
in this patch since it requires some more research around that comment.
min-width and max-width on the table element was discussed on the www-style list:
http://lists.w3.org/Archives/Public/www-style/2012Jan/0684.html
min-width is not implemented on <table> for table-layout: auto
https://bugs.webkit.org/show_bug.cgi?id=76553
Patch by Max Vujovic <mvujovic@adobe.com> on 2012-02-01
Reviewed by Julien Chaffraix.
Test: fast/table/min-width.html
* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::computePreferredLogicalWidths):
If the min or max preferred logical width is less than a fixed min width style, it is
set to the fixed min width style. Like a percent width style, a percent min-width style
does not affect the min or max preferred logical widths computed by the table layout
algorithm. RenderTable's computeLogicalWidth method handles percent min-width styles.
min-width for the table-layout: fixed case has been split out into this bug:
https://bugs.webkit.org/show_bug.cgi?id=76948
* rendering/RenderTable.cpp:
(WebCore::RenderTable::computeLogicalWidth):
If the RenderStyle's logical min width is defined and greater than the logical width
calculation, this method sets the logical width to the logical min width.
(WebCore::RenderTable::convertStyleWidthToComputedWidth):
This new method generalizes and factors out logic from RenderTable::computeLogicalWidth
that converted the width style to a computed value in the fixed and percent case.
RenderTable::computeLogicalWidth now calls this method to determine the computed values
for both the width style and the min-width style. In the future, it can also be used for
the max-width style.
Note that this method handles the special CSS table case, which requires borders and
paddings to be included in the computed width calculation. This applies to all width
styles, including width, min-width, and max-width. Before, this special case was handled
in RenderTable::computeLogicalWidth.
* rendering/RenderTable.h:
LayoutTests: Add support for min-width on the table element.
min-width is not implemented on <table> for table-layout: auto
https://bugs.webkit.org/show_bug.cgi?id=76553
Patch by Max Vujovic <mvujovic@adobe.com> on 2012-02-01
Reviewed by Julien Chaffraix.
* fast/table/min-width-css-block-table.html: Added.
* fast/table/min-width-css-block-table-expected.txt: Added.
* fast/table/min-width-css-inline-table.html: Added.
* fast/table/min-width-css-inline-table-expected.txt: Added.
* fast/table/min-width-html-block-table.html: Added.
* fast/table/min-width-html-block-table-expected.txt: Added.
* fast/table/min-width-html-inline-table.html: Added.
* fast/table/min-width-html-inline-table-expected.txt: Added.
* fast/table/script-tests/min-width-css-block-table.js: Added.
(computeLogicalWidth):
* fast/table/script-tests/min-width-css-inline-table.js: Added.
(computeLogicalWidth):
* fast/table/script-tests/min-width-helpers.js: Added.
(runTests):
(createTableStyle):
(computeLogicalWidthHelper):
(createSpan):
* fast/table/script-tests/min-width-html-block-table.js: Added.
(computeLogicalWidth):
* fast/table/script-tests/min-width-html-inline-table.js: Added.
(computeLogicalWidth):
git-svn-id: svn://svn.chromium.org/blink/trunk@106479 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/table/script-tests/min-width-css-inline-table.js')
-rw-r--r-- | third_party/WebKit/LayoutTests/fast/table/script-tests/min-width-css-inline-table.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/table/script-tests/min-width-css-inline-table.js b/third_party/WebKit/LayoutTests/fast/table/script-tests/min-width-css-inline-table.js new file mode 100644 index 0000000..f3c3cf2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/table/script-tests/min-width-css-inline-table.js @@ -0,0 +1,10 @@ +description("This test checks that the min-width style is applied to inline CSS tables."); + +// Requires min-width-helpers.js. + +function computeLogicalWidth(writingMode, direction, tableStyle) +{ + return computeLogicalWidthHelper("css", "inline", writingMode, direction, tableStyle); +} + +runTests("css");
\ No newline at end of file |