- Revision
- 133037
- Author
- [email protected]
- Date
- 2012-10-31 09:32:28 -0700 (Wed, 31 Oct 2012)
Log Message
Table with percentage column widths doesn't scale to fill the entire width of a table containing it
https://bugs.webkit.org/show_bug.cgi?id=11645
Patch by Arpita Bahuguna <[email protected]> on 2012-10-31
Reviewed by Julien Chaffraix.
Source/WebCore:
When the inner (or nested) table has auto width and column(s) with
percent width, we should scale our column(s) to the width of the
containing table (unless it has auto width).
Test: fast/table/scale-nested-percent-width-cols.html
* rendering/AutoTableLayout.cpp:
(WebCore::shouldScaleColumns):
If the containing table width was of percent type, we were disallowing
our inner or nested table's column from scaling to the size of the parent
table. We should prohibit the scaling of the nested table columns only
if the parent table has auto width.
LayoutTests:
* fast/table/scale-nested-percent-width-cols-expected.html: Added.
* fast/table/scale-nested-percent-width-cols.html: Added.
Added a ref test verifying that our nested (auto width) table's columns
are scaled and sized appropriately if the containing table has
percent width.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
Added an entry for fast/table/025.html for these ports. It would need
rebaselining as a result of this fix.
* platform/qt/fast/table/025-expected.png:
* platform/qt/fast/table/025-expected.txt:
Modified expected results for the existing test on qt port.
In the given test, our innermost nested table has auto width and consits
of three table cells with percent width specified for the first and the
third cells. Its containing table on the other hand is a percent width
table.
Previously, we were not scaling our inner table's column(s) from expanding
to the width of the containing table if it had percent width type. Because
of this our first and last table cells in the innermost table were being
rendered only with the minimum width (4px).
Post this fix, since now our inner table columns shall scale, the first and
the last table cell would thus expand in width (41px each) and hence the
change in the column and the table dimensions.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (133036 => 133037)
--- trunk/LayoutTests/ChangeLog 2012-10-31 15:53:52 UTC (rev 133036)
+++ trunk/LayoutTests/ChangeLog 2012-10-31 16:32:28 UTC (rev 133037)
@@ -1,3 +1,42 @@
+2012-10-31 Arpita Bahuguna <[email protected]>
+
+ Table with percentage column widths doesn't scale to fill the entire width of a table containing it
+ https://bugs.webkit.org/show_bug.cgi?id=11645
+
+ Reviewed by Julien Chaffraix.
+
+ * fast/table/scale-nested-percent-width-cols-expected.html: Added.
+ * fast/table/scale-nested-percent-width-cols.html: Added.
+ Added a ref test verifying that our nested (auto width) table's columns
+ are scaled and sized appropriately if the containing table has
+ percent width.
+
+ * platform/chromium/TestExpectations:
+ * platform/efl/TestExpectations:
+ * platform/gtk/TestExpectations:
+ * platform/mac/TestExpectations:
+ * platform/win/TestExpectations:
+ Added an entry for fast/table/025.html for these ports. It would need
+ rebaselining as a result of this fix.
+
+ * platform/qt/fast/table/025-expected.png:
+ * platform/qt/fast/table/025-expected.txt:
+ Modified expected results for the existing test on qt port.
+
+ In the given test, our innermost nested table has auto width and consits
+ of three table cells with percent width specified for the first and the
+ third cells. Its containing table on the other hand is a percent width
+ table.
+
+ Previously, we were not scaling our inner table's column(s) from expanding
+ to the width of the containing table if it had percent width type. Because
+ of this our first and last table cells in the innermost table were being
+ rendered only with the minimum width (4px).
+
+ Post this fix, since now our inner table columns shall scale, the first and
+ the last table cell would thus expand in width (41px each) and hence the
+ change in the column and the table dimensions.
+
2012-10-31 Raphael Kubo da Costa <[email protected]>
[EFL] More unreviewed pixel expectations gardening.
Added: trunk/LayoutTests/fast/table/scale-nested-percent-width-cols-expected.html (0 => 133037)
--- trunk/LayoutTests/fast/table/scale-nested-percent-width-cols-expected.html (rev 0)
+++ trunk/LayoutTests/fast/table/scale-nested-percent-width-cols-expected.html 2012-10-31 16:32:28 UTC (rev 133037)
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.yellow {
+ width: 800px;
+ background-color: yellow;
+}
+.red {
+ width: 794px;
+ background-color: red;
+ border-spacing: 0px;
+}
+.green {
+ width: 794px;
+ background-color: green;
+}
+</style>
+</head>
+<body>
+<p>Test for Bugzilla <a href="" 11645</a>: Table with percentage column widths doesn't scale to fill the entire width of a table containing it.</p>
+<p>When the inner table has auto width and the table column(s) have percent width, we should grow or scale our column(s) to the size of the containing table unless it has auto width.</p>
+<p>No red background color should be visible for the following two tables.</p>
+<table class="yellow">
+ <tr>
+ <td>
+ <table class="red">
+ <tr>
+ <td style="padding: 0px;">
+ <table class="green">
+ <tr>
+ <td style="width: 100px; background-color: white;">A</td>
+ <td style="width: 95%;">B</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+<table class="yellow">
+ <tr>
+ <td>
+ <table class="red">
+ <tr>
+ <td style="padding: 0px;">
+ <table class="green">
+ <tr>
+ <td style="width: 95%;">B</td>
+ <td style="width: 100px; background: white;">A</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+</body>
+</html>
+
Added: trunk/LayoutTests/fast/table/scale-nested-percent-width-cols.html (0 => 133037)
--- trunk/LayoutTests/fast/table/scale-nested-percent-width-cols.html (rev 0)
+++ trunk/LayoutTests/fast/table/scale-nested-percent-width-cols.html 2012-10-31 16:32:28 UTC (rev 133037)
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.yellow {
+ width: 800px;
+ background-color: yellow;
+}
+.red {
+ width: 100%;
+ background-color: red;
+ border-spacing: 0px;
+}
+.green {
+ background-color: green;
+}
+</style>
+</head>
+<body>
+<p>Test for Bugzilla <a href="" 11645</a>: Table with percentage column widths doesn't scale to fill the entire width of a table containing it.</p>
+<p>When the inner table has auto width and the table column(s) have percent width, we should grow or scale our column(s) to the size of the containing table unless it has auto width.</p>
+<p>No red background color should be visible for the following two tables.</p>
+<table class="yellow">
+ <tr>
+ <td>
+ <table class="red">
+ <tr>
+ <td style="padding: 0px;">
+ <table class="green">
+ <tr>
+ <td style="width: 100px; background-color: white;">A</td>
+ <td style="width: 95%;">B</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+<table class="yellow">
+ <tr>
+ <td>
+ <table class="red">
+ <tr>
+ <td style="padding: 0px;">
+ <table class="green">
+ <tr>
+ <td style="width: 95%;">B</td>
+ <td style="width: 100px; background-color: white;">A</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+</body>
+</html>
Modified: trunk/LayoutTests/platform/chromium/TestExpectations (133036 => 133037)
--- trunk/LayoutTests/platform/chromium/TestExpectations 2012-10-31 15:53:52 UTC (rev 133036)
+++ trunk/LayoutTests/platform/chromium/TestExpectations 2012-10-31 16:32:28 UTC (rev 133037)
@@ -4002,6 +4002,9 @@
webkit.org/b/98275 media/event-queue-crash.html [ Skip ]
+# Requires rebaselining after https://bugs.webkit.org/show_bug.cgi?id=11645
+webkit.org/b/11645 fast/table/025.html [ Failure ]
+
# These are real failues due to 95121.
# This is spilling caused by LANCZOS3 scaling algorithm that samples outside the source rect.
webkit.org/b/95121 fast/images/pixel-crack-image-background-webkit-transform-scale.html [ ImageOnlyFailure ]
Modified: trunk/LayoutTests/platform/efl/TestExpectations (133036 => 133037)
--- trunk/LayoutTests/platform/efl/TestExpectations 2012-10-31 15:53:52 UTC (rev 133036)
+++ trunk/LayoutTests/platform/efl/TestExpectations 2012-10-31 16:32:28 UTC (rev 133037)
@@ -1630,6 +1630,9 @@
Bug(EFL) editing/pasteboard/emacs-ctrl-a-k-y.html [ Missing ]
Bug(EFL) editing/pasteboard/emacs-ctrl-k-y-001.html [ Missing ]
+# Requires rebaselining after https://bugs.webkit.org/show_bug.cgi?id=11645
+webkit.org/b/11645 fast/table/025.html [ Failure ]
+
# Cairo 1.12.4 regressions
webkit.org/b/99189 fast/backgrounds/background-leakage-transforms.html [ ImageOnlyFailure ]
webkit.org/b/99189 fast/borders/borderRadiusAllStylesAllCorners.html [ ImageOnlyFailure ]
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (133036 => 133037)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2012-10-31 15:53:52 UTC (rev 133036)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2012-10-31 16:32:28 UTC (rev 133037)
@@ -1409,6 +1409,9 @@
webkit.org/b/98613 css3/masking/clip-path-reference-userSpaceOnUse.html [ ImageOnlyFailure ]
webkit.org/b/98613 css3/masking/clip-path-reference.html [ ImageOnlyFailure ]
+# Requires rebaselining after https://bugs.webkit.org/show_bug.cgi?id=11645
+webkit.org/b/11645 fast/table/025.html [ Failure ]
+
# New inspector/profiler/memory-instrumentation-canvas.html fails on JSC platforms
webkit.org/b/99001 inspector/profiler/memory-instrumentation-canvas.html
Modified: trunk/LayoutTests/platform/mac/TestExpectations (133036 => 133037)
--- trunk/LayoutTests/platform/mac/TestExpectations 2012-10-31 15:53:52 UTC (rev 133036)
+++ trunk/LayoutTests/platform/mac/TestExpectations 2012-10-31 16:32:28 UTC (rev 133037)
@@ -1318,6 +1318,9 @@
webkit.org/b/27684 compositing/text-on-scaled-layer.html [ ImageOnlyFailure ]
webkit.org/b/27684 compositing/text-on-scaled-surface.html [ ImageOnlyFailure ]
+# Requires rebaselining after https://bugs.webkit.org/show_bug.cgi?id=11645
+webkit.org/b/11645 fast/table/025.html [ Failure ]
+
# Asserts in MessagePort::contextDestroyed, but the assert usually gets attributed to later tests.
webkit.org/b/94458 fast/events/message-port-constructor-for-deleted-document.html
Modified: trunk/LayoutTests/platform/qt/fast/table/025-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/qt/fast/table/025-expected.txt (133036 => 133037)
--- trunk/LayoutTests/platform/qt/fast/table/025-expected.txt 2012-10-31 15:53:52 UTC (rev 133036)
+++ trunk/LayoutTests/platform/qt/fast/table/025-expected.txt 2012-10-31 16:32:28 UTC (rev 133037)
@@ -14,11 +14,11 @@
RenderTableSection {TBODY} at (0,0) size 332x35
RenderTableRow {TR} at (0,2) size 332x31
RenderTableCell {TD} at (2,2) size 328x31 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=0 rs=1 cs=1]
- RenderTable {TABLE} at (2,2) size 250x27
- RenderTableSection {TBODY} at (0,0) size 250x27
- RenderTableRow {TR} at (0,2) size 250x23
- RenderTableCell {TD} at (2,11) size 4x4 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=0 rs=1 cs=1]
- RenderTableCell {TD} at (8,2) size 234x23 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=2]
+ RenderTable {TABLE} at (2,2) size 324x27
+ RenderTableSection {TBODY} at (0,0) size 324x27
+ RenderTableRow {TR} at (0,2) size 324x23
+ RenderTableCell {TD} at (2,11) size 41x4 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (45,2) size 234x23 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=2]
RenderImage {IMG} at (2,2) size 21x15 [bgcolor=#800080]
RenderText {#text} at (23,2) size 4x19
text run at (23,2) width 4: " "
@@ -35,7 +35,7 @@
text run at (144,2) width 84: "White Pages"
RenderText {#text} at (228,2) size 4x19
text run at (228,2) width 4: " "
- RenderTableCell {TD} at (244,11) size 4x4 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=3 rs=1 cs=1]
+ RenderTableCell {TD} at (281,11) size 41x4 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=3 rs=1 cs=1]
RenderTableCell {TD} at (548,0) size 236x42 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=2 rs=1 cs=1]
RenderTable {TABLE} at (4,4) size 228x34
RenderTableSection {TBODY} at (0,0) size 228x34
@@ -59,11 +59,11 @@
RenderTableSection {TBODY} at (0,0) size 321x35
RenderTableRow {TR} at (0,2) size 321x31
RenderTableCell {TD} at (2,2) size 317x31 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=0 rs=1 cs=1]
- RenderTable {TABLE} at (2,2) size 250x27
- RenderTableSection {TBODY} at (0,0) size 250x27
- RenderTableRow {TR} at (0,2) size 250x23
- RenderTableCell {TD} at (2,11) size 4x4 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=0 rs=1 cs=1]
- RenderTableCell {TD} at (8,2) size 234x23 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=2]
+ RenderTable {TABLE} at (2,2) size 313x27
+ RenderTableSection {TBODY} at (0,0) size 313x27
+ RenderTableRow {TR} at (0,2) size 313x23
+ RenderTableCell {TD} at (2,11) size 35x4 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=0 rs=1 cs=1]
+ RenderTableCell {TD} at (39,2) size 234x23 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=2]
RenderImage {IMG} at (2,2) size 21x15 [bgcolor=#800080]
RenderText {#text} at (23,2) size 4x19
text run at (23,2) width 4: " "
@@ -80,7 +80,7 @@
text run at (144,2) width 84: "White Pages"
RenderText {#text} at (228,2) size 4x19
text run at (228,2) width 4: " "
- RenderTableCell {TD} at (244,11) size 4x4 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=3 rs=1 cs=1]
+ RenderTableCell {TD} at (275,11) size 36x4 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=3 rs=1 cs=1]
RenderTableCell {TD} at (548,0) size 236x42 [bgcolor=#FFA500] [border: (1px solid #000000)] [r=0 c=2 rs=1 cs=1]
RenderTable {TABLE} at (4,4) size 228x34
RenderTableSection {TBODY} at (0,0) size 228x34
Modified: trunk/LayoutTests/platform/win/TestExpectations (133036 => 133037)
--- trunk/LayoutTests/platform/win/TestExpectations 2012-10-31 15:53:52 UTC (rev 133036)
+++ trunk/LayoutTests/platform/win/TestExpectations 2012-10-31 16:32:28 UTC (rev 133037)
@@ -2357,6 +2357,9 @@
# https://bugs.webkit.org/show_bug.cgi?id=98169
http/tests/inspector/stacktraces
+# Requires rebaselining after https://bugs.webkit.org/show_bug.cgi?id=11645
+webkit.org/b/11645 fast/table/025.html [ Failure ]
+
# HIDDEN_PAGE_DOM_TIMER_THROTTLING is disabled
fast/dom/timer-throttling-hidden-page.html
Modified: trunk/Source/WebCore/ChangeLog (133036 => 133037)
--- trunk/Source/WebCore/ChangeLog 2012-10-31 15:53:52 UTC (rev 133036)
+++ trunk/Source/WebCore/ChangeLog 2012-10-31 16:32:28 UTC (rev 133037)
@@ -1,3 +1,23 @@
+2012-10-31 Arpita Bahuguna <[email protected]>
+
+ Table with percentage column widths doesn't scale to fill the entire width of a table containing it
+ https://bugs.webkit.org/show_bug.cgi?id=11645
+
+ Reviewed by Julien Chaffraix.
+
+ When the inner (or nested) table has auto width and column(s) with
+ percent width, we should scale our column(s) to the width of the
+ containing table (unless it has auto width).
+
+ Test: fast/table/scale-nested-percent-width-cols.html
+
+ * rendering/AutoTableLayout.cpp:
+ (WebCore::shouldScaleColumns):
+ If the containing table width was of percent type, we were disallowing
+ our inner or nested table's column from scaling to the size of the parent
+ table. We should prohibit the scaling of the nested table columns only
+ if the parent table has auto width.
+
2012-10-31 Ian Vollick <[email protected]>
Add support for text-based repaint testing
Modified: trunk/Source/WebCore/rendering/AutoTableLayout.cpp (133036 => 133037)
--- trunk/Source/WebCore/rendering/AutoTableLayout.cpp 2012-10-31 15:53:52 UTC (rev 133036)
+++ trunk/Source/WebCore/rendering/AutoTableLayout.cpp 2012-10-31 16:32:28 UTC (rev 133037)
@@ -196,15 +196,11 @@
table = 0;
if (cb && cb->isTableCell() &&
(cb->style()->width().isAuto() || cb->style()->width().isPercent())) {
- if (tw.isPercent())
+ RenderTableCell* cell = toRenderTableCell(cb);
+ if (cell->colSpan() > 1 || cell->table()->style()->width().isAuto())
scale = false;
- else {
- RenderTableCell* cell = toRenderTableCell(cb);
- if (cell->colSpan() > 1 || cell->table()->style()->width().isAuto())
- scale = false;
- else
- table = cell->table();
- }
+ else
+ table = cell->table();
}
}
else