[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

dbates at webkit.org dbates at webkit.org
Wed Apr 7 23:47:57 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit e113183194bf6d512ebc737d1585fdf924c7fec0
Author: dbates at webkit.org <dbates at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 19 00:05:57 2009 +0000

    2009-11-18  Daniel Bates  <dbates at webkit.org>
    
            Reviewed by Dave Hyatt.
    
            https://bugs.webkit.org/show_bug.cgi?id=24971
            And
            <rdar://problem/7138265>
    
            Fixes an issue where setting the height of a table row programmatically
            (via JavaScript) causes the table to be improperly rendered because the
            height of each row in the table is not recalculated with respect to the
            CSS height property.
    
            In particular, programmatically setting the height of some table row causes
            the rows of that table to be rendered with a height equal to the minimum
            height required by the cells in that row, regardless of any specified cell
            heights. Instead, when RenderTableSection::recalcCells is called, the height
            of each row should be set to the CSS height property just as we do in
            RenderTableSection::addChild.
    
            Test: fast/table/row-height-recalc2.html
    
            * rendering/RenderTableSection.cpp:
            (WebCore::setRowHeightToRowStyleHeightIfNotRelative): Added.
            (WebCore::RenderTableSection::addChild): Moved code that set row height into
            method WebCore::setRowHeightToRowStyleHeightIfNotRelative.
            (WebCore::RenderTableSection::recalcCells): Modified to call
            WebCore::setRowHeightToRowStyleHeightIfNotRelative.
    2009-11-18  Daniel Bates  <dbates at webkit.org>
    
            Reviewed by Dave Hyatt.
    
            https://bugs.webkit.org/show_bug.cgi?id=24971
            And
            <rdar://problem/7138265>
    
            Tests that setting the height of a table row programmatically (via JavaScript)
            recalculates the height of the rows in the table.
    
            * fast/table/row-height-recalc2.html: Added.
            * platform/mac/fast/table/row-height-recalc2-expected.checksum: Added.
            * platform/mac/fast/table/row-height-recalc2-expected.png: Added.
            * platform/mac/fast/table/row-height-recalc2-expected.txt: Added.
            * platform/qt/fast/table/row-height-recalc2-expected.checksum: Added.
            * platform/qt/fast/table/row-height-recalc2-expected.png: Added.
            * platform/qt/fast/table/row-height-recalc2-expected.txt: Added.
            * platform/win/fast/table/row-height-recalc2-expected.checksum: Added.
            * platform/win/fast/table/row-height-recalc2-expected.png: Added.
            * platform/win/fast/table/row-height-recalc2-expected.txt: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51151 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3d06f71..f113340 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,25 @@
+2009-11-18  Daniel Bates  <dbates at webkit.org>
+
+        Reviewed by Dave Hyatt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24971
+        And
+        <rdar://problem/7138265>
+
+        Tests that setting the height of a table row programmatically (via JavaScript)
+        recalculates the height of the rows in the table.
+
+        * fast/table/row-height-recalc2.html: Added.
+        * platform/mac/fast/table/row-height-recalc2-expected.checksum: Added.
+        * platform/mac/fast/table/row-height-recalc2-expected.png: Added.
+        * platform/mac/fast/table/row-height-recalc2-expected.txt: Added.
+        * platform/qt/fast/table/row-height-recalc2-expected.checksum: Added.
+        * platform/qt/fast/table/row-height-recalc2-expected.png: Added.
+        * platform/qt/fast/table/row-height-recalc2-expected.txt: Added.
+        * platform/win/fast/table/row-height-recalc2-expected.checksum: Added.
+        * platform/win/fast/table/row-height-recalc2-expected.png: Added.
+        * platform/win/fast/table/row-height-recalc2-expected.txt: Added.
+
 2009-11-18  Julie Parent  <jparent at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/table/row-height-recalc2.html b/LayoutTests/fast/table/row-height-recalc2.html
new file mode 100644
index 0000000..416dcb5
--- /dev/null
+++ b/LayoutTests/fast/table/row-height-recalc2.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+</head>
+<body>
+<p>
+    Test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=24971">https://bugs.webkit.org/show_bug.cgi?id=24971</a>
+    Setting style.height = value in javascript doesn't work in tablerows(&lt;tr&gt;)</i>. This test PASSED if and only if you
+    see a solid green rectangle below.
+</p>
+<hr>
+<table cellspacing="0" cellpadding="0" style="height: 100px">
+    <tr style="background: green;" id="t">
+        <td style="width: 50px; height: 50px"></td>
+    </tr>
+    <tr style="background: red;">
+        <td></td>
+    </tr>
+</table>
+<script type="text/javascript">
+    document.getElementById("t").style.height='100px';
+</script>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/fast/table/row-height-recalc2-expected.checksum b/LayoutTests/platform/mac/fast/table/row-height-recalc2-expected.checksum
new file mode 100644
index 0000000..abc5675
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/table/row-height-recalc2-expected.checksum
@@ -0,0 +1 @@
+6ab31599637a0237d77e616dbcdf5b96
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/table/row-height-recalc2-expected.png b/LayoutTests/platform/mac/fast/table/row-height-recalc2-expected.png
new file mode 100644
index 0000000..e1c33d8
Binary files /dev/null and b/LayoutTests/platform/mac/fast/table/row-height-recalc2-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/table/row-height-recalc2-expected.txt b/LayoutTests/platform/mac/fast/table/row-height-recalc2-expected.txt
new file mode 100644
index 0000000..95b28ed
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/table/row-height-recalc2-expected.txt
@@ -0,0 +1,26 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x186
+  RenderBlock {HTML} at (0,0) size 800x186
+    RenderBody {BODY} at (8,16) size 784x162
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 53x18
+          text run at (0,0) width 53: "Test for "
+        RenderInline {I} at (0,0) size 717x36
+          RenderInline {A} at (0,0) size 307x18 [color=#0000EE]
+            RenderText {#text} at (53,0) size 307x18
+              text run at (53,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=24971"
+          RenderText {#text} at (360,0) size 717x36
+            text run at (360,0) width 4: " "
+            text run at (364,0) width 353: "Setting style.height = value in javascript doesn't work in"
+            text run at (0,18) width 104: "tablerows(<tr>)"
+        RenderText {#text} at (104,18) size 455x18
+          text run at (104,18) width 243: ". This test PASSED if and only if you "
+          text run at (347,18) width 212: "see a solid green rectangle below."
+      RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
+      RenderTable {TABLE} at (0,62) size 50x100
+        RenderTableSection {TBODY} at (0,0) size 50x100
+          RenderTableRow {TR} at (0,0) size 50x100 [bgcolor=#008000]
+            RenderTableCell {TD} at (0,50) size 50x0 [r=0 c=0 rs=1 cs=1]
+          RenderTableRow {TR} at (0,100) size 50x0 [bgcolor=#FF0000]
+            RenderTableCell {TD} at (0,100) size 50x0 [r=1 c=0 rs=1 cs=1]
diff --git a/LayoutTests/platform/qt/fast/table/row-height-recalc2-expected.checksum b/LayoutTests/platform/qt/fast/table/row-height-recalc2-expected.checksum
new file mode 100644
index 0000000..f4b23ca
--- /dev/null
+++ b/LayoutTests/platform/qt/fast/table/row-height-recalc2-expected.checksum
@@ -0,0 +1 @@
+c7bf474e1af578eeea0d3894f03f4510
\ No newline at end of file
diff --git a/LayoutTests/platform/qt/fast/table/row-height-recalc2-expected.png b/LayoutTests/platform/qt/fast/table/row-height-recalc2-expected.png
new file mode 100644
index 0000000..e243945
Binary files /dev/null and b/LayoutTests/platform/qt/fast/table/row-height-recalc2-expected.png differ
diff --git a/LayoutTests/platform/qt/fast/table/row-height-recalc2-expected.txt b/LayoutTests/platform/qt/fast/table/row-height-recalc2-expected.txt
new file mode 100644
index 0000000..bc4d0be
--- /dev/null
+++ b/LayoutTests/platform/qt/fast/table/row-height-recalc2-expected.txt
@@ -0,0 +1,26 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x192
+  RenderBlock {HTML} at (0,0) size 800x192
+    RenderBody {BODY} at (8,16) size 784x168
+      RenderBlock {P} at (0,0) size 784x42
+        RenderText {#text} at (0,0) size 57x21
+          text run at (0,0) width 57: "Test for "
+        RenderInline {I} at (0,0) size 771x42
+          RenderInline {A} at (0,0) size 337x21 [color=#0000EE]
+            RenderText {#text} at (57,0) size 337x21
+              text run at (57,0) width 337: "https://bugs.webkit.org/show_bug.cgi?id=24971"
+          RenderText {#text} at (394,0) size 771x42
+            text run at (394,0) width 4: " "
+            text run at (398,0) width 373: "Setting style.height = value in javascript doesn't work"
+            text run at (0,21) width 123: "in tablerows(<tr>)"
+        RenderText {#text} at (123,21) size 505x21
+          text run at (123,21) width 262: ". This test PASSED if and only if you "
+          text run at (385,21) width 243: "see a solid green rectangle below."
+      RenderBlock {HR} at (0,58) size 784x2 [border: (1px inset #000000)]
+      RenderTable {TABLE} at (0,68) size 50x100
+        RenderTableSection {TBODY} at (0,0) size 50x100
+          RenderTableRow {TR} at (0,0) size 50x100 [bgcolor=#008000]
+            RenderTableCell {TD} at (0,50) size 50x0 [r=0 c=0 rs=1 cs=1]
+          RenderTableRow {TR} at (0,100) size 50x0 [bgcolor=#FF0000]
+            RenderTableCell {TD} at (0,100) size 50x0 [r=1 c=0 rs=1 cs=1]
diff --git a/LayoutTests/platform/win/fast/table/row-height-recalc2-expected.checksum b/LayoutTests/platform/win/fast/table/row-height-recalc2-expected.checksum
new file mode 100644
index 0000000..423cb2b
--- /dev/null
+++ b/LayoutTests/platform/win/fast/table/row-height-recalc2-expected.checksum
@@ -0,0 +1 @@
+1e53fda7feb899331e82e1b7f4d99dd3
\ No newline at end of file
diff --git a/LayoutTests/platform/win/fast/table/row-height-recalc2-expected.png b/LayoutTests/platform/win/fast/table/row-height-recalc2-expected.png
new file mode 100644
index 0000000..db6d7f3
Binary files /dev/null and b/LayoutTests/platform/win/fast/table/row-height-recalc2-expected.png differ
diff --git a/LayoutTests/platform/win/fast/table/row-height-recalc2-expected.txt b/LayoutTests/platform/win/fast/table/row-height-recalc2-expected.txt
new file mode 100644
index 0000000..c7394ee
--- /dev/null
+++ b/LayoutTests/platform/win/fast/table/row-height-recalc2-expected.txt
@@ -0,0 +1,26 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x192
+  RenderBlock {HTML} at (0,0) size 800x192
+    RenderBody {BODY} at (8,16) size 784x168
+      RenderBlock {P} at (0,0) size 784x42
+        RenderText {#text} at (0,0) size 53x20
+          text run at (0,0) width 53: "Test for "
+        RenderInline {I} at (0,0) size 717x41
+          RenderInline {A} at (0,0) size 307x20 [color=#0000EE]
+            RenderText {#text} at (53,0) size 307x20
+              text run at (53,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=24971"
+          RenderText {#text} at (360,0) size 717x41
+            text run at (360,0) width 4: " "
+            text run at (364,0) width 353: "Setting style.height = value in javascript doesn't work in"
+            text run at (0,21) width 104: "tablerows(<tr>)"
+        RenderText {#text} at (104,21) size 455x20
+          text run at (104,21) width 243: ". This test PASSED if and only if you "
+          text run at (347,21) width 212: "see a solid green rectangle below."
+      RenderBlock {HR} at (0,58) size 784x2 [border: (1px inset #000000)]
+      RenderTable {TABLE} at (0,68) size 50x100
+        RenderTableSection {TBODY} at (0,0) size 50x100
+          RenderTableRow {TR} at (0,0) size 50x100 [bgcolor=#008000]
+            RenderTableCell {TD} at (0,50) size 50x0 [r=0 c=0 rs=1 cs=1]
+          RenderTableRow {TR} at (0,100) size 50x0 [bgcolor=#FF0000]
+            RenderTableCell {TD} at (0,100) size 50x0 [r=1 c=0 rs=1 cs=1]
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6e07ec4..48c60bd 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,32 @@
+2009-11-18  Daniel Bates  <dbates at webkit.org>
+
+        Reviewed by Dave Hyatt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24971
+        And
+        <rdar://problem/7138265>
+
+        Fixes an issue where setting the height of a table row programmatically
+        (via JavaScript) causes the table to be improperly rendered because the
+        height of each row in the table is not recalculated with respect to the
+        CSS height property.
+
+        In particular, programmatically setting the height of some table row causes
+        the rows of that table to be rendered with a height equal to the minimum
+        height required by the cells in that row, regardless of any specified cell
+        heights. Instead, when RenderTableSection::recalcCells is called, the height
+        of each row should be set to the CSS height property just as we do in
+        RenderTableSection::addChild.
+
+        Test: fast/table/row-height-recalc2.html
+
+        * rendering/RenderTableSection.cpp:
+        (WebCore::setRowHeightToRowStyleHeightIfNotRelative): Added.
+        (WebCore::RenderTableSection::addChild): Moved code that set row height into
+        method WebCore::setRowHeightToRowStyleHeightIfNotRelative.
+        (WebCore::RenderTableSection::recalcCells): Modified to call
+        WebCore::setRowHeightToRowStyleHeightIfNotRelative.
+
 2009-11-18  Zoltan Horvath  <zoltan at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp
index b8ac497..634380b 100644
--- a/WebCore/rendering/RenderTableSection.cpp
+++ b/WebCore/rendering/RenderTableSection.cpp
@@ -42,6 +42,14 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
+static inline void setRowHeightToRowStyleHeightIfNotRelative(RenderTableSection::RowStruct* row)
+{
+    ASSERT(row && row->rowRenderer);
+    row->height = row->rowRenderer->style()->height();
+    if (row->height.isRelative())
+        row->height = Length();
+}
+
 RenderTableSection::RenderTableSection(Node* node)
     : RenderBox(node)
     , m_gridRows(0)
@@ -122,11 +130,8 @@ void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild
 
     m_grid[m_cRow].rowRenderer = toRenderTableRow(child);
 
-    if (!beforeChild) {
-        m_grid[m_cRow].height = child->style()->height();
-        if (m_grid[m_cRow].height.isRelative())
-            m_grid[m_cRow].height = Length();
-    }
+    if (!beforeChild)
+        setRowHeightToRowStyleHeightIfNotRelative(&m_grid[m_cRow]);
 
     // If the next renderer is actually wrapped in an anonymous table row, we need to go up and find that.
     while (beforeChild && beforeChild->parent() != this)
@@ -1083,6 +1088,7 @@ void RenderTableSection::recalcCells()
             
             RenderTableRow* tableRow = toRenderTableRow(row);
             m_grid[m_cRow].rowRenderer = tableRow;
+            setRowHeightToRowStyleHeightIfNotRelative(&m_grid[m_cRow]);
 
             for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {
                 if (cell->isTableCell())

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list