Title: [129529] trunk
Revision
129529
Author
e...@chromium.org
Date
2012-09-25 11:19:45 -0700 (Tue, 25 Sep 2012)

Log Message

[chromium] REGRESSION: Incorrect preferred width calculation for table cells
https://bugs.webkit.org/show_bug.cgi?id=97497

Reviewed by Levi Weintraub.

Source/WebCore: 

In fixing bug 93911 r125694 caused a problem with the preferred
width calculations for table cells with a fractional padding
where the logic to ensure that the cell is wide enough for the
content returns different results for cells with a fixed width
and cells with an automatic width.

Test: fast/sub-pixel/table-cells-have-stable-width.html

* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::recalcColumn):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computePreferredLogicalWidths):
Move the logic that ensures that a cell is wide enough from AutoTableLayout::recalcColumn to RenderBlock::computePreferredLogicalWidths to. This way it also applies to FixedTableLayout which had the same problem.

LayoutTests: 

Added test for cell width calculation and reverted three svg tests to the results prior to r125694.

* fast/sub-pixel/table-cells-have-stable-width-expected.txt: Added.
* fast/sub-pixel/table-cells-have-stable-width.html: Added.
* platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png:
* platform/chromium-win/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (129528 => 129529)


--- trunk/LayoutTests/ChangeLog	2012-09-25 18:12:18 UTC (rev 129528)
+++ trunk/LayoutTests/ChangeLog	2012-09-25 18:19:45 UTC (rev 129529)
@@ -1,3 +1,21 @@
+2012-09-24  Emil A Eklund  <e...@chromium.org>
+
+        [chromium] REGRESSION: Incorrect preferred width calculation for table cells
+        https://bugs.webkit.org/show_bug.cgi?id=97497
+
+        Reviewed by Levi Weintraub.
+
+        Added test for cell width calculation and reverted three svg tests to the results prior to r125694.
+
+        * fast/sub-pixel/table-cells-have-stable-width-expected.txt: Added.
+        * fast/sub-pixel/table-cells-have-stable-width.html: Added.
+        * platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png:
+        * platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt:
+        * platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png:
+        * platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt:
+        * platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png:
+        * platform/chromium-win/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:
+
 2012-09-25  Dominic Mazzoni  <dmazz...@google.com>
 
         AX: Chromium doesn't pass accessibility text range and line number tests

Added: trunk/LayoutTests/fast/sub-pixel/table-cells-have-stable-width-expected.txt (0 => 129529)


--- trunk/LayoutTests/fast/sub-pixel/table-cells-have-stable-width-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/table-cells-have-stable-width-expected.txt	2012-09-25 18:19:45 UTC (rev 129529)
@@ -0,0 +1,6 @@
+PASS Cell in AutoTable has expected size
+PASS Cell in FixedTable has expected size
+Cc:	AutoTableLayout	
+foo
+FixedTableLayout
+Tests that setting the width of an element inside a cell to the computed width of said element does not change the width of the cell itself.

Added: trunk/LayoutTests/fast/sub-pixel/table-cells-have-stable-width.html (0 => 129529)


