Title: [105775] trunk
Revision
105775
Author
[email protected]
Date
2012-01-24 12:32:37 -0800 (Tue, 24 Jan 2012)

Log Message

REGRESSION (r102040): Wrong column widths when row has colspan and unwrappable text
https://bugs.webkit.org/show_bug.cgi?id=74874

Reviewed by Julien Chaffraix.

Source/WebCore:

Tests: fast/css/min-width-with-spanned-cell-fixed.html
       fast/css/min-width-with-spanned-cell.html

A cell with unwrappable text must be as wide as the text is long. If it is a colspan in a table whose
columns are all percent and the width of the span cell is wider than the cells it spans in any other
row then it will squeeze those cells beyond the width required to display their contents.

To fix this ensure that the squeezing of cells within a span respects the minimum width determined by
their contents. The squeezing remains for fixed layout tables as per FF and Opera.

* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::calcEffectiveLogicalWidth):

LayoutTests:

* fast/css/min-width-with-spanned-cell-expected.png: Added.
* fast/css/min-width-with-spanned-cell-expected.txt: Added.
* fast/css/min-width-with-spanned-cell-fixed-expected.png: Added.
* fast/css/min-width-with-spanned-cell-fixed-expected.txt: Added.
* fast/css/min-width-with-spanned-cell-fixed.html: Added.
* fast/css/min-width-with-spanned-cell.html: Added.
* platform/chromium-linux/fast/table/027-expected.png:
   1 px difference - benign
* platform/chromium-linux/fast/table/027-vertical-expected.png:
   This is a progression - previously the image in the last cell was
   extruding from the table in a 800x600 view.
* platform/chromium-win/fast/table/027-expected.txt:
* platform/chromium-win/fast/table/027-vertical-expected.txt:
* platform/mac/test_expectations.txt: Suppress 027* tests for rebaseline.
* platform/win/test_expectations.txt: ditto
   The 2 tests are skipped on gtk and qt.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (105774 => 105775)


--- trunk/LayoutTests/ChangeLog	2012-01-24 20:29:44 UTC (rev 105774)
+++ trunk/LayoutTests/ChangeLog	2012-01-24 20:32:37 UTC (rev 105775)
@@ -1,3 +1,27 @@
+2012-01-16  Robert Hogan  <[email protected]>
+
+        REGRESSION (r102040): Wrong column widths when row has colspan and unwrappable text
+        https://bugs.webkit.org/show_bug.cgi?id=74874
+
+        Reviewed by Julien Chaffraix.
+
+        * fast/css/min-width-with-spanned-cell-expected.png: Added.
+        * fast/css/min-width-with-spanned-cell-expected.txt: Added.
+        * fast/css/min-width-with-spanned-cell-fixed-expected.png: Added.
+        * fast/css/min-width-with-spanned-cell-fixed-expected.txt: Added.
+        * fast/css/min-width-with-spanned-cell-fixed.html: Added.
+        * fast/css/min-width-with-spanned-cell.html: Added.
+        * platform/chromium-linux/fast/table/027-expected.png:
+           1 px difference - benign
+        * platform/chromium-linux/fast/table/027-vertical-expected.png:
+           This is a progression - previously the image in the last cell was
+           extruding from the table in a 800x600 view.
+        * platform/chromium-win/fast/table/027-expected.txt:
+        * platform/chromium-win/fast/table/027-vertical-expected.txt:
+        * platform/mac/test_expectations.txt: Suppress 027* tests for rebaseline.
+        * platform/win/test_expectations.txt: ditto
+           The 2 tests are skipped on gtk and qt.
+
 2012-01-24  Parag Radke  <[email protected]>
 
         REGRESSION (r73385): Marquee with behavior="alternate" is not working

Added: trunk/LayoutTests/fast/css/min-width-with-spanned-cell-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/fast/css/min-width-with-spanned-cell-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/fast/css/min-width-with-spanned-cell-expected.txt (0 => 105775)


