+2015-10-15 Zalan Bujtas <zalan@apple.com>
+
+ Anonymous table objects: Collapse anonymous table rows.
+ https://bugs.webkit.org/show_bug.cgi?id=150154
+
+ Reviewed by David Hyatt.
+
+ Merge anonymous table rows when they are not needed anymore.
+ Generated table rows can be collapsed into one when there's no
+ non-generated sibling table row left in the tree.
+
+ Import W3C CSS2.1 anonymous table tests.
+
+ * css2.1/tables/table-anonymous-objects-103.xht: Added.
+ * css2.1/tables/table-anonymous-objects-104.xht: Added.
+ * css2.1/tables/table-anonymous-objects-117.xht: Added.
+ * css2.1/tables/table-anonymous-objects-118.xht: Added.
+ * css2.1/tables/table-anonymous-objects-119.xht: Added.
+ * css2.1/tables/table-anonymous-objects-120.xht: Added.
+ * platform/mac/css2.1/tables/table-anonymous-objects-103-expected.txt: Added.
+ * platform/mac/css2.1/tables/table-anonymous-objects-104-expected.txt: Added.
+ * platform/mac/css2.1/tables/table-anonymous-objects-117-expected.txt: Added.
+ * platform/mac/css2.1/tables/table-anonymous-objects-118-expected.txt: Added.
+ * platform/mac/css2.1/tables/table-anonymous-objects-119-expected.txt: Added.
+ * platform/mac/css2.1/tables/table-anonymous-objects-120-expected.txt: Added.
+
2015-10-15 Brent Fulgham <bfulgham@apple.com>
[Win] Unreviewed gardenining after r190816.
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>CSS Test: Auto-imported from Gecko test dynamic-removal-3.html</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes"/>
+ <meta name="flags" content='dom'/>
+
+ <script type="text/javascript"><![CDATA[
+ function doTest() {
+ var t = document.getElementById("t");
+ t.parentNode.removeChild(t);
+ document.documentElement.className = "";
+ }
+ ]]></script>
+ </head>
+<body style="font-family: monospace" onload="doTest()">
+<p>There should be no red below, except for antialiasing issues.</p>
+<div style="position: relative; font-size: 2em;">
+<div style="position: relative; z-index: 1; color: red; padding: 1px;">
+
+ <span style="display: table-row-group">
+ <span style="display: table-cell">Row 1, Col 1</span>
+ <span style="display: table-cell">Row 1, Col 2</span>
+ <span style="display: table-cell">Row 1, Col 3</span>
+ </span>
+ <span style="display: table-row-group">
+ <span style="display: table-cell">Row 22, Col 1</span>
+ <span id="t" style="display: table-row">To be removed</span>
+ <span style="display: table-cell">Row 22, Col 2</span>
+ <span style="display: table-cell">Row 22, Col 3</span>
+ </span>
+ <span style="display: table-row-group">
+ <span style="display: table-cell">Row 333, Col 1</span>
+ <span style="display: table-cell">Row 333, Col 2</span>
+ <span style="display: table-cell">Row 333, Col 3</span>
+ </span>
+ </div>
+<div style="position: absolute; z-index: 2; top: 0; color: green; padding: 1px;">
+
+ <table cellpadding="0" cellspacing="0" style="margin: 0; padding: 0; border: none">
+ <tr>
+ <td>Row 1, Col 1</td>
+ <td>Row 1, Col 2</td>
+ <td>Row 1, Col 3</td>
+ </tr>
+ <tr>
+ <td>Row 22, Col 1</td>
+ <td>Row 22, Col 2</td>
+ <td>Row 22, Col 3</td>
+ </tr>
+ <tr>
+ <td>Row 333, Col 1</td>
+ <td>Row 333, Col 2</td>
+ <td>Row 333, Col 3</td>
+ </tr>
+ </table>
+ </div>
+</div>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>CSS Test: Auto-imported from Gecko test dynamic-removal-3.html</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes"/>
+ <meta name="flags" content='dom'/>
+
+ <script type="text/javascript"><![CDATA[
+ function doTest() {
+ var t = document.getElementById("t");
+ t.parentNode.removeChild(t);
+ document.documentElement.className = "";
+ }
+ ]]></script>
+ </head>
+<body style="font-family: monospace" onload="doTest()">
+<p>There should be no red below, except for antialiasing issues.</p>
+<div style="position: relative; font-size: 2em;">
+<div style="position: absolute; z-index: 2; top: 0; color: green; padding: 1px;">
+
+ <span style="display: table-row-group">
+ <span style="display: table-cell">Row 1, Col 1</span>
+ <span style="display: table-cell">Row 1, Col 2</span>
+ <span style="display: table-cell">Row 1, Col 3</span>
+ </span>
+ <span style="display: table-row-group">
+ <span style="display: table-cell">Row 22, Col 1</span>
+ <span id="t" style="display: table-row">To be removed</span>
+ <span style="display: table-cell">Row 22, Col 2</span>
+ <span style="display: table-cell">Row 22, Col 3</span>
+ </span>
+ <span style="display: table-row-group">
+ <span style="display: table-cell">Row 333, Col 1</span>
+ <span style="display: table-cell">Row 333, Col 2</span>
+ <span style="display: table-cell">Row 333, Col 3</span>
+ </span>
+ </div>
+<div style="position: relative; z-index: 1; color: red; padding: 1px;">
+
+ <table cellpadding="0" cellspacing="0" style="margin: 0; padding: 0; border: none">
+ <tr>
+ <td>Row 1, Col 1</td>
+ <td>Row 1, Col 2</td>
+ <td>Row 1, Col 3</td>
+ </tr>
+ <tr>
+ <td>Row 22, Col 1</td>
+ <td>Row 22, Col 2</td>
+ <td>Row 22, Col 3</td>
+ </tr>
+ <tr>
+ <td>Row 333, Col 1</td>
+ <td>Row 333, Col 2</td>
+ <td>Row 333, Col 3</td>
+ </tr>
+ </table>
+ </div>
+</div>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>CSS Test: Auto-imported from Gecko test dynamic-removal-10.html</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes"/>
+ <meta name="flags" content='dom'/>
+
+ <script type="text/javascript"><![CDATA[
+ function doTest() {
+ var t = document.getElementById("t");
+ t.parentNode.removeChild(t);
+ document.documentElement.className = "";
+ }
+ ]]></script>
+ </head>
+<body onload="doTest()">
+<p>There should be no red below, except for antialiasing issues.</p>
+<div style="position: relative; font-size: 2em;">
+<div style="position: relative; z-index: 1; color: red; padding: 1px;">
+
+ <span>
+ <span>a</span><span id="t" style="display: table-column-group"></span>
+ <span style="display: table-column-group"></span><span>bc d</span>
+ </span>
+ </div>
+<div style="position: absolute; z-index: 2; top: 0; color: green; padding: 1px;">
+
+ abc d
+ </div>
+</div>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>CSS Test: Auto-imported from Gecko test dynamic-removal-10.html</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes"/>
+ <meta name="flags" content='dom'/>
+
+ <script type="text/javascript"><![CDATA[
+ function doTest() {
+ var t = document.getElementById("t");
+ t.parentNode.removeChild(t);
+ document.documentElement.className = "";
+ }
+ ]]></script>
+ </head>
+<body onload="doTest()">
+<p>There should be no red below, except for antialiasing issues.</p>
+<div style="position: relative; font-size: 2em;">
+<div style="position: absolute; z-index: 2; top: 0; color: green; padding: 1px;">
+
+ <span>
+ <span>a</span><span id="t" style="display: table-column-group"></span>
+ <span style="display: table-column-group"></span><span>bc d</span>
+ </span>
+ </div>
+<div style="position: relative; z-index: 1; color: red; padding: 1px;">
+
+ abc d
+ </div>
+</div>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>CSS Test: Auto-imported from Gecko test dynamic-removal-11.html</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes"/>
+ <meta name="flags" content='dom'/>
+
+ <script type="text/javascript"><![CDATA[
+ function doTest() {
+ var t = document.getElementById("t");
+ t.parentNode.removeChild(t);
+ document.documentElement.className = "";
+ }
+ ]]></script>
+ </head>
+<body onload="doTest()">
+<p>There should be no red below, except for antialiasing issues.</p>
+<div style="position: relative; font-size: 2em;">
+<div style="position: relative; z-index: 1; color: red; padding: 1px;">
+
+ <span>
+ <span>a</span><span id="t" style="display: table-caption"></span>
+ <span style="display: table-caption"></span><span>bc d</span>
+ </span>
+ </div>
+<div style="position: absolute; z-index: 2; top: 0; color: green; padding: 1px;">
+
+ abc d
+ </div>
+</div>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>CSS Test: Auto-imported from Gecko test dynamic-removal-11.html</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu"/>
+ <link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes"/>
+ <meta name="flags" content='dom'/>
+
+ <script type="text/javascript"><![CDATA[
+ function doTest() {
+ var t = document.getElementById("t");
+ t.parentNode.removeChild(t);
+ document.documentElement.className = "";
+ }
+ ]]></script>
+ </head>
+<body onload="doTest()">
+<p>There should be no red below, except for antialiasing issues.</p>
+<div style="position: relative; font-size: 2em;">
+<div style="position: absolute; z-index: 2; top: 0; color: green; padding: 1px;">
+
+ <span>
+ <span>a</span><span id="t" style="display: table-caption"></span>
+ <span style="display: table-caption"></span><span>bc d</span>
+ </span>
+ </div>
+<div style="position: relative; z-index: 1; color: red; padding: 1px;">
+
+ abc d
+ </div>
+</div>
+</body>
+</html>
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x141
+ RenderBlock {html} at (0,0) size 800x141
+ RenderBody {body} at (8,13) size 784x120
+ RenderBlock {p} at (0,0) size 784x15
+ RenderText {#text} at (0,0) size 476x15
+ text run at (0,0) width 476: "There should be no red below, except for antialiasing issues."
+layer at (8,41) size 784x92
+ RenderBlock (relative positioned) {div} at (0,28) size 784x92
+layer at (8,41) size 784x92
+ RenderBlock (relative positioned) zI: 1 {div} at (0,0) size 784x92 [color=#FF0000]
+ RenderTable at (1,1) size 657x90
+ RenderTableSection {span} at (0,0) size 657x30
+ RenderTableRow (anonymous) at (0,0) size 657x30
+ RenderTableCell {span} at (0,0) size 219x30 [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 1"
+ RenderTableCell {span} at (219,0) size 219x30 [r=0 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 2"
+ RenderTableCell {span} at (438,0) size 219x30 [r=0 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 3"
+ RenderTableSection {span} at (0,30) size 657x30
+ RenderTableRow (anonymous) at (0,0) size 657x30
+ RenderTableCell {span} at (0,0) size 219x30 [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 1"
+ RenderTableCell {span} at (219,0) size 219x30 [r=0 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 2"
+ RenderTableCell {span} at (438,0) size 219x30 [r=0 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 3"
+ RenderTableSection {span} at (0,60) size 657x30
+ RenderTableRow (anonymous) at (0,0) size 657x30
+ RenderTableCell {span} at (0,0) size 219x30 [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 1"
+ RenderTableCell {span} at (219,0) size 219x30 [r=0 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 2"
+ RenderTableCell {span} at (438,0) size 219x30 [r=0 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 3"
+layer at (8,41) size 659x92
+ RenderBlock (positioned) zI: 2 {div} at (0,0) size 659x92 [color=#008000]
+ RenderTable {table} at (1,1) size 657x90
+ RenderTableSection (anonymous) at (0,0) size 657x90
+ RenderTableRow {tr} at (0,0) size 657x30
+ RenderTableCell {td} at (0,0) size 219x30 [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 1"
+ RenderTableCell {td} at (219,0) size 219x30 [r=0 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 2"
+ RenderTableCell {td} at (438,0) size 219x30 [r=0 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 3"
+ RenderTableRow {tr} at (0,30) size 657x30
+ RenderTableCell {td} at (0,30) size 219x30 [r=1 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 1"
+ RenderTableCell {td} at (219,30) size 219x30 [r=1 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 2"
+ RenderTableCell {td} at (438,30) size 219x30 [r=1 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 3"
+ RenderTableRow {tr} at (0,60) size 657x30
+ RenderTableCell {td} at (0,60) size 219x30 [r=2 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 1"
+ RenderTableCell {td} at (219,60) size 219x30 [r=2 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 2"
+ RenderTableCell {td} at (438,60) size 219x30 [r=2 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 3"
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x141
+ RenderBlock {html} at (0,0) size 800x141
+ RenderBody {body} at (8,13) size 784x120
+ RenderBlock {p} at (0,0) size 784x15
+ RenderText {#text} at (0,0) size 476x15
+ text run at (0,0) width 476: "There should be no red below, except for antialiasing issues."
+layer at (8,41) size 784x92
+ RenderBlock (relative positioned) {div} at (0,28) size 784x92
+layer at (8,41) size 784x92
+ RenderBlock (relative positioned) zI: 1 {div} at (0,0) size 784x92 [color=#FF0000]
+ RenderTable {table} at (1,1) size 657x90
+ RenderTableSection (anonymous) at (0,0) size 657x90
+ RenderTableRow {tr} at (0,0) size 657x30
+ RenderTableCell {td} at (0,0) size 219x30 [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 1"
+ RenderTableCell {td} at (219,0) size 219x30 [r=0 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 2"
+ RenderTableCell {td} at (438,0) size 219x30 [r=0 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 3"
+ RenderTableRow {tr} at (0,30) size 657x30
+ RenderTableCell {td} at (0,30) size 219x30 [r=1 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 1"
+ RenderTableCell {td} at (219,30) size 219x30 [r=1 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 2"
+ RenderTableCell {td} at (438,30) size 219x30 [r=1 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 3"
+ RenderTableRow {tr} at (0,60) size 657x30
+ RenderTableCell {td} at (0,60) size 219x30 [r=2 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 1"
+ RenderTableCell {td} at (219,60) size 219x30 [r=2 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 2"
+ RenderTableCell {td} at (438,60) size 219x30 [r=2 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 3"
+layer at (8,41) size 659x92
+ RenderBlock (positioned) zI: 2 {div} at (0,0) size 659x92 [color=#008000]
+ RenderTable at (1,1) size 657x90
+ RenderTableSection {span} at (0,0) size 657x30
+ RenderTableRow (anonymous) at (0,0) size 657x30
+ RenderTableCell {span} at (0,0) size 219x30 [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 1"
+ RenderTableCell {span} at (219,0) size 219x30 [r=0 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 2"
+ RenderTableCell {span} at (438,0) size 219x30 [r=0 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 188x30
+ text run at (0,0) width 188: "Row 1, Col 3"
+ RenderTableSection {span} at (0,30) size 657x30
+ RenderTableRow (anonymous) at (0,0) size 657x30
+ RenderTableCell {span} at (0,0) size 219x30 [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 1"
+ RenderTableCell {span} at (219,0) size 219x30 [r=0 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 2"
+ RenderTableCell {span} at (438,0) size 219x30 [r=0 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 203x30
+ text run at (0,0) width 203: "Row 22, Col 3"
+ RenderTableSection {span} at (0,60) size 657x30
+ RenderTableRow (anonymous) at (0,0) size 657x30
+ RenderTableCell {span} at (0,0) size 219x30 [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 1"
+ RenderTableCell {span} at (219,0) size 219x30 [r=0 c=1 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 2"
+ RenderTableCell {span} at (438,0) size 219x30 [r=0 c=2 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 219x30
+ text run at (0,0) width 219: "Row 333, Col 3"
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x97
+ RenderBlock {html} at (0,0) size 800x97
+ RenderBody {body} at (8,16) size 784x73
+ RenderBlock {p} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 386x18
+ text run at (0,0) width 386: "There should be no red below, except for antialiasing issues."
+layer at (8,50) size 784x39
+ RenderBlock (relative positioned) {div} at (0,34) size 784x39
+layer at (8,50) size 784x39
+ RenderBlock (relative positioned) zI: 1 {div} at (0,0) size 784x39 [color=#FF0000]
+ RenderInline {span} at (0,0) size 69x37
+ RenderText {#text} at (0,0) size 0x0
+ RenderInline {span} at (0,0) size 15x37
+ RenderText {#text} at (1,1) size 15x37
+ text run at (1,1) width 15: "a"
+ RenderTable at (15,30) size 0x0
+ RenderTableCol {span} at (0,0) size 0x0
+ RenderInline {span} at (0,0) size 55x37
+ RenderText {#text} at (15,1) size 55x37
+ text run at (15,1) width 55: "bc d"
+ RenderText {#text} at (0,0) size 0x0
+ RenderText zI: 1 {#text} at (0,0) size 0x0
+layer at (8,50) size 70x39
+ RenderBlock (positioned) zI: 2 {div} at (0,0) size 71x39 [color=#008000]
+ RenderText zI: 2 {#text} at (1,1) size 69x37
+ text run at (1,1) width 69: "abc d"
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x97
+ RenderBlock {html} at (0,0) size 800x97
+ RenderBody {body} at (8,16) size 784x73
+ RenderBlock {p} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 386x18
+ text run at (0,0) width 386: "There should be no red below, except for antialiasing issues."
+layer at (8,50) size 784x39
+ RenderBlock (relative positioned) {div} at (0,34) size 784x39
+layer at (8,50) size 784x39
+ RenderBlock (relative positioned) zI: 1 {div} at (0,0) size 784x39 [color=#FF0000]
+ RenderText zI: 1 {#text} at (1,1) size 69x37
+ text run at (1,1) width 69: "abc d"
+layer at (8,50) size 70x39
+ RenderBlock (positioned) zI: 2 {div} at (0,0) size 71x39 [color=#008000]
+ RenderInline {span} at (0,0) size 69x37
+ RenderText {#text} at (0,0) size 0x0
+ RenderInline {span} at (0,0) size 15x37
+ RenderText {#text} at (1,1) size 15x37
+ text run at (1,1) width 15: "a"
+ RenderTable at (15,30) size 0x0
+ RenderTableCol {span} at (0,0) size 0x0
+ RenderInline {span} at (0,0) size 55x37
+ RenderText {#text} at (15,1) size 55x37
+ text run at (15,1) width 55: "bc d"
+ RenderText {#text} at (0,0) size 0x0
+ RenderText zI: 2 {#text} at (0,0) size 0x0
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x97
+ RenderBlock {html} at (0,0) size 800x97
+ RenderBody {body} at (8,16) size 784x73
+ RenderBlock {p} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 386x18
+ text run at (0,0) width 386: "There should be no red below, except for antialiasing issues."
+layer at (8,50) size 784x39
+ RenderBlock (relative positioned) {div} at (0,34) size 784x39
+layer at (8,50) size 784x39
+ RenderBlock (relative positioned) zI: 1 {div} at (0,0) size 784x39 [color=#FF0000]
+ RenderInline {span} at (0,0) size 69x37
+ RenderText {#text} at (0,0) size 0x0
+ RenderInline {span} at (0,0) size 15x37
+ RenderText {#text} at (1,1) size 15x37
+ text run at (1,1) width 15: "a"
+ RenderTable at (15,30) size 0x0
+ RenderBlock {span} at (0,0) size 0x0
+ RenderInline {span} at (0,0) size 55x37
+ RenderText {#text} at (15,1) size 55x37
+ text run at (15,1) width 55: "bc d"
+ RenderText {#text} at (0,0) size 0x0
+ RenderText zI: 1 {#text} at (0,0) size 0x0
+layer at (8,50) size 70x39
+ RenderBlock (positioned) zI: 2 {div} at (0,0) size 71x39 [color=#008000]
+ RenderText zI: 2 {#text} at (1,1) size 69x37
+ text run at (1,1) width 69: "abc d"
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x97
+ RenderBlock {html} at (0,0) size 800x97
+ RenderBody {body} at (8,16) size 784x73
+ RenderBlock {p} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 386x18
+ text run at (0,0) width 386: "There should be no red below, except for antialiasing issues."
+layer at (8,50) size 784x39
+ RenderBlock (relative positioned) {div} at (0,34) size 784x39
+layer at (8,50) size 784x39
+ RenderBlock (relative positioned) zI: 1 {div} at (0,0) size 784x39 [color=#FF0000]
+ RenderText zI: 1 {#text} at (1,1) size 69x37
+ text run at (1,1) width 69: "abc d"
+layer at (8,50) size 70x39
+ RenderBlock (positioned) zI: 2 {div} at (0,0) size 71x39 [color=#008000]
+ RenderInline {span} at (0,0) size 69x37
+ RenderText {#text} at (0,0) size 0x0
+ RenderInline {span} at (0,0) size 15x37
+ RenderText {#text} at (1,1) size 15x37
+ text run at (1,1) width 15: "a"
+ RenderTable at (15,30) size 0x0
+ RenderBlock {span} at (0,0) size 0x0
+ RenderInline {span} at (0,0) size 55x37
+ RenderText {#text} at (15,1) size 55x37
+ text run at (15,1) width 55: "bc d"
+ RenderText {#text} at (0,0) size 0x0
+ RenderText zI: 2 {#text} at (0,0) size 0x0
+2015-10-15 Zalan Bujtas <zalan@apple.com>
+
+ Anonymous table objects: Collapse anonymous table rows.
+ https://bugs.webkit.org/show_bug.cgi?id=150154
+
+ Reviewed by David Hyatt.
+
+ Merge anonymous table rows when they are not needed anymore.
+ Generated table rows can be collapsed into one when there's no
+ non-generated sibling table row left in the tree.
+
+ Import W3C CSS2.1 anonymous table tests.
+
+ * rendering/RenderObject.cpp:
+ (WebCore::collapseAnonymousTableRowsIfNeeded):
+ (WebCore::RenderObject::destroyAndCleanupAnonymousWrappers):
+
2015-10-15 Simon Fraser <simon.fraser@apple.com>
Un-indent contents of the WebCore namespace
#include "RenderNamedFlowThread.h"
#include "RenderSVGResourceContainer.h"
#include "RenderScrollbarPart.h"
+#include "RenderTableRow.h"
+#include "RenderTableSection.h"
#include "RenderTheme.h"
#include "RenderView.h"
#include "RenderWidget.h"
child->invalidateFlowThreadContainingBlockIncludingDescendants(flowThread);
}
+static void collapseAnonymousTableRowsIfNeeded(const RenderObject& rendererToBeDestroyed)
+{
+ if (!is<RenderTableRow>(rendererToBeDestroyed))
+ return;
+
+ auto& rowToBeDestroyed = downcast<RenderTableRow>(rendererToBeDestroyed);
+ auto* section = downcast<RenderTableSection>(rowToBeDestroyed.parent());
+ if (!section)
+ return;
+
+ // All siblings generated?
+ for (auto* current = section->firstRow(); current; current = current->nextRow()) {
+ if (current == &rendererToBeDestroyed)
+ continue;
+ if (!current->isAnonymous())
+ return;
+ }
+
+ RenderTableRow* rowToInsertInto = nullptr;
+ auto* currentRow = section->firstRow();
+ while (currentRow) {
+ if (currentRow == &rendererToBeDestroyed) {
+ currentRow = currentRow->nextRow();
+ continue;
+ }
+ if (!rowToInsertInto) {
+ rowToInsertInto = currentRow;
+ currentRow = currentRow->nextRow();
+ continue;
+ }
+ currentRow->moveAllChildrenTo(rowToInsertInto);
+ auto* destroyThis = currentRow;
+ currentRow = currentRow->nextRow();
+ destroyThis->destroy();
+ }
+ if (rowToInsertInto)
+ rowToInsertInto->setNeedsLayout();
+}
+
void RenderObject::destroyAndCleanupAnonymousWrappers()
{
// If the tree is destroyed, there is no need for a clean-up phase.
destroyRoot = destroyRootParent;
destroyRootParent = destroyRootParent->parent();
}
+ collapseAnonymousTableRowsIfNeeded(*destroyRoot);
destroyRoot->destroy();
-
// WARNING: |this| is deleted here.
}