--- trunk/LayoutTests/fast/sub-pixel/table-cells-have-stable-width.html	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/table-cells-have-stable-width.html	2012-09-25 18:19:45 UTC (rev 129529)
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <style>
+            #firstCell {
+                border-right: 3px solid #e5ecf9;
+                width: 12em;
+                padding: 0.5em .5em .5em 0;
+                font-size: 95%;
+            }
+            #content {
+                position: relative;
+            }
+            #fixedTable {
+                table-layout: fixed;
+            }
+            #firstFixedCell {
+                width: 21.2px;
+                margin: 0.3px;
+                padding: 0.1px;
+            }
+        </style>
+        <script src=""
+    </head>
+
+    <body>
+        <table width="100%" cellpadding="0" cellspacing="0" border="0">
+            <tbody class="collapse"> 
+                <tr>
+                    <td id="firstCell">
+                        <div id="content">
+                            <table cellspacing="0" cellpadding="0">
+                                <tbody>
+                                    <tr>
+                                        <th align="left">Cc:</th>
+                                        <td>AutoTableLayout</td>
+                                    </tr>
+                            </tbody>
+                        </table>
+                    </div>
+                </td>
+                <td width="100%"></td>
+                </tr>
+            </tbody>
+        </table>
+        
+        <table id="fixedTable">
+            <tr>
+                <td id="firstFixedCell"><div id="fixedContent">foo</div></td>
+                <td>FixedTableLayout</td>
+            </tr>
+        </table>
+        
+        <p>
+            Tests that setting the width of an element inside a cell to the computed width of said element does not change the width of the cell itself.
+        </p>
+
+        <script>
+            var autoEl = document.getElementById("content");
+            var autoCell = document.getElementById("firstCell");
+            var autoExpectedWidth = String(autoCell.getBoundingClientRect().width);
+            autoEl.style.width = autoEl.getBoundingClientRect().width + "px";
+            if (autoCell.getBoundingClientRect().width == autoExpectedWidth)
+                testPassed('Cell in AutoTable has expected size');
+            else
+                shouldBe('autoCell.getBoundingClientRect().width', autoExpectedWidth);
+            
+            
+            var fixedEl = document.getElementById("fixedContent");
+            var fixedCell = document.getElementById("firstFixedCell");
+            var fixedExpectedWidth = String(fixedCell.getBoundingClientRect().width);
+            fixedEl.style.width = fixedEl.getBoundingClientRect().width + "px";
+            if (fixedCell.getBoundingClientRect().width == fixedExpectedWidth)
+                testPassed('Cell in FixedTable has expected size');
+            else
+                shouldBe('fixedCell.getBoundingClientRect().width', fixedExpectedWidth);
+
+        </script>
+    </body>
+</html>

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt (129528 => 129529)


--- trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt	2012-09-25 18:12:18 UTC (rev 129528)
+++ trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt	2012-09-25 18:19:45 UTC (rev 129529)
@@ -3,30 +3,30 @@
 layer at (0,0) size 800x331
   RenderBlock {HTML} at (0,0) size 800x332
     RenderBody {BODY} at (5,5) size 790x321
