WebCore:
authorddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jun 2006 04:39:24 +0000 (04:39 +0000)
committerddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jun 2006 04:39:24 +0000 (04:39 +0000)
        Reviewed by Darin.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9652
          Assertion failure when changing an RTL table cell to display:none

        Test: fast/table/rtl-cell-display-none-assert.html

        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::layoutRows): Corrected the index used as
        the last index in the columnPos vector.

LayoutTests:

        Reviewed by Darin.

        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9652
          Assertion failure when changing an RTL table cell to display:none

        * fast/table/rtl-cell-display-none-assert-expected.checksum: Added.
        * fast/table/rtl-cell-display-none-assert-expected.png: Added.
        * fast/table/rtl-cell-display-none-assert-expected.txt: Added.
        * fast/table/rtl-cell-display-none-assert.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15101 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/table/rtl-cell-display-none-assert-expected.checksum [new file with mode: 0644]
LayoutTests/fast/table/rtl-cell-display-none-assert-expected.png [new file with mode: 0644]
LayoutTests/fast/table/rtl-cell-display-none-assert-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/rtl-cell-display-none-assert.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderTableSection.cpp

index ed7c16b3f4b2efdb80bf21ddc1bef56d3dbec448..6b6c274084277903e4025d622fa9af2bd0f9b9b0 100644 (file)
@@ -1,3 +1,15 @@
+2006-06-29  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin.
+
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9652
+          Assertion failure when changing an RTL table cell to display:none
+
+        * fast/table/rtl-cell-display-none-assert-expected.checksum: Added.
+        * fast/table/rtl-cell-display-none-assert-expected.png: Added.
+        * fast/table/rtl-cell-display-none-assert-expected.txt: Added.
+        * fast/table/rtl-cell-display-none-assert.html: Added.
+
 2006-06-29  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Hyatt.
diff --git a/LayoutTests/fast/table/rtl-cell-display-none-assert-expected.checksum b/LayoutTests/fast/table/rtl-cell-display-none-assert-expected.checksum
new file mode 100644 (file)
index 0000000..7aa4f5f
--- /dev/null
@@ -0,0 +1,2 @@
+82c37f42f49747efd11a48f48f3b7451
+\ No newline at end of file
diff --git a/LayoutTests/fast/table/rtl-cell-display-none-assert-expected.png b/LayoutTests/fast/table/rtl-cell-display-none-assert-expected.png
new file mode 100644 (file)
index 0000000..e250918
Binary files /dev/null and b/LayoutTests/fast/table/rtl-cell-display-none-assert-expected.png differ
diff --git a/LayoutTests/fast/table/rtl-cell-display-none-assert-expected.txt b/LayoutTests/fast/table/rtl-cell-display-none-assert-expected.txt
new file mode 100644 (file)
index 0000000..555970d
--- /dev/null
@@ -0,0 +1,28 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 172x18
+          text run at (0,0) width 172: "This is a regression test for "
+        RenderInline {I} at (0,0) size 781x36
+          RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
+            RenderText {#text} at (172,0) size 348x18
+              text run at (172,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9652"
+          RenderText {#text} at (520,0) size 781x36
+            text run at (520,0) width 4: " "
+            text run at (524,0) width 257: "Assertion failure when changing an RTL"
+            text run at (0,18) width 158: "table cell to display:none"
+        RenderText {#text} at (158,18) size 4x18
+          text run at (158,18) width 4: "."
+      RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,70) size 784x18
+        RenderText {#text} at (0,0) size 257x18
+          text run at (0,0) width 257: "No assertion failure means TEST PASS."
+      RenderTable {TABLE} at (0,104) size 50x26 [border: (1px solid #008000)]
+        RenderTableSection {TBODY} at (1,1) size 48x24
+          RenderTableRow {TR} at (0,2) size 48x20
+            RenderTableCell {TD} at (2,2) size 44x20 [r=0 c=0 rs=1 cs=1]
+              RenderText {#text} at (1,1) size 42x18
+                text run at (1,1) width 42: "Lorem"
diff --git a/LayoutTests/fast/table/rtl-cell-display-none-assert.html b/LayoutTests/fast/table/rtl-cell-display-none-assert.html
new file mode 100644 (file)
index 0000000..9eab756
--- /dev/null
@@ -0,0 +1,29 @@
+<html>
+<head>
+    <title></title>
+    <script type="text/javascript">
+        function test()
+        {
+            document.body.offsetTop;
+            document.getElementById('t').style.display='none';
+        }
+    </script>
+</head>
+<body onload="test()">
+    <p>
+        This is a regression test for
+        <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=9652">http://bugzilla.opendarwin.org/show_bug.cgi?id=9652</a>
+        Assertion failure when changing an RTL table cell to display:none</i>.
+    </p>
+    <hr>
+    <p>
+        No assertion failure means TEST PASS.
+    </p>
+    <table dir="rtl" style="border: 1px solid green;"> 
+        <tr>
+            <td>Lorem</td>
+            <td id="t">ipsum</td>
+        </tr>
+    </table>
+</body>
+</html>
index f9f70af8ba1f59e7cb3d17d3b3adcb588cdb28ac..686dc0c62d472750a51fd9e3e589d2705c567400 100644 (file)
@@ -1,3 +1,16 @@
+2006-06-29  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9652
+          Assertion failure when changing an RTL table cell to display:none
+
+        Test: fast/table/rtl-cell-display-none-assert.html
+
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::layoutRows): Corrected the index used as
+        the last index in the columnPos vector.
+
 2006-06-29  Darin Adler  <darin@apple.com>
 
         Reviewed by Anders.
index e37ea162adbcf36b9a5d38dc5ba70f0a3f6953f1..b6aedf918918dcff754f8f85a66790b0d2454e7c 100644 (file)
@@ -447,9 +447,6 @@ int RenderTableSection::layoutRows(int toAdd)
 
     int nEffCols = table()->numEffCols();
     for (int r = 0; r < totalRows; r++) {
-        Row *row = grid[r].row;
-        int totalCols = row->size();
-        
         // Set the row's x/y position and width/height.
         if (grid[r].rowRenderer) {
             grid[r].rowRenderer->setPos(0, rowPos[r]);
@@ -548,7 +545,7 @@ int RenderTableSection::layoutRows(int toAdd)
         
             if (style()->direction() == RTL) {
                 cell->setPos(
-                    table()->columnPos[(int)totalCols] -
+                    table()->columnPos[nEffCols] -
                     table()->columnPos[table()->colToEffCol(cell->col()+cell->colSpan())] +
                     leftOffset,
                     rowPos[rindx]);