--- trunk/LayoutTests/fast/css/min-width-with-spanned-cell-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/min-width-with-spanned-cell-expected.txt	2012-01-24 20:32:37 UTC (rev 105775)
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x50
+  RenderBlock {HTML} at (0,0) size 800x50
+    RenderBody {BODY} at (8,8) size 784x34
+      RenderTable {TABLE} at (0,0) size 784x34
+        RenderTableSection {TBODY} at (0,0) size 784x34
+          RenderTableRow {TR} at (0,2) size 784x14
+            RenderTableCell {TD} at (2,2) size 146x14 [color=#333333] [bgcolor=#EEEEEE] [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 144x12
+                text run at (1,1) width 144: "texttesttest"
+            RenderTableCell {TD} at (150,2) size 146x14 [color=#333333] [bgcolor=#EEEEEE] [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 144x12
+                text run at (1,1) width 144: "texttesttest"
+            RenderTableCell {TD} at (298,8) size 484x2 [color=#333333] [bgcolor=#EEEEEE] [r=0 c=2 rs=1 cs=1]
+          RenderTableRow {TR} at (0,18) size 784x14
+            RenderTableCell {TD} at (2,18) size 780x14 [color=#333333] [bgcolor=#EEEEEE] [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 312x12
+                text run at (1,1) width 312: "texttesttexttesttesttextte"
Property changes on: trunk/LayoutTests/fast/css/min-width-with-spanned-cell-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/css/min-width-with-spanned-cell-fixed-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/fast/css/min-width-with-spanned-cell-fixed-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/fast/css/min-width-with-spanned-cell-fixed-expected.txt (0 => 105775)


--- trunk/LayoutTests/fast/css/min-width-with-spanned-cell-fixed-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/min-width-with-spanned-cell-fixed-expected.txt	2012-01-24 20:32:37 UTC (rev 105775)
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x50
+  RenderBlock {HTML} at (0,0) size 800x50
+    RenderBody {BODY} at (8,8) size 784x34
+      RenderTable {TABLE} at (0,0) size 784x34
+        RenderTableSection {TBODY} at (0,0) size 784x34
+          RenderTableRow {TR} at (0,2) size 784x14
+            RenderTableCell {TD} at (2,2) size 8x14 [color=#333333] [bgcolor=#EEEEEE] [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 144x12
+                text run at (1,1) width 144: "texttesttest"
+            RenderTableCell {TD} at (12,2) size 8x14 [color=#333333] [bgcolor=#EEEEEE] [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 144x12
+                text run at (1,1) width 144: "texttesttest"
+            RenderTableCell {TD} at (22,8) size 760x2 [color=#333333] [bgcolor=#EEEEEE] [r=0 c=2 rs=1 cs=1]
+          RenderTableRow {TR} at (0,18) size 784x14
+            RenderTableCell {TD} at (2,18) size 780x14 [color=#333333] [bgcolor=#EEEEEE] [r=1 c=0 rs=1 cs=3]
+              RenderText {#text} at (1,1) size 312x12
+                text run at (1,1) width 312: "texttesttexttesttesttextte"
Property changes on: trunk/LayoutTests/fast/css/min-width-with-spanned-cell-fixed-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/css/min-width-with-spanned-cell-fixed.html (0 => 105775)


--- trunk/LayoutTests/fast/css/min-width-with-spanned-cell-fixed.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/min-width-with-spanned-cell-fixed.html	2012-01-24 20:32:37 UTC (rev 105775)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+    td {
+        color: #333333;
+        background-color: #eee;
+    }
+    table { table-layout: fixed; }
+</style>    
+</head>
+<body>
+
+<!--When a cell spans an entire row on a table with fixed layout, allow cells containing text to be
+squeezed smaller than the width of the text. You should see the content of the first two cells in the first row overlapping.-->
+
+<table style="font: 12px Ahem;" width="100%">
+  <tr>
+    <td width="1%">
+      texttesttest
+    </td>
+    <td width="1%">
+      texttesttest
+    </td>
+    <td width='98%'>
+    </td>
+  </tr>
+  <tr>
+    <td colspan="3"> 
+      texttesttexttesttesttextte
+    </td>
+  </tr>
+</table>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/fast/css/min-width-with-spanned-cell-fixed.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/fast/css/min-width-with-spanned-cell.html (0 => 105775)


--- trunk/LayoutTests/fast/css/min-width-with-spanned-cell.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/min-width-with-spanned-cell.html	2012-01-24 20:32:37 UTC (rev 105775)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+    td {
+        color: #333333;
+        background-color: #eee;
+    }
+</style>    
+</head>
+<body>
+
+<!--When a cell spans an entire row on a table with auto layout, ensure that cells containing text are not
+squeezed smaller than the width of the text. The text in the first two cells in the first row should not overlap.-->
+
+<table style="font: 12px Ahem;" width="100%">
+  <tr>
+    <td width="1%">
+      texttesttest
+    </td>
+    <td width="1%">
+      texttesttest
+    </td>
+    <td width='98%'>
+    </td>
+  </tr>
+  <tr>
+    <td colspan="3"> 
+      texttesttexttesttesttextte
+    </td>
+  </tr>
+</table>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/fast/css/min-width-with-spanned-cell.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/LayoutTests/platform/chromium-linux/fast/table/027-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/fast/table/027-vertical-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-win/fast/table/027-expected.txt (105774 => 105775)


--- trunk/LayoutTests/platform/chromium-win/fast/table/027-expected.txt	2012-01-24 20:29:44 UTC (rev 105774)
+++ trunk/LayoutTests/platform/chromium-win/fast/table/027-expected.txt	2012-01-24 20:32:37 UTC (rev 105775)
@@ -39,14 +39,14 @@
                 text run at (664,4) width 78: "  Lite \x{2022} Email"
           RenderTableRow {TR} at (0,28) size 784x344
             RenderTableCell {TD} at (0,196) size 220x8 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
-            RenderTableCell {TD} at (220,28) size 345x344 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
-              RenderTable {TABLE} at (4,4) size 337x336
-                RenderTableSection {TBODY} at (0,0) size 337x336
-                  RenderTableRow {TR} at (0,2) size 337x332
-                    RenderTableCell {TD} at (2,2) size 333x332 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
-                      RenderTable {TABLE} at (2,2) size 329x328
-                        RenderTableSection {TBODY} at (0,0) size 329x328
-                          RenderTableRow {TR} at (0,2) size 329x324
+            RenderTableCell {TD} at (220,28) size 344x344 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
+              RenderTable {TABLE} at (4,4) size 336x336
+                RenderTableSection {TBODY} at (0,0) size 336x336
+                  RenderTableRow {TR} at (0,2) size 336x332
+                    RenderTableCell {TD} at (2,2) size 332x332 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
+                      RenderTable {TABLE} at (2,2) size 328x328
+                        RenderTableSection {TBODY} at (0,0) size 328x328
+                          RenderTableRow {TR} at (0,2) size 328x324
                             RenderTableCell {TD} at (2,162) size 127x4 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
                             RenderTableCell {TD} at (131,2) size 66x324 [border: (1px solid #008000)] [r=0 c=1 rs=1 cs=1]
                               RenderText {#text} at (2,2) size 62x319
@@ -67,7 +67,7 @@
                                 text run at (2,262) width 38: "what I"
                                 text run at (2,282) width 53: "think will"
                                 text run at (2,302) width 36: "work."
-                            RenderTableCell {TD} at (199,162) size 128x4 [border: (1px solid #008000)] [r=0 c=2 rs=1 cs=1]
-            RenderTableCell {TD} at (565,187) size 219x26 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
+                            RenderTableCell {TD} at (199,162) size 127x4 [border: (1px solid #008000)] [r=0 c=2 rs=1 cs=1]
+            RenderTableCell {TD} at (564,187) size 220x26 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
               RenderImage {IMG} at (4,4) size 212x18
               RenderText {#text} at (0,0) size 0x0

Modified: trunk/LayoutTests/platform/chromium-win/fast/table/027-vertical-expected.txt (105774 => 105775)


--- trunk/LayoutTests/platform/chromium-win/fast/table/027-vertical-expected.txt	2012-01-24 20:29:44 UTC (rev 105774)
+++ trunk/LayoutTests/platform/chromium-win/fast/table/027-vertical-expected.txt	2012-01-24 20:32:37 UTC (rev 105775)
@@ -1,12 +1,12 @@
-layer at (0,0) size 785x760
+layer at (0,0) size 785x772
   RenderView at (0,0) size 785x600
-layer at (0,0) size 785x760
-  RenderBlock {HTML} at (0,0) size 785x760
-    RenderBody {BODY} at (8,8) size 769x744
-      RenderTable {TABLE} at (0,0) size 372x744
-        RenderTableSection {TBODY} at (0,0) size 372x744
-          RenderTableRow {TR} at (0,0) size 28x744
-            RenderTableCell {TD} at (0,0) size 28x744 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=3]
+layer at (0,0) size 785x772
+  RenderBlock {HTML} at (0,0) size 785x772
+    RenderBody {BODY} at (8,8) size 769x756
+      RenderTable {TABLE} at (0,0) size 372x756
+        RenderTableSection {TBODY} at (0,0) size 372x756
+          RenderTableRow {TR} at (0,0) size 28x756
+            RenderTableCell {TD} at (0,0) size 28x756 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=3]
               RenderText {#text} at (4,4) size 19x224
                 text run at (4,4) width 137: "   Join Now   Sign In   "
                 text run at (4,141) width 87: "   Personalize: "
@@ -37,7 +37,7 @@
                 text run at (4,571) width 8: "  "
                 text run at (4,579) width 85: "   My Links:   "
                 text run at (4,664) width 78: "  Lite \x{2022} Email"
-          RenderTableRow {TR} at (0,28) size 344x744
+          RenderTableRow {TR} at (0,28) size 344x756
             RenderTableCell {TD} at (28,168) size 344x-128 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
             RenderTableCell {TD} at (28,208) size 344x328 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
               RenderTable {TABLE} at (4,4) size 336x320
@@ -68,6 +68,6 @@
                                 text run at (282,2) width 53: "think will"
                                 text run at (302,2) width 36: "work."
                             RenderTableCell {TD} at (2,351) size 324x-201 [border: (1px solid #008000)] [r=0 c=2 rs=1 cs=1]
-            RenderTableCell {TD} at (28,695) size 344x-110 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
+            RenderTableCell {TD} at (28,695) size 344x-98 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
               RenderImage {IMG} at (163,-155) size 18x212
               RenderText {#text} at (0,0) size 0x0

Modified: trunk/LayoutTests/platform/mac/test_expectations.txt (105774 => 105775)


--- trunk/LayoutTests/platform/mac/test_expectations.txt	2012-01-24 20:29:44 UTC (rev 105774)
+++ trunk/LayoutTests/platform/mac/test_expectations.txt	2012-01-24 20:32:37 UTC (rev 105775)
@@ -195,3 +195,7 @@
 
 // New test, needs image results added.
 BUGWK75570 : http/tests/media/video-buffering-repaints-controls.html = IMAGE
+
+// Rebaseline required after bug 74874
+BUGWK74874 : fast/table/027.html = TEXT
+BUGWK74874 : fast/table/027-vertical.html = TEXT

Modified: trunk/LayoutTests/platform/win/test_expectations.txt (105774 => 105775)


--- trunk/LayoutTests/platform/win/test_expectations.txt	2012-01-24 20:29:44 UTC (rev 105774)
+++ trunk/LayoutTests/platform/win/test_expectations.txt	2012-01-24 20:32:37 UTC (rev 105775)
@@ -128,3 +128,7 @@
 
 // Needs baseline
 BUGWK76118 : fast/css/text-overflow-input.html = MISSING
+
+// Rebaseline required after bug 74874
+BUGWK74874 : fast/table/027.html = IMAGE+TEXT
+BUGWK74874 : fast/table/027-vertical.html = IMAGE+TEXT

Modified: trunk/Source/WebCore/ChangeLog (105774 => 105775)


--- trunk/Source/WebCore/ChangeLog	2012-01-24 20:29:44 UTC (rev 105774)
+++ trunk/Source/WebCore/ChangeLog	2012-01-24 20:32:37 UTC (rev 105775)
@@ -1,3 +1,23 @@
+2012-01-16  Robert Hogan  <[email protected]>
+
+        REGRESSION (r102040): Wrong column widths when row has colspan and unwrappable text
+        https://bugs.webkit.org/show_bug.cgi?id=74874
+
+        Reviewed by Julien Chaffraix.
+
+        Tests: fast/css/min-width-with-spanned-cell-fixed.html
+               fast/css/min-width-with-spanned-cell.html
+
+        A cell with unwrappable text must be as wide as the text is long. If it is a colspan in a table whose
+        columns are all percent and the width of the span cell is wider than the cells it spans in any other 
+        row then it will squeeze those cells beyond the width required to display their contents.
+
+        To fix this ensure that the squeezing of cells within a span respects the minimum width determined by
+        their contents. The squeezing remains for fixed layout tables as per FF and Opera.
+
+        * rendering/AutoTableLayout.cpp:
+        (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
+
 2012-01-24  Tommy Widenflycht  <[email protected]>
 
         MediaStream API: Split the MediaStream track list into audio/video specific ones.

Modified: trunk/Source/WebCore/rendering/AutoTableLayout.cpp (105774 => 105775)


--- trunk/Source/WebCore/rendering/AutoTableLayout.cpp	2012-01-24 20:29:44 UTC (rev 105774)
+++ trunk/Source/WebCore/rendering/AutoTableLayout.cpp	2012-01-24 20:32:37 UTC (rev 105775)
@@ -400,7 +400,7 @@
                     ASSERT(m_layoutStruct[pos].logicalWidth.isPercent() || m_layoutStruct[pos].effectiveLogicalWidth.isPercent());
                     // |allColsArePercent| means that either the logicalWidth *or* the effectiveLogicalWidth are percents, handle both of them here.
                     float percent = m_layoutStruct[pos].logicalWidth.isPercent() ? m_layoutStruct[pos].logicalWidth.percent() : m_layoutStruct[pos].effectiveLogicalWidth.percent();
-                    m_layoutStruct[pos].effectiveMinLogicalWidth = percent * cellMinLogicalWidth / totalPercent;
+                    m_layoutStruct[pos].effectiveMinLogicalWidth = max(m_layoutStruct[pos].effectiveMinLogicalWidth, static_cast<int>(percent * cellMinLogicalWidth / totalPercent));
                     m_layoutStruct[pos].effectiveMaxLogicalWidth = percent * cellMaxLogicalWidth / totalPercent;
                 }
             } else {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to