-      RenderTable {TABLE} at (0,0) size 471x320
-        RenderTableSection {TBODY} at (0,0) size 471x320
-          RenderTableRow {TR} at (0,1) size 471x14
-            RenderTableCell {TH} at (1,1) size 65x14 [bgcolor=#DDDD99] [r=0 c=0 rs=1 cs=1]
-              RenderText {#text} at (6,0) size 53x14
-                text run at (6,0) width 53: "viewBox?"
-            RenderTableCell {TH} at (67,1) size 119x14 [bgcolor=#DDDD99] [r=0 c=1 rs=1 cs=1]
-              RenderText {#text} at (1,0) size 117x14
-                text run at (1,0) width 117: "preserve\x{AD}Aspect\x{AD}Ratio"
-            RenderTableCell {TH} at (187,1) size 141x14 [bgcolor=#DDDD99] [r=0 c=2 rs=1 cs=1]
-              RenderText {#text} at (54,0) size 33x14
-                text run at (54,0) width 33: "<img>"
-            RenderTableCell {TH} at (329,1) size 141x14 [bgcolor=#DDDD99] [r=0 c=3 rs=1 cs=1]
-              RenderText {#text} at (47,0) size 47x14
-                text run at (47,0) width 47: "<object>"
-          RenderTableRow {TR} at (0,16) size 471x37
-            RenderTableCell {TH} at (1,84) size 65x14 [bgcolor=#DDDD99] [r=1 c=0 rs=4 cs=1]
-              RenderText {#text} at (1,0) size 63x14
-                text run at (1,0) width 63: "No viewBox"
-            RenderTableCell {TH} at (67,34) size 119x0 [bgcolor=#DDDD99] [r=1 c=1 rs=1 cs=1]
-            RenderTableCell {TD} at (187,16) size 141x37 [r=1 c=2 rs=1 cs=1]
+      RenderTable {TABLE} at (0,0) size 467x320
+        RenderTableSection {TBODY} at (0,0) size 467x320
+          RenderTableRow {TR} at (0,1) size 467x14
+            RenderTableCell {TH} at (1,1) size 64x14 [bgcolor=#DDDD99] [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (5,0) size 54x14
+                text run at (5,0) width 54: "viewBox?"
+            RenderTableCell {TH} at (66,1) size 118x14 [bgcolor=#DDDD99] [r=0 c=1 rs=1 cs=1]
+              RenderText {#text} at (0,0) size 118x14
+                text run at (0,0) width 118: "preserve\x{AD}Aspect\x{AD}Ratio"
+            RenderTableCell {TH} at (185,1) size 140x14 [bgcolor=#DDDD99] [r=0 c=2 rs=1 cs=1]
+              RenderText {#text} at (53,0) size 34x14
+                text run at (53,0) width 34: "<img>"
+            RenderTableCell {TH} at (326,1) size 140x14 [bgcolor=#DDDD99] [r=0 c=3 rs=1 cs=1]
+              RenderText {#text} at (47,0) size 46x14
+                text run at (47,0) width 46: "<object>"
+          RenderTableRow {TR} at (0,16) size 467x37
+            RenderTableCell {TH} at (1,84) size 64x14 [bgcolor=#DDDD99] [r=1 c=0 rs=4 cs=1]
+              RenderText {#text} at (0,0) size 64x14
+                text run at (0,0) width 64: "No viewBox"
+            RenderTableCell {TH} at (66,34) size 118x0 [bgcolor=#DDDD99] [r=1 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (185,16) size 140x37 [r=1 c=2 rs=1 cs=1]
               RenderImage {IMG} at (0,-1) size 139x35 [border: (1px dashed #800000)]
               RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (329,16) size 141x37 [r=1 c=3 rs=1 cs=1]
+            RenderTableCell {TD} at (326,16) size 140x37 [r=1 c=3 rs=1 cs=1]
               RenderEmbeddedObject {OBJECT} at (0,-1) size 139x35 [border: (1px dashed #008000)]
                 layer at (0,0) size 133x29
                   RenderView at (0,0) size 133x29
@@ -34,14 +34,14 @@
                   RenderSVGRoot {svg} at (0,0) size 133x29
                     RenderSVGEllipse {circle} at (0,0) size 133x29 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [cx=110.00] [cy=110.00] [r=110.00]
               RenderText {#text} at (0,0) size 0x0
-          RenderTableRow {TR} at (0,54) size 471x37
-            RenderTableCell {TH} at (67,65) size 119x14 [bgcolor=#DDDD99] [r=2 c=1 rs=1 cs=1]
-              RenderText {#text} at (45,0) size 29x14
-                text run at (45,0) width 29: "none"
-            RenderTableCell {TD} at (187,54) size 141x37 [r=2 c=2 rs=1 cs=1]
+          RenderTableRow {TR} at (0,54) size 467x37
+            RenderTableCell {TH} at (66,65) size 118x14 [bgcolor=#DDDD99] [r=2 c=1 rs=1 cs=1]
+              RenderText {#text} at (45,0) size 28x14
+                text run at (45,0) width 28: "none"
+            RenderTableCell {TD} at (185,54) size 140x37 [r=2 c=2 rs=1 cs=1]
               RenderImage {IMG} at (0,-1) size 139x35 [border: (1px dashed #800000)]
               RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (329,54) size 141x37 [r=2 c=3 rs=1 cs=1]
+            RenderTableCell {TD} at (326,54) size 140x37 [r=2 c=3 rs=1 cs=1]
               RenderEmbeddedObject {OBJECT} at (0,-1) size 139x35 [border: (1px dashed #008000)]
                 layer at (0,0) size 133x29
                   RenderView at (0,0) size 133x29
@@ -51,14 +51,14 @@
                     RenderSVGContainer {g} at (0,0) size 133x29 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
                       RenderSVGPath {path} at (0,0) size 133x29 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="" 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.419 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
               RenderText {#text} at (0,0) size 0x0
-          RenderTableRow {TR} at (0,92) size 471x37
-            RenderTableCell {TH} at (67,103) size 119x14 [bgcolor=#DDDD99] [r=3 c=1 rs=1 cs=1]
-              RenderText {#text} at (45,0) size 29x14
-                text run at (45,0) width 29: "meet"
-            RenderTableCell {TD} at (187,92) size 141x37 [r=3 c=2 rs=1 cs=1]
+          RenderTableRow {TR} at (0,92) size 467x37
+            RenderTableCell {TH} at (66,103) size 118x14 [bgcolor=#DDDD99] [r=3 c=1 rs=1 cs=1]
+              RenderText {#text} at (44,0) size 30x14
+                text run at (44,0) width 30: "meet"
+            RenderTableCell {TD} at (185,92) size 140x37 [r=3 c=2 rs=1 cs=1]
               RenderImage {IMG} at (0,-1) size 139x35 [border: (1px dashed #800000)]
               RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (329,92) size 141x37 [r=3 c=3 rs=1 cs=1]
+            RenderTableCell {TD} at (326,92) size 140x37 [r=3 c=3 rs=1 cs=1]
               RenderEmbeddedObject {OBJECT} at (0,-1) size 139x35 [border: (1px dashed #008000)]
                 layer at (0,0) size 133x29
                   RenderView at (0,0) size 133x29
@@ -68,14 +68,14 @@
                     RenderSVGContainer {g} at (0,0) size 133x29 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
                       RenderSVGPath {path} at (0,0) size 133x29 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="" 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.419 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
               RenderText {#text} at (0,0) size 0x0
-          RenderTableRow {TR} at (0,130) size 471x37
-            RenderTableCell {TH} at (67,141) size 119x14 [bgcolor=#DDDD99] [r=4 c=1 rs=1 cs=1]
-              RenderText {#text} at (46,0) size 27x14
-                text run at (46,0) width 27: "slice"
-            RenderTableCell {TD} at (187,130) size 141x37 [r=4 c=2 rs=1 cs=1]
+          RenderTableRow {TR} at (0,130) size 467x37
+            RenderTableCell {TH} at (66,141) size 118x14 [bgcolor=#DDDD99] [r=4 c=1 rs=1 cs=1]
+              RenderText {#text} at (46,0) size 26x14
+                text run at (46,0) width 26: "slice"
+            RenderTableCell {TD} at (185,130) size 140x37 [r=4 c=2 rs=1 cs=1]
               RenderImage {IMG} at (0,-1) size 139x35 [border: (1px dashed #800000)]
               RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (329,130) size 141x37 [r=4 c=3 rs=1 cs=1]
+            RenderTableCell {TD} at (326,130) size 140x37 [r=4 c=3 rs=1 cs=1]
               RenderEmbeddedObject {OBJECT} at (0,-1) size 139x35 [border: (1px dashed #008000)]
                 layer at (0,0) size 133x29
                   RenderView at (0,0) size 133x29
@@ -85,15 +85,15 @@
                     RenderSVGContainer {g} at (0,0) size 133x29 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
                       RenderSVGPath {path} at (0,0) size 133x29 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="" 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.419 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
               RenderText {#text} at (0,0) size 0x0
-          RenderTableRow {TR} at (0,168) size 471x37
-            RenderTableCell {TH} at (1,236) size 65x14 [bgcolor=#DDDD99] [r=5 c=0 rs=4 cs=1]
-              RenderText {#text} at (9,0) size 47x14
-                text run at (9,0) width 47: "viewBox"
-            RenderTableCell {TH} at (67,186) size 119x0 [bgcolor=#DDDD99] [r=5 c=1 rs=1 cs=1]
-            RenderTableCell {TD} at (187,168) size 141x37 [r=5 c=2 rs=1 cs=1]
+          RenderTableRow {TR} at (0,168) size 467x37
+            RenderTableCell {TH} at (1,236) size 64x14 [bgcolor=#DDDD99] [r=5 c=0 rs=4 cs=1]
+              RenderText {#text} at (9,0) size 46x14
+                text run at (9,0) width 46: "viewBox"
+            RenderTableCell {TH} at (66,186) size 118x0 [bgcolor=#DDDD99] [r=5 c=1 rs=1 cs=1]
+            RenderTableCell {TD} at (185,168) size 140x37 [r=5 c=2 rs=1 cs=1]
               RenderImage {IMG} at (0,-1) size 139x35 [border: (1px dashed #800000)]
               RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (329,168) size 141x37 [r=5 c=3 rs=1 cs=1]
+            RenderTableCell {TD} at (326,168) size 140x37 [r=5 c=3 rs=1 cs=1]
               RenderEmbeddedObject {OBJECT} at (0,-1) size 139x35 [border: (1px dashed #008000)]
                 layer at (0,0) size 133x29
                   RenderView at (0,0) size 133x29
@@ -103,14 +103,14 @@
                     RenderSVGContainer {g} at (52,0) size 21x21 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
                       RenderSVGPath {path} at (52,0) size 21x21 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="" 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.419 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
               RenderText {#text} at (0,0) size 0x0
-          RenderTableRow {TR} at (0,206) size 471x37
-            RenderTableCell {TH} at (67,217) size 119x14 [bgcolor=#DDDD99] [r=6 c=1 rs=1 cs=1]
-              RenderText {#text} at (45,0) size 29x14
-                text run at (45,0) width 29: "none"
-            RenderTableCell {TD} at (187,206) size 141x37 [r=6 c=2 rs=1 cs=1]
+          RenderTableRow {TR} at (0,206) size 467x37
+            RenderTableCell {TH} at (66,217) size 118x14 [bgcolor=#DDDD99] [r=6 c=1 rs=1 cs=1]
+              RenderText {#text} at (45,0) size 28x14
+                text run at (45,0) width 28: "none"
+            RenderTableCell {TD} at (185,206) size 140x37 [r=6 c=2 rs=1 cs=1]
               RenderImage {IMG} at (0,-1) size 139x35 [border: (1px dashed #800000)]
               RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (329,206) size 141x37 [r=6 c=3 rs=1 cs=1]
+            RenderTableCell {TD} at (326,206) size 140x37 [r=6 c=3 rs=1 cs=1]
               RenderEmbeddedObject {OBJECT} at (0,-1) size 139x35 [border: (1px dashed #008000)]
                 layer at (0,0) size 133x29
                   RenderView at (0,0) size 133x29
@@ -120,14 +120,14 @@
                     RenderSVGContainer {g} at (0,0) size 97x21 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
                       RenderSVGPath {path} at (0,0) size 97x21 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="" 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.419 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
               RenderText {#text} at (0,0) size 0x0
-          RenderTableRow {TR} at (0,244) size 471x37
-            RenderTableCell {TH} at (67,255) size 119x14 [bgcolor=#DDDD99] [r=7 c=1 rs=1 cs=1]
-              RenderText {#text} at (45,0) size 29x14
-                text run at (45,0) width 29: "meet"
-            RenderTableCell {TD} at (187,244) size 141x37 [r=7 c=2 rs=1 cs=1]
+          RenderTableRow {TR} at (0,244) size 467x37
+            RenderTableCell {TH} at (66,255) size 118x14 [bgcolor=#DDDD99] [r=7 c=1 rs=1 cs=1]
+              RenderText {#text} at (44,0) size 30x14
+                text run at (44,0) width 30: "meet"
+            RenderTableCell {TD} at (185,244) size 140x37 [r=7 c=2 rs=1 cs=1]
               RenderImage {IMG} at (0,-1) size 139x35 [border: (1px dashed #800000)]
               RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (329,244) size 141x37 [r=7 c=3 rs=1 cs=1]
+            RenderTableCell {TD} at (326,244) size 140x37 [r=7 c=3 rs=1 cs=1]
               RenderEmbeddedObject {OBJECT} at (0,-1) size 139x35 [border: (1px dashed #008000)]
                 layer at (0,0) size 133x29
                   RenderView at (0,0) size 133x29
@@ -137,14 +137,14 @@
                     RenderSVGContainer {g} at (52,0) size 21x21 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}]
                       RenderSVGPath {path} at (52,0) size 21x21 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="" 525.714 585.219 C 525.714 685.419 444.486 766.648 344.286 766.648 C 244.085 766.648 162.857 685.419 162.857 585.219 C 162.857 485.019 244.085 403.791 344.286 403.791 C 444.486 403.791 525.714 485.019 525.714 585.219 Z"]
               RenderText {#text} at (0,0) size 0x0
-          RenderTableRow {TR} at (0,282) size 471x37
-            RenderTableCell {TH} at (67,293) size 119x14 [bgcolor=#DDDD99] [r=8 c=1 rs=1 cs=1]
-              RenderText {#text} at (46,0) size 27x14
-                text run at (46,0) width 27: "slice"
-            RenderTableCell {TD} at (187,282) size 141x37 [r=8 c=2 rs=1 cs=1]
+          RenderTableRow {TR} at (0,282) size 467x37
+            RenderTableCell {TH} at (66,293) size 118x14 [bgcolor=#DDDD99] [r=8 c=1 rs=1 cs=1]
+              RenderText {#text} at (46,0) size 26x14
+                text run at (46,0) width 26: "slice"
+            RenderTableCell {TD} at (185,282) size 140x37 [r=8 c=2 rs=1 cs=1]
               RenderImage {IMG} at (0,-1) size 139x35 [border: (1px dashed #800000)]
               RenderText {#text} at (0,0) size 0x0
-            RenderTableCell {TD} at (329,282) size 141x37 [r=8 c=3 rs=1 cs=1]
+            RenderTableCell {TD} at (326,282) size 140x37 [r=8 c=3 rs=1 cs=1]
               RenderEmbeddedObject {OBJECT} at (0,-1) size 139x35 [border: (1px dashed #008000)]
                 layer at (0,0) size 133x29
                   RenderView at (0,0) size 133x29

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt (129528 => 129529)


--- trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt	2012-09-25 18:12:18 UTC (rev 129528)
+++ trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt	2012-09-25 18:19:45 UTC (rev 129529)
@@ -15,15 +15,15 @@
                         RenderText {#text} at (0,0) size 478x25
                           text run at (0,0) width 478: "Both sides should have identical size after zooming"
                   RenderTableRow {tr} at (0,67) size 490x24
-                    RenderTableCell {td} at (1,67) size 243x24 [r=1 c=0 rs=1 cs=1]
-                      RenderText {#text} at (96,5) size 51x14
-                        text run at (96,5) width 51: "SVG Image"
-                    RenderTableCell {td} at (245,67) size 244x24 [r=1 c=1 rs=1 cs=1]
-                      RenderText {#text} at (95,5) size 54x14
-                        text run at (95,5) width 54: "PNG Image"
+                    RenderTableCell {td} at (1,67) size 244x24 [r=1 c=0 rs=1 cs=1]
+                      RenderText {#text} at (97,5) size 50x14
+                        text run at (97,5) width 50: "SVG Image"
+                    RenderTableCell {td} at (246,67) size 243x24 [r=1 c=1 rs=1 cs=1]
+                      RenderText {#text} at (95,5) size 53x14
+                        text run at (95,5) width 53: "PNG Image"
                   RenderTableRow {tr} at (0,92) size 490x82
-                    RenderTableCell {td} at (1,92) size 243x82 [r=2 c=0 rs=1 cs=1]
-                      RenderEmbeddedObject {object} at (99,4) size 139x70
+                    RenderTableCell {td} at (1,92) size 244x82 [r=2 c=0 rs=1 cs=1]
+                      RenderEmbeddedObject {object} at (100,4) size 139x70
                         layer at (0,0) size 139x69
                           RenderView at (0,0) size 139x69
                         layer at (0,0) size 139x69
@@ -42,6 +42,6 @@
                                 chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 269.61: "$Revision: 1.7 $"
                             RenderSVGRect {rect} at (23,0) size 93x69 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
                       RenderText {#text} at (0,0) size 0x0
-                    RenderTableCell {td} at (245,92) size 244x82 [r=2 c=1 rs=1 cs=1]
+                    RenderTableCell {td} at (246,92) size 243x82 [r=2 c=1 rs=1 cs=1]
                       RenderImage {img} at (5,5) size 138x69
                       RenderText {#text} at (0,0) size 0x0

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-win/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt (129528 => 129529)


--- trunk/LayoutTests/platform/chromium-win/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt	2012-09-25 18:12:18 UTC (rev 129528)
+++ trunk/LayoutTests/platform/chromium-win/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt	2012-09-25 18:19:45 UTC (rev 129529)
@@ -3,25 +3,25 @@
 layer at (0,0) size 800x378
   RenderBlock {html} at (0,0) size 800x379
     RenderBody {body} at (5,5) size 790x368
-      RenderTable {table} at (41,0) size 707x367
-        RenderTableSection (anonymous) at (0,0) size 706x367
-          RenderTableRow {tr} at (0,0) size 706x367
-            RenderTableCell {td} at (0,0) size 706x367 [r=0 c=0 rs=1 cs=3]
-              RenderTable {table} at (7,6) size 694x355
-                RenderTableSection (anonymous) at (0,0) size 693x355
-                  RenderTableRow {tr} at (0,1) size 693x65
-                    RenderTableCell {td} at (1,1) size 691x66 [r=0 c=0 rs=1 cs=2]
-                      RenderBlock {h1} at (5,19) size 682x27
-                        RenderText {#text} at (102,0) size 477x25
-                          text run at (102,0) width 477: "Both sides should have identical size after zooming"
-                  RenderTableRow {tr} at (0,67) size 693x24
+      RenderTable {table} at (41,0) size 706x367
+        RenderTableSection (anonymous) at (0,0) size 705x367
+          RenderTableRow {tr} at (0,0) size 705x367
+            RenderTableCell {td} at (0,0) size 705x367 [r=0 c=0 rs=1 cs=3]
+              RenderTable {table} at (7,6) size 693x355
+                RenderTableSection (anonymous) at (0,0) size 692x355
+                  RenderTableRow {tr} at (0,1) size 692x65
+                    RenderTableCell {td} at (1,1) size 690x66 [r=0 c=0 rs=1 cs=2]
+                      RenderBlock {h1} at (5,19) size 681x27
+                        RenderText {#text} at (101,0) size 478x25
+                          text run at (101,0) width 478: "Both sides should have identical size after zooming"
+                  RenderTableRow {tr} at (0,67) size 692x24
                     RenderTableCell {td} at (1,67) size 345x24 [r=1 c=0 rs=1 cs=1]
                       RenderText {#text} at (147,5) size 51x14
                         text run at (147,5) width 51: "SVG Image"
-                    RenderTableCell {td} at (347,67) size 345x24 [r=1 c=1 rs=1 cs=1]
-                      RenderText {#text} at (146,5) size 53x14
-                        text run at (146,5) width 53: "PNG Image"
-                  RenderTableRow {tr} at (0,92) size 693x262
+                    RenderTableCell {td} at (347,67) size 344x24 [r=1 c=1 rs=1 cs=1]
+                      RenderText {#text} at (145,5) size 54x14
+                        text run at (145,5) width 54: "PNG Image"
+                  RenderTableRow {tr} at (0,92) size 692x262
                     RenderTableCell {td} at (1,92) size 345x262 [r=2 c=0 rs=1 cs=1]
                       RenderEmbeddedObject {object} at (6,4) size 334x250
                         layer at (0,0) size 333x250
@@ -42,6 +42,6 @@
                                 chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 260.66: "$Revision: 1.7 $"
                             RenderSVGRect {rect} at (0,0) size 333x250 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
                       RenderText {#text} at (0,0) size 0x0
-                    RenderTableCell {td} at (347,92) size 345x262 [r=2 c=1 rs=1 cs=1]
+                    RenderTableCell {td} at (347,92) size 344x262 [r=2 c=1 rs=1 cs=1]
                       RenderImage {img} at (5,5) size 333x249
                       RenderText {#text} at (0,0) size 0x0

Modified: trunk/Source/WebCore/ChangeLog (129528 => 129529)


--- trunk/Source/WebCore/ChangeLog	2012-09-25 18:12:18 UTC (rev 129528)
+++ trunk/Source/WebCore/ChangeLog	2012-09-25 18:19:45 UTC (rev 129529)
@@ -1,3 +1,24 @@
+2012-09-24  Emil A Eklund  <e...@chromium.org>
+
+        [chromium] REGRESSION: Incorrect preferred width calculation for table cells
+        https://bugs.webkit.org/show_bug.cgi?id=97497
+
+        Reviewed by Levi Weintraub.
+
+        In fixing bug 93911 r125694 caused a problem with the preferred
+        width calculations for table cells with a fractional padding
+        where the logic to ensure that the cell is wide enough for the
+        content returns different results for cells with a fixed width
+        and cells with an automatic width.
+
+        Test: fast/sub-pixel/table-cells-have-stable-width.html
+
+        * rendering/AutoTableLayout.cpp:
+        (WebCore::AutoTableLayout::recalcColumn):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::computePreferredLogicalWidths):
+        Move the logic that ensures that a cell is wide enough from AutoTableLayout::recalcColumn to RenderBlock::computePreferredLogicalWidths to. This way it also applies to FixedTableLayout which had the same problem.
+
 2012-09-25  Dominic Mazzoni  <dmazz...@google.com>
 
         AX: Chromium doesn't pass accessibility text range and line number tests

Modified: trunk/Source/WebCore/rendering/AutoTableLayout.cpp (129528 => 129529)


--- trunk/Source/WebCore/rendering/AutoTableLayout.cpp	2012-09-25 18:12:18 UTC (rev 129528)
+++ trunk/Source/WebCore/rendering/AutoTableLayout.cpp	2012-09-25 18:19:45 UTC (rev 129529)
@@ -74,9 +74,9 @@
                 if (cell->colSpan() == 1) {
                     if (cell->preferredLogicalWidthsDirty())
                         cell->computePreferredLogicalWidths();
-                    columnLayout.minLogicalWidth = max<int>(cell->minPreferredLogicalWidth().ceil(), columnLayout.minLogicalWidth);
+                    columnLayout.minLogicalWidth = max<int>(cell->minPreferredLogicalWidth(), columnLayout.minLogicalWidth);
                     if (cell->maxPreferredLogicalWidth() > columnLayout.maxLogicalWidth) {
-                        columnLayout.maxLogicalWidth = cell->maxPreferredLogicalWidth().ceil();
+                        columnLayout.maxLogicalWidth = cell->maxPreferredLogicalWidth();
                         maxContributor = cell;
                     }
 

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (129528 => 129529)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-09-25 18:12:18 UTC (rev 129528)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-09-25 18:19:45 UTC (rev 129529)
@@ -5621,6 +5621,12 @@
         m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
         m_minPreferredLogicalWidth = min(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
     }
+    
+    // Table layout uses integers, ceil the preferred widths to ensure that they can contain the contents.
+    if (isTableCell()) {
+        m_minPreferredLogicalWidth = m_minPreferredLogicalWidth.ceil();
+        m_maxPreferredLogicalWidth = m_maxPreferredLogicalWidth.ceil();
+    }
 
     LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth();
     m_minPreferredLogicalWidth += borderAndPadding;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to