Title: [134017] trunk
- Revision
- 134017
- Author
- commit-qu...@webkit.org
- Date
- 2012-11-08 23:03:41 -0800 (Thu, 08 Nov 2012)
Log Message
table not aligned in center column and seems shrunk because of float:right (table-layout: fixed and width: 100%)
https://bugs.webkit.org/show_bug.cgi?id=18153
Patch by Arpita Bahuguna <arpitabahug...@gmail.com> on 2012-11-08
Reviewed by Beth Dakin.
Source/WebCore:
Preferred logical width is computed incorrectly for fixed layout tables
with 100% percent width, in standards mode.
According to our fixed table layout algorithm (CSS2 specification - 17.5.2.1)
the ultimate width of the table is the greater of the value of the
'width' property for the table elements and the sum of the column
widths.
For our specific scenario we have a fixed layout table with 100% width
consisting of columns with fixed widths, the sum of which is less than
the specified width of the table (i.e. 100% of the containing block).
Even then the applied width is the cummulative of the width of the
columns.
This happens because of the quirks mode check added in
FixedTableLayout::computePreferredLogicalWidths(), which prohibits the
setting of maxWidth to our fixed layout table with percent width, and
which perhaps is not required anymore.
Test: fast/table/fixed-table-layout/table-with-percent-width.html
* rendering/FixedTableLayout.cpp:
(WebCore::FixedTableLayout::computePreferredLogicalWidths):
Removed the quirks mode check.
LayoutTests:
* fast/table/fixed-table-layout/table-with-percent-width-expected.txt: Added.
* fast/table/fixed-table-layout/table-with-percent-width.html: Added.
Test added to verify the width of the fixed layout tables with 100%
width, in standards mode.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (134016 => 134017)
--- trunk/LayoutTests/ChangeLog 2012-11-09 06:54:16 UTC (rev 134016)
+++ trunk/LayoutTests/ChangeLog 2012-11-09 07:03:41 UTC (rev 134017)
@@ -1,3 +1,15 @@
+2012-11-08 Arpita Bahuguna <arpitabahug...@gmail.com>
+
+ table not aligned in center column and seems shrunk because of float:right (table-layout: fixed and width: 100%)
+ https://bugs.webkit.org/show_bug.cgi?id=18153
+
+ Reviewed by Beth Dakin.
+
+ * fast/table/fixed-table-layout/table-with-percent-width-expected.txt: Added.
+ * fast/table/fixed-table-layout/table-with-percent-width.html: Added.
+ Test added to verify the width of the fixed layout tables with 100%
+ width, in standards mode.
+
2012-11-08 Noel Gordon <noel.gor...@gmail.com>
[chromium] Unreviewed test expectations update.
Added: trunk/LayoutTests/fast/table/fixed-table-layout/table-with-percent-width-expected.txt (0 => 134017)
--- trunk/LayoutTests/fast/table/fixed-table-layout/table-with-percent-width-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/table/fixed-table-layout/table-with-percent-width-expected.txt 2012-11-09 07:03:41 UTC (rev 134017)
@@ -0,0 +1,7 @@
+Test for Bugzilla bug: 18153 table not aligned in center column and seems shrunk because of float:right (table-layout: fixed and width: 100%).
+The following fixed layout tables, with 100% percent widths, should expand to the full length of their containing blocks.
+
+PASS
+PASS
+ PASS
+PASS
Added: trunk/LayoutTests/fast/table/fixed-table-layout/table-with-percent-width.html (0 => 134017)
--- trunk/LayoutTests/fast/table/fixed-table-layout/table-with-percent-width.html (rev 0)
+++ trunk/LayoutTests/fast/table/fixed-table-layout/table-with-percent-width.html 2012-11-09 07:03:41 UTC (rev 134017)
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+function test()
+{
+ checkLayout('#table1');
+ checkLayout('#table2');
+ checkLayout('#table3');
+ checkLayout('#table4');
+}
+</script>
+<style>
+td {
+ height: 20px;
+ padding: 0px;
+}
+table { border-spacing: 0px; }
+#table1, #table3 {
+ width: 100%;
+ table-layout: fixed;
+ border: 1px solid black;
+}
+#table2, #table4 {
+ width: 50%;
+ table-layout: fixed;
+ border: 1px solid black;
+}
+body {
+ max-width: 600px;
+}
+</style>
+</head>
+<body _onload_="test()">
+<div>Test for Bugzilla bug:<a href="" 18153</a> table not aligned in center column and seems shrunk because of float:right (table-layout: fixed and width: 100%).</div>
+<p>The following fixed layout tables, with 100% percent widths, should expand to the full length of their containing blocks.</p>
+<div style="display: inline-block">
+ <table id="table1" data-expected-width="600">
+ <tr>
+ <td style="width:100px;"></td>
+ <td style="width:80px;"></td>
+ <td style="width:120px;"></td>
+ <td style="width:150px;"></td>
+ </tr>
+ </table>
+ <table id="table2" data-expected-width="452">
+ <tr>
+ <td style="width:100px;"></td>
+ <td style="width:80px;"></td>
+ <td style="width:120px;"></td>
+ <td style="width:150px;"></td>
+ </tr>
+ </table>
+</div>
+
+<table><tr><td>
+ <table><tr><td>
+ <table id="table3" data-expected-width="600">
+ <tr><td></td></tr>
+ </table>
+ </td></tr></table>
+</td></tr></table>
+<table><tr><td>
+ <table><tr><td>
+ <table id="table4" data-expected-width="300">
+ <tr><td></td></tr>
+ </table>
+ </td></tr></table>
+</td></tr></table>
+</body>
+</html>
+
Modified: trunk/Source/WebCore/ChangeLog (134016 => 134017)
--- trunk/Source/WebCore/ChangeLog 2012-11-09 06:54:16 UTC (rev 134016)
+++ trunk/Source/WebCore/ChangeLog 2012-11-09 07:03:41 UTC (rev 134017)
@@ -1,3 +1,35 @@
+2012-11-08 Arpita Bahuguna <arpitabahug...@gmail.com>
+
+ table not aligned in center column and seems shrunk because of float:right (table-layout: fixed and width: 100%)
+ https://bugs.webkit.org/show_bug.cgi?id=18153
+
+ Reviewed by Beth Dakin.
+
+ Preferred logical width is computed incorrectly for fixed layout tables
+ with 100% percent width, in standards mode.
+
+ According to our fixed table layout algorithm (CSS2 specification - 17.5.2.1)
+ the ultimate width of the table is the greater of the value of the
+ 'width' property for the table elements and the sum of the column
+ widths.
+
+ For our specific scenario we have a fixed layout table with 100% width
+ consisting of columns with fixed widths, the sum of which is less than
+ the specified width of the table (i.e. 100% of the containing block).
+ Even then the applied width is the cummulative of the width of the
+ columns.
+
+ This happens because of the quirks mode check added in
+ FixedTableLayout::computePreferredLogicalWidths(), which prohibits the
+ setting of maxWidth to our fixed layout table with percent width, and
+ which perhaps is not required anymore.
+
+ Test: fast/table/fixed-table-layout/table-with-percent-width.html
+
+ * rendering/FixedTableLayout.cpp:
+ (WebCore::FixedTableLayout::computePreferredLogicalWidths):
+ Removed the quirks mode check.
+
2012-11-08 Sheriff Bot <webkit.review....@gmail.com>
Unreviewed, rolling out r134004.
Modified: trunk/Source/WebCore/rendering/FixedTableLayout.cpp (134016 => 134017)
--- trunk/Source/WebCore/rendering/FixedTableLayout.cpp 2012-11-09 06:54:16 UTC (rev 134016)
+++ trunk/Source/WebCore/rendering/FixedTableLayout.cpp 2012-11-09 07:03:41 UTC (rev 134017)
@@ -199,7 +199,7 @@
// In this example, the two inner tables should be as large as the outer table.
// We can achieve this effect by making the maxwidth of fixed tables with percentage
// widths be infinite.
- if (m_table->document()->inQuirksMode() && m_table->style()->logicalWidth().isPercent() && maxWidth < tableMaxWidth)
+ if (m_table->style()->logicalWidth().isPercent() && maxWidth < tableMaxWidth)
maxWidth = tableMaxWidth;
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes