Title: [104095] branches/safari-534.54-branch

Diff

Modified: branches/safari-534.54-branch/LayoutTests/ChangeLog (104094 => 104095)


--- branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-05 00:31:10 UTC (rev 104094)
+++ branches/safari-534.54-branch/LayoutTests/ChangeLog	2012-01-05 00:35:53 UTC (rev 104095)
@@ -1,5 +1,21 @@
 2011-1-4  Lucas Forschler  <[email protected]>
 
+    Merge 97074
+
+    2011-10-10  Abhishek Arya  <[email protected]>
+
+            Handle insertion into an anonymous table part that
+            is followed by a non-anonymous block correctly.
+            https://bugs.webkit.org/show_bug.cgi?id=69536
+
+            Reviewed by Dan Bernstein.
+
+            * fast/table/table-insert-before-non-anonymous-block-expected.png: Added.
+            * fast/table/table-insert-before-non-anonymous-block-expected.txt: Added.
+            * fast/table/table-insert-before-non-anonymous-block.html: Added.
+
+2011-1-4  Lucas Forschler  <[email protected]>
+
     Merge 96999
 
     2011-10-07  Justin Schuh  <[email protected]>

Copied: branches/safari-534.54-branch/LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.png (from rev 97074, trunk/LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.png)


(Binary files differ)

Copied: branches/safari-534.54-branch/LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.txt (from rev 97074, trunk/LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.txt) (0 => 104095)


--- branches/safari-534.54-branch/LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.txt	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/table/table-insert-before-non-anonymous-block-expected.txt	2012-01-05 00:35:53 UTC (rev 104095)
@@ -0,0 +1,55 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x466
+  RenderBlock {HTML} at (0,0) size 800x466
+    RenderBody {BODY} at (8,8) size 784x450
+      RenderTable {DIV} at (0,0) size 100x50
+        RenderTableSection (anonymous) at (0,0) size 100x50
+          RenderTableRow (anonymous) at (0,0) size 100x50
+            RenderTableCell {DIV} at (0,0) size 50x0 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1]
+            RenderTableCell {DIV} at (50,0) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1]
+        RenderTableSection {DIV} at (0,50) size 100x0
+      RenderTable {DIV} at (0,50) size 100x50
+        RenderTableSection (anonymous) at (0,0) size 100x50
+          RenderTableRow (anonymous) at (0,0) size 100x50
+            RenderTableCell {DIV} at (0,0) size 50x0 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1]
+            RenderTableCell {DIV} at (50,0) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1]
+          RenderTableRow {DIV} at (0,50) size 100x0
+      RenderTable {DIV} at (0,100) size 100x50
+        RenderTableSection (anonymous) at (0,0) size 100x50
+          RenderTableRow (anonymous) at (0,0) size 100x50
+            RenderTableCell {DIV} at (0,0) size 50x0 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1]
+            RenderTableCell {DIV} at (50,0) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1]
+        RenderBlock {DIV} at (0,0) size 100x0
+      RenderTable {DIV} at (0,150) size 100x50
+        RenderTableSection (anonymous) at (0,0) size 100x50
+          RenderTableRow (anonymous) at (0,0) size 100x50
+            RenderTableCell {DIV} at (0,0) size 50x0 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1]
+            RenderTableCell {DIV} at (50,0) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1]
+        RenderTableCol {DIV} at (0,0) size 0x0
+      RenderTable {DIV} at (0,200) size 50x50
+        RenderTableSection (anonymous) at (0,0) size 50x50
+          RenderTableRow (anonymous) at (0,0) size 50x50
+            RenderTableCell {DIV} at (0,0) size 50x0 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1]
+          RenderTableRow {DIV} at (0,50) size 50x0
+        RenderTableSection {DIV} at (0,50) size 50x0
+      RenderTable {DIV} at (0,250) size 100x50
+        RenderTableSection (anonymous) at (0,0) size 100x50
+          RenderTableRow (anonymous) at (0,0) size 100x50
+            RenderTableCell {DIV} at (0,0) size 50x0 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1]
+            RenderTableCell {DIV} at (50,0) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1]
+        RenderTableCol {DIV} at (0,0) size 0x0
+      RenderTable {DIV} at (0,300) size 101x50
+        RenderTableSection (anonymous) at (0,0) size 101x50
+          RenderTableRow (anonymous) at (0,0) size 101x50
+            RenderTableCell {DIV} at (0,0) size 50x0 [bgcolor=#0000FF] [r=0 c=0 rs=1 cs=1]
+            RenderTableCell {DIV} at (50,0) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1]
+            RenderTableCell (anonymous) at (100,0) size 1x0 [r=0 c=2 rs=1 cs=1]
+              RenderBlock {DIV} at (0,0) size 1x0
+      RenderTable {DIV} at (0,350) size 100x100
+        RenderTableSection (anonymous) at (0,0) size 100x100
+          RenderTableRow (anonymous) at (0,0) size 100x100
+            RenderTableCell (anonymous) at (0,0) size 50x100 [r=0 c=0 rs=1 cs=1]
+              RenderBlock {DIV} at (0,0) size 50x50 [bgcolor=#0000FF]
+              RenderBlock {DIV} at (0,50) size 50x50 [bgcolor=#0000FF]
+            RenderTableCell {DIV} at (50,0) size 50x0 [bgcolor=#0000FF] [r=0 c=1 rs=1 cs=1]

Copied: branches/safari-534.54-branch/LayoutTests/fast/table/table-insert-before-non-anonymous-block.html (from rev 97074, trunk/LayoutTests/fast/table/table-insert-before-non-anonymous-block.html) (0 => 104095)


--- branches/safari-534.54-branch/LayoutTests/fast/table/table-insert-before-non-anonymous-block.html	                        (rev 0)
+++ branches/safari-534.54-branch/LayoutTests/fast/table/table-insert-before-non-anonymous-block.html	2012-01-05 00:35:53 UTC (rev 104095)
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<html>
+<body style="font-family: ahem; -webkit-font-smoothing: none;">
+<style>
+    div.table { display: table; }
+    div.section { display: table-row-group; }
+    div.caption { display: table-caption; }
+    div.colgroup { display: table-column-group; }
+    div.col { display: table-column; }
+    div.cell { display: table-cell; width: 50px; height: 50px; background-color: blue; }
+    div.row { display: table-row; }
+    div.block { width: 50px; height: 50px; background-color: blue; }
+</style>
+
+<div class="table" id="table-1">
+    <div class="cell"></div>
+    <div class="section" id="tbody-1">
+    </div>
+</div>
+
+<div class="table" id="table-2">
+    <div class="cell"></div>
+    <div class="row" id="row"></div>
+</div>
+
+<div class="table" id="table-3">
+    <div class="cell"></div>
+    <div class="caption" id="caption">
+    </div>
+</div>
+
+<div class="table" id="table-4">
+    <div class="cell"></div>
+    <div class="colgroup" id="colgroup">
+    </div>
+</div>
+
+<div class="table" id="table-5">
+    <div class="cell"></div>
+    <div class="section" id="tbody-5">
+    </div>
+</div>
+
+<div class="table" id="table-6">
+    <div class="cell"></div>
+    <div class="col" id="col-6">
+    </div>
+</div>
+
+<div class="table" id="table-7">
+    <div class="cell"></div>
+    <div id="block">
+    </div>
+</div>
+
+<div class="table" id="table-8">
+    <div class="block"></div>
+    <div class="cell" id="cell"></div>
+</div>
+
+<script>
+    function createCell()
+    {
+        var cell = document.createElement("div");
+        cell.className = "cell";
+        return cell;
+    }
+
+    function insertCell(tableID, beforeID)
+    {
+        var table = document.getElementById(tableID);
+        var before = document.getElementById(beforeID);
+        table.insertBefore(createCell(), before);
+    }
+
+    function createRow()
+    {
+        var row = document.createElement("div");
+        row.className = "row";
+        return row;
+    }
+
+    function insertRow(tableID, beforeID)
+    {
+        var table = document.getElementById(tableID);
+        var before = document.getElementById(beforeID);
+        table.insertBefore(createRow(), before);
+    }
+
+    function createBlock()
+    {
+        var block = document.createElement("div");
+        block.className = "block";
+        return block;
+    }
+
+    function insertBlock(tableID, beforeID)
+    {
+        var table = document.getElementById(tableID);
+        var before = document.getElementById(beforeID);
+        table.insertBefore(createBlock(), before);
+    }
+
+    document.body.offsetTop;
+
+    insertCell("table-1", "tbody-1");
+    insertCell("table-2", "row");
+    insertCell("table-3", "caption");
+    insertCell("table-4", "colgroup");
+    insertRow("table-5", "tbody-5");
+    insertCell("table-6", "col-6");
+    insertCell("table-7", "block");
+    insertBlock("table-8", "cell");
+</script>
+</body>
+</html>

Modified: branches/safari-534.54-branch/Source/WebCore/ChangeLog (104094 => 104095)


--- branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-05 00:31:10 UTC (rev 104094)
+++ branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-05 00:35:53 UTC (rev 104095)
@@ -1,5 +1,27 @@
 2011-1-4  Lucas Forschler  <[email protected]>
 
+    Merge 97074
+
+    2011-10-10  Abhishek Arya  <[email protected]>
+
+            Handle insertion into an anonymous table part that
+            is followed by a non-anonymous block correctly.
+            https://bugs.webkit.org/show_bug.cgi?id=69536
+
+            Reviewed by Dan Bernstein.
+
+            Tests: fast/table/table-insert-before-non-anonymous-block.html
+
+            * rendering/RenderTable.cpp:
+            (WebCore::RenderTable::addChild):
+            * rendering/RenderTableRow.cpp:
+            (WebCore::RenderTableRow::addChild):
+            * rendering/RenderTableSection.cpp:
+            (WebCore::RenderTableSection::addChild):
+            (WebCore::RenderTableSection::splitColumn):
+
+2011-1-4  Lucas Forschler  <[email protected]>
+
     Merge 96999
 
     2011-10-07  Justin Schuh  <[email protected]>

Modified: branches/safari-534.54-branch/Source/WebCore/rendering/RenderTable.cpp (104094 => 104095)


--- branches/safari-534.54-branch/Source/WebCore/rendering/RenderTable.cpp	2012-01-05 00:31:10 UTC (rev 104094)
+++ branches/safari-534.54-branch/Source/WebCore/rendering/RenderTable.cpp	2012-01-05 00:35:53 UTC (rev 104095)
@@ -179,6 +179,15 @@
         return;
     }
 
+    if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == this) {
+        RenderObject* section = beforeChild->previousSibling();
+        if (section && section->isTableSection()) {
+            ASSERT(section->isAnonymous());
+            section->addChild(child);
+            return;
+        }
+    }
+
     RenderObject* lastBox = beforeChild;
     while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableSection() && lastBox->style()->display() != TABLE_CAPTION && lastBox->style()->display() != TABLE_COLUMN_GROUP)
         lastBox = lastBox->parent();

Modified: branches/safari-534.54-branch/Source/WebCore/rendering/RenderTableRow.cpp (104094 => 104095)


--- branches/safari-534.54-branch/Source/WebCore/rendering/RenderTableRow.cpp	2012-01-05 00:31:10 UTC (rev 104094)
+++ branches/safari-534.54-branch/Source/WebCore/rendering/RenderTableRow.cpp	2012-01-05 00:35:53 UTC (rev 104095)
@@ -97,6 +97,15 @@
             return;
         }
 
+        if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == this) {
+            RenderObject* cell = beforeChild->previousSibling();
+            if (cell && cell->isTableCell()) {
+                ASSERT(cell->isAnonymous());
+                cell->addChild(child);
+                return;
+            }
+        }
+
         // If beforeChild is inside an anonymous cell, insert into the cell.
         if (last && !last->isTableCell() && last->parent() && last->parent()->isAnonymous() && !last->parent()->isBeforeOrAfterContent()) {
             last->parent()->addChild(child, beforeChild);

Modified: branches/safari-534.54-branch/Source/WebCore/rendering/RenderTableSection.cpp (104094 => 104095)


--- branches/safari-534.54-branch/Source/WebCore/rendering/RenderTableSection.cpp	2012-01-05 00:31:10 UTC (rev 104094)
+++ branches/safari-534.54-branch/Source/WebCore/rendering/RenderTableSection.cpp	2012-01-05 00:35:53 UTC (rev 104095)
@@ -109,6 +109,15 @@
             return;
         }
 
+        if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == this) {
+            RenderObject* row = beforeChild->previousSibling();
+            if (row && row->isTableRow()) {
+                ASSERT(row->isAnonymous());
+                row->addChild(child);
+                return;
+            }
+        }
+
         // If beforeChild is inside an anonymous cell/row, insert into the cell or into
         // the anonymous row containing it, if there is one.
         RenderObject* lastBox = last;
@@ -1127,6 +1136,8 @@
 
 void RenderTableSection::splitColumn(int pos, int first)
 {
+    ASSERT(!m_needsCellRecalc);
+
     if (m_cCol > pos)
         m_cCol++;
     for (int row = 0; row < m_gridRows; ++row) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to