Title: [93794] trunk
Revision
93794
Author
[email protected]
Date
2011-08-25 09:58:38 -0700 (Thu, 25 Aug 2011)

Log Message

Incorrect layout of :before and :after content, with display
table, table-row and table-cell.
https://bugs.webkit.org/show_bug.cgi?id=66699

Reviewed by David Hyatt.

Source/WebCore: 

Tests: fast/table/table-after-child-in-table.html
       fast/table/table-before-child-in-table.html
       fast/table/table-cell-after-child-in-block.html
       fast/table/table-cell-after-child-in-table.html
       fast/table/table-cell-before-child-in-block.html
       fast/table/table-cell-before-child-in-table.html
       fast/table/table-row-after-child-in-block.html
       fast/table/table-row-after-child-in-table.html
       fast/table/table-row-before-child-in-block.html
       fast/table/table-row-before-child-in-table.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
Fix the looping condition to detect :after child correctly.
isAnonymousBlock() does not apply to tables, instead
using isAnonymous().
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild): Don't add the new child
in the generatedContainer with :before, :after content.
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild): Don't add the new child
in the generatedContainer with :before, :after content.

LayoutTests: 

* fast/table/table-after-child-in-table.html: Added.
* fast/table/table-before-child-in-table.html: Added.
* fast/table/table-cell-after-child-in-block.html: Added.
* fast/table/table-cell-after-child-in-table.html: Added.
* fast/table/table-cell-before-child-in-block.html: Added.
* fast/table/table-cell-before-child-in-table.html: Added.
* fast/table/table-row-after-child-in-block.html: Added.
* fast/table/table-row-after-child-in-table.html: Added.
* fast/table/table-row-before-child-in-block.html: Added.
* fast/table/table-row-before-child-in-table.html: Added.
* platform/mac/fast/table/table-after-child-in-table-expected.png: Added.
* platform/mac/fast/table/table-after-child-in-table-expected.txt: Added.
* platform/mac/fast/table/table-before-child-in-table-expected.png: Added.
* platform/mac/fast/table/table-before-child-in-table-expected.txt: Added.
* platform/mac/fast/table/table-cell-after-child-in-block-expected.png: Added.
* platform/mac/fast/table/table-cell-after-child-in-block-expected.txt: Added.
* platform/mac/fast/table/table-cell-after-child-in-table-expected.png: Added.
* platform/mac/fast/table/table-cell-after-child-in-table-expected.txt: Added.
* platform/mac/fast/table/table-cell-before-child-in-block-expected.png: Added.
* platform/mac/fast/table/table-cell-before-child-in-block-expected.txt: Added.
* platform/mac/fast/table/table-cell-before-child-in-table-expected.png: Added.
* platform/mac/fast/table/table-cell-before-child-in-table-expected.txt: Added.
* platform/mac/fast/table/table-row-after-child-in-block-expected.png: Added.
* platform/mac/fast/table/table-row-after-child-in-block-expected.txt: Added.
* platform/mac/fast/table/table-row-after-child-in-table-expected.png: Added.
* platform/mac/fast/table/table-row-after-child-in-table-expected.txt: Added.
* platform/mac/fast/table/table-row-before-child-in-block-expected.png: Added.
* platform/mac/fast/table/table-row-before-child-in-block-expected.txt: Added.
* platform/mac/fast/table/table-row-before-child-in-table-expected.png: Added.
* platform/mac/fast/table/table-row-before-child-in-table-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (93793 => 93794)


--- trunk/LayoutTests/ChangeLog	2011-08-25 16:50:35 UTC (rev 93793)
+++ trunk/LayoutTests/ChangeLog	2011-08-25 16:58:38 UTC (rev 93794)
@@ -1,3 +1,42 @@
+2011-08-25  Abhishek Arya  <[email protected]>
+
+        Incorrect layout of :before and :after content, with display
+        table, table-row and table-cell.
+        https://bugs.webkit.org/show_bug.cgi?id=66699
+
+        Reviewed by David Hyatt.
+
+        * fast/table/table-after-child-in-table.html: Added.
+        * fast/table/table-before-child-in-table.html: Added.
+        * fast/table/table-cell-after-child-in-block.html: Added.
+        * fast/table/table-cell-after-child-in-table.html: Added.
+        * fast/table/table-cell-before-child-in-block.html: Added.
+        * fast/table/table-cell-before-child-in-table.html: Added.
+        * fast/table/table-row-after-child-in-block.html: Added.
+        * fast/table/table-row-after-child-in-table.html: Added.
+        * fast/table/table-row-before-child-in-block.html: Added.
+        * fast/table/table-row-before-child-in-table.html: Added.
+        * platform/mac/fast/table/table-after-child-in-table-expected.png: Added.
+        * platform/mac/fast/table/table-after-child-in-table-expected.txt: Added.
+        * platform/mac/fast/table/table-before-child-in-table-expected.png: Added.
+        * platform/mac/fast/table/table-before-child-in-table-expected.txt: Added.
+        * platform/mac/fast/table/table-cell-after-child-in-block-expected.png: Added.
+        * platform/mac/fast/table/table-cell-after-child-in-block-expected.txt: Added.
+        * platform/mac/fast/table/table-cell-after-child-in-table-expected.png: Added.
+        * platform/mac/fast/table/table-cell-after-child-in-table-expected.txt: Added.
+        * platform/mac/fast/table/table-cell-before-child-in-block-expected.png: Added.
+        * platform/mac/fast/table/table-cell-before-child-in-block-expected.txt: Added.
+        * platform/mac/fast/table/table-cell-before-child-in-table-expected.png: Added.
+        * platform/mac/fast/table/table-cell-before-child-in-table-expected.txt: Added.
+        * platform/mac/fast/table/table-row-after-child-in-block-expected.png: Added.
+        * platform/mac/fast/table/table-row-after-child-in-block-expected.txt: Added.
+        * platform/mac/fast/table/table-row-after-child-in-table-expected.png: Added.
+        * platform/mac/fast/table/table-row-after-child-in-table-expected.txt: Added.
+        * platform/mac/fast/table/table-row-before-child-in-block-expected.png: Added.
+        * platform/mac/fast/table/table-row-before-child-in-block-expected.txt: Added.
+        * platform/mac/fast/table/table-row-before-child-in-table-expected.png: Added.
+        * platform/mac/fast/table/table-row-before-child-in-table-expected.txt: Added.
+
 2011-08-25  Pavel Feldman  <[email protected]>
 
         [Qt] REGRESSION(93769): inspector/console/console-tests.html fails

Added: trunk/LayoutTests/fast/table/table-after-child-in-table.html (0 => 93794)


--- trunk/LayoutTests/fast/table/table-after-child-in-table.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-after-child-in-table.html	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,27 @@
+<html>
+<style>
+#target
+{
+    display: table;
+	border-color: green;
+	border-style: solid;
+	padding: 1em 1em;
+}
+
+#target::after
+{
+    content: "AFTER";
+	display: table;
+	border-color: blue;
+	border-style: solid;
+	padding: 1em 1em;
+}
+</style>
+<div id="target">
+<span>CONTENT </span>
+</div>
+<script>
+    document.body.offsetTop;
+    target.style.color = "red";
+</script>
+</html>

Added: trunk/LayoutTests/fast/table/table-before-child-in-table.html (0 => 93794)


--- trunk/LayoutTests/fast/table/table-before-child-in-table.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-before-child-in-table.html	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,27 @@
+<html>
+<style>
+#target
+{
+    display: table;
+	border-color: green;
+	border-style: solid;
+	padding: 1em 1em;
+}
+
+#target::before
+{
+    content: "BEFORE";
+	display: table;
+	border-color: blue;
+	border-style: solid;
+	padding: 1em 1em;
+}
+</style>
+<div id="target">
+<span> CONTENT</span>
+</div>
+<script>
+    document.body.offsetTop;
+    target.style.color = "red";
+</script>
+</html>

Added: trunk/LayoutTests/fast/table/table-cell-after-child-in-block.html (0 => 93794)


--- trunk/LayoutTests/fast/table/table-cell-after-child-in-block.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-after-child-in-block.html	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,26 @@
+<html>
+<style>
+#target
+{
+	border-color: green;
+	border-style: solid;
+	padding: 1em 1em;
+}
+
+#target::after
+{
+    content: "AFTER";
+	display: table-cell;
+	border-color: blue;
+	border-style: solid;
+	padding: 1em 1em;
+}
+</style>
+<div id="target">
+<div id="span">CONTENT </div>
+</div>
+<script>
+    document.body.offsetTop;
+    target.style.color = "red";
+</script>
+</html>

Added: trunk/LayoutTests/fast/table/table-cell-after-child-in-table.html (0 => 93794)


--- trunk/LayoutTests/fast/table/table-cell-after-child-in-table.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-after-child-in-table.html	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,27 @@
+<html>
+<style>
+#target
+{
+    display: table;
+	border-color: green;
+	border-style: solid;
+	padding: 1em 1em;
+}
+
+#target::after
+{
+    content: "AFTER";
+	display: table-cell;
+	border-color: blue;
+	border-style: solid;
+	padding: 1em 1em;
+}
+</style>
+<div id="target">
+<span>CONTENT </span>
+</div>
+<script>
+    document.body.offsetTop;
+    target.style.color = "red";
+</script>
+</html>

Added: trunk/LayoutTests/fast/table/table-cell-before-child-in-block.html (0 => 93794)


--- trunk/LayoutTests/fast/table/table-cell-before-child-in-block.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-before-child-in-block.html	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,26 @@
+<html>
+<style>
+#target
+{
+	border-color: green;
+	border-style: solid;
+	padding: 1em 1em;
+}
+
+#target::before
+{
+    content: "BEFORE";
+	display: table-cell;
+	border-color: blue;
+	border-style: solid;
+	padding: 1em 1em;
+}
+</style>
+<div id="target">
+<div id="span"> CONTENT</div>
+</div>
+<script>
+    document.body.offsetTop;
+    target.style.color = "red";
+</script>
+</html>

Added: trunk/LayoutTests/fast/table/table-cell-before-child-in-table.html (0 => 93794)


--- trunk/LayoutTests/fast/table/table-cell-before-child-in-table.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-before-child-in-table.html	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,27 @@
+<html>
+<style>
+#target
+{
+    display: table;
+	border-color: green;
+	border-style: solid;
+	padding: 1em 1em;
+}
+
+#target::before
+{
+    content: "BEFORE";
+	display: table-cell;
+	border-color: blue;
+	border-style: solid;
+	padding: 1em 1em;
+}
+</style>
+<div id="target">
+<span> CONTENT</span>
+</div>
+<script>
+    document.body.offsetTop;
+    target.style.color = "red";
+</script>
+</html>

Added: trunk/LayoutTests/fast/table/table-row-after-child-in-block.html (0 => 93794)


--- trunk/LayoutTests/fast/table/table-row-after-child-in-block.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-row-after-child-in-block.html	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,26 @@
+<html>
+<style>
+#target
+{
+	border-color: green;
+	border-style: solid;
+	padding: 1em 1em;
+}
+
+#target::after
+{
+    content: "AFTER";
+	display: table-row;
+	border-color: blue;
+	border-style: solid;
+	padding: 1em 1em;
+}
+</style>
+<div id="target">
+<div id="span">CONTENT </div>
+</div>
+<script>
+    document.body.offsetTop;
+    target.style.color = "red";
+</script>
+</html>

Added: trunk/LayoutTests/fast/table/table-row-after-child-in-table.html (0 => 93794)


--- trunk/LayoutTests/fast/table/table-row-after-child-in-table.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-row-after-child-in-table.html	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,27 @@
+<html>
+<style>
+#target
+{
+    display: table;
+	border-color: green;
+	border-style: solid;
+	padding: 1em 1em;
+}
+
+#target::after
+{
+    content: "AFTER";
+	display: table-row;
+	border-color: blue;
+	border-style: solid;
+	padding: 1em 1em;
+}
+</style>
+<div id="target">
+<span>CONTENT </span>
+</div>
+<script>
+    document.body.offsetTop;
+    target.style.color = "red";
+</script>
+</html>

Added: trunk/LayoutTests/fast/table/table-row-before-child-in-block.html (0 => 93794)


--- trunk/LayoutTests/fast/table/table-row-before-child-in-block.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-row-before-child-in-block.html	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,26 @@
+<html>
+<style>
+#target
+{
+	border-color: green;
+	border-style: solid;
+	padding: 1em 1em;
+}
+
+#target::before
+{
+    content: "BEFORE";
+	display: table-row;
+	border-color: blue;
+	border-style: solid;
+	padding: 1em 1em;
+}
+</style>
+<div id="target">
+<div id="span"> CONTENT</div>
+</div>
+<script>
+    document.body.offsetTop;
+    target.style.color = "red";
+</script>
+</html>

Added: trunk/LayoutTests/fast/table/table-row-before-child-in-table.html (0 => 93794)


--- trunk/LayoutTests/fast/table/table-row-before-child-in-table.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/table-row-before-child-in-table.html	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,27 @@
+<html>
+<style>
+#target
+{
+    display: table;
+	border-color: green;
+	border-style: solid;
+	padding: 1em 1em;
+}
+
+#target::before
+{
+    content: "BEFORE";
+	display: table-row;
+	border-color: blue;
+	border-style: solid;
+	padding: 1em 1em;
+}
+</style>
+<div id="target">
+<span> CONTENT</span>
+</div>
+<script>
+    document.body.offsetTop;
+    target.style.color = "red";
+</script>
+</html>

Added: trunk/LayoutTests/platform/mac/fast/table/table-after-child-in-table-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/table/table-after-child-in-table-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/table/table-after-child-in-table-expected.txt (0 => 93794)


--- trunk/LayoutTests/platform/mac/fast/table/table-after-child-in-table-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/table/table-after-child-in-table-expected.txt	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,19 @@
+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
+      RenderTable {DIV} at (0,0) size 128x112 [color=#FF0000] [border: (3px solid #008000)]
+        RenderTableSection (anonymous) at (19,19) size 90x74 [color=#000000]
+          RenderTableRow (anonymous) at (0,0) size 90x74
+            RenderTableCell (anonymous) at (0,0) size 90x74 [r=0 c=0 rs=1 cs=1]
+              RenderBlock (anonymous) at (0,0) size 90x18
+                RenderInline {SPAN} at (0,0) size 77x18 [color=#FF0000]
+                  RenderText {#text} at (0,0) size 77x18
+                    text run at (0,0) width 77: "CONTENT"
+              RenderTable at (0,18) size 90x56 [color=#FF0000] [border: (3px solid #0000FF)]
+                RenderTableSection (anonymous) at (19,19) size 52x18 [color=#000000]
+                  RenderTableRow (anonymous) at (0,0) size 52x18
+                    RenderTableCell (anonymous) at (0,0) size 52x18 [r=0 c=0 rs=1 cs=1]
+                      RenderText at (0,0) size 52x18
+                        text run at (0,0) width 52: "AFTER"

Added: trunk/LayoutTests/platform/mac/fast/table/table-before-child-in-table-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/table/table-before-child-in-table-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/table/table-before-child-in-table-expected.txt (0 => 93794)


--- trunk/LayoutTests/platform/mac/fast/table/table-before-child-in-table-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/table/table-before-child-in-table-expected.txt	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,19 @@
+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
+      RenderTable {DIV} at (0,0) size 139x112 [color=#FF0000] [border: (3px solid #008000)]
+        RenderTableSection (anonymous) at (19,19) size 101x74 [color=#000000]
+          RenderTableRow (anonymous) at (0,0) size 101x74
+            RenderTableCell (anonymous) at (0,0) size 101x74 [r=0 c=0 rs=1 cs=1]
+              RenderTable at (0,0) size 101x56 [color=#FF0000] [border: (3px solid #0000FF)]
+                RenderTableSection (anonymous) at (19,19) size 63x18 [color=#000000]
+                  RenderTableRow (anonymous) at (0,0) size 63x18
+                    RenderTableCell (anonymous) at (0,0) size 63x18 [r=0 c=0 rs=1 cs=1]
+                      RenderText at (0,0) size 63x18
+                        text run at (0,0) width 63: "BEFORE"
+              RenderBlock (anonymous) at (0,56) size 101x18
+                RenderInline {SPAN} at (0,0) size 77x18 [color=#FF0000]
+                  RenderText {#text} at (0,0) size 77x18
+                    text run at (0,0) width 77: "CONTENT"

Added: trunk/LayoutTests/platform/mac/fast/table/table-cell-after-child-in-block-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/table/table-cell-after-child-in-block-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/table/table-cell-after-child-in-block-expected.txt (0 => 93794)


--- trunk/LayoutTests/platform/mac/fast/table/table-cell-after-child-in-block-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/table/table-cell-after-child-in-block-expected.txt	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,15 @@
+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 {DIV} at (0,0) size 784x112 [color=#FF0000] [border: (3px solid #008000)]
+        RenderBlock {DIV} at (19,19) size 746x18
+          RenderText {#text} at (0,0) size 77x18
+            text run at (0,0) width 77: "CONTENT"
+        RenderTable at (19,37) size 90x56 [color=#000000]
+          RenderTableSection (anonymous) at (0,0) size 90x56
+            RenderTableRow (anonymous) at (0,0) size 90x56
+              RenderTableCell (anonymous) at (0,0) size 90x56 [color=#FF0000] [border: (3px solid #0000FF)] [r=0 c=0 rs=1 cs=1]
+                RenderText at (19,19) size 52x18
+                  text run at (19,19) width 52: "AFTER"

Added: trunk/LayoutTests/platform/mac/fast/table/table-cell-after-child-in-table-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/table/table-cell-after-child-in-table-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/table/table-cell-after-child-in-table-expected.txt (0 => 93794)


--- trunk/LayoutTests/platform/mac/fast/table/table-cell-after-child-in-table-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/table/table-cell-after-child-in-table-expected.txt	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,15 @@
+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
+      RenderTable {DIV} at (0,0) size 205x94 [color=#FF0000] [border: (3px solid #008000)]
+        RenderTableSection (anonymous) at (19,19) size 167x56 [color=#000000]
+          RenderTableRow (anonymous) at (0,0) size 167x56
+            RenderTableCell (anonymous) at (0,19) size 77x18 [r=0 c=0 rs=1 cs=1]
+              RenderInline {SPAN} at (0,0) size 77x18 [color=#FF0000]
+                RenderText {#text} at (0,0) size 77x18
+                  text run at (0,0) width 77: "CONTENT"
+            RenderTableCell (anonymous) at (77,0) size 90x56 [color=#FF0000] [border: (3px solid #0000FF)] [r=0 c=1 rs=1 cs=1]
+              RenderText at (19,19) size 52x18
+                text run at (19,19) width 52: "AFTER"

Added: trunk/LayoutTests/platform/mac/fast/table/table-cell-before-child-in-block-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/table/table-cell-before-child-in-block-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/table/table-cell-before-child-in-block-expected.txt (0 => 93794)


--- trunk/LayoutTests/platform/mac/fast/table/table-cell-before-child-in-block-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/table/table-cell-before-child-in-block-expected.txt	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,15 @@
+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 {DIV} at (0,0) size 784x112 [color=#FF0000] [border: (3px solid #008000)]
+        RenderTable at (19,19) size 101x56 [color=#000000]
+          RenderTableSection (anonymous) at (0,0) size 101x56
+            RenderTableRow (anonymous) at (0,0) size 101x56
+              RenderTableCell (anonymous) at (0,0) size 101x56 [color=#FF0000] [border: (3px solid #0000FF)] [r=0 c=0 rs=1 cs=1]
+                RenderText at (19,19) size 63x18
+                  text run at (19,19) width 63: "BEFORE"
+        RenderBlock {DIV} at (19,75) size 746x18
+          RenderText {#text} at (0,0) size 77x18
+            text run at (0,0) width 77: "CONTENT"

Added: trunk/LayoutTests/platform/mac/fast/table/table-cell-before-child-in-table-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/table/table-cell-before-child-in-table-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/table/table-cell-before-child-in-table-expected.txt (0 => 93794)


--- trunk/LayoutTests/platform/mac/fast/table/table-cell-before-child-in-table-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/table/table-cell-before-child-in-table-expected.txt	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,15 @@
+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
+      RenderTable {DIV} at (0,0) size 216x94 [color=#FF0000] [border: (3px solid #008000)]
+        RenderTableSection (anonymous) at (19,19) size 178x56 [color=#000000]
+          RenderTableRow (anonymous) at (0,0) size 178x56
+            RenderTableCell (anonymous) at (0,0) size 101x56 [color=#FF0000] [border: (3px solid #0000FF)] [r=0 c=0 rs=1 cs=1]
+              RenderText at (19,19) size 63x18
+                text run at (19,19) width 63: "BEFORE"
+            RenderTableCell (anonymous) at (101,19) size 77x18 [r=0 c=1 rs=1 cs=1]
+              RenderInline {SPAN} at (0,0) size 77x18 [color=#FF0000]
+                RenderText {#text} at (0,0) size 77x18
+                  text run at (0,0) width 77: "CONTENT"

Added: trunk/LayoutTests/platform/mac/fast/table/table-row-after-child-in-block-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/table/table-row-after-child-in-block-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/table/table-row-after-child-in-block-expected.txt (0 => 93794)


--- trunk/LayoutTests/platform/mac/fast/table/table-row-after-child-in-block-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/table/table-row-after-child-in-block-expected.txt	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,15 @@
+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 {DIV} at (0,0) size 784x74 [color=#FF0000] [border: (3px solid #008000)]
+        RenderBlock {DIV} at (19,19) size 746x18
+          RenderText {#text} at (0,0) size 77x18
+            text run at (0,0) width 77: "CONTENT"
+        RenderTable at (19,37) size 52x18 [color=#000000]
+          RenderTableSection (anonymous) at (0,0) size 52x18
+            RenderTableRow (anonymous) at (0,0) size 52x18 [color=#FF0000] [border: (3px solid #0000FF)]
+              RenderTableCell (anonymous) at (0,0) size 52x18 [color=#000000] [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 52x18
+                  text run at (0,0) width 52: "AFTER"

Added: trunk/LayoutTests/platform/mac/fast/table/table-row-after-child-in-table-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/table/table-row-after-child-in-table-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/table/table-row-after-child-in-table-expected.txt (0 => 93794)


--- trunk/LayoutTests/platform/mac/fast/table/table-row-after-child-in-table-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/table/table-row-after-child-in-table-expected.txt	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,16 @@
+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
+      RenderTable {DIV} at (0,0) size 115x74 [color=#FF0000] [border: (3px solid #008000)]
+        RenderTableSection (anonymous) at (19,19) size 77x36 [color=#000000]
+          RenderTableRow (anonymous) at (0,0) size 77x18
+            RenderTableCell (anonymous) at (0,0) size 77x18 [r=0 c=0 rs=1 cs=1]
+              RenderInline {SPAN} at (0,0) size 77x18 [color=#FF0000]
+                RenderText {#text} at (0,0) size 77x18
+                  text run at (0,0) width 77: "CONTENT"
+          RenderTableRow (anonymous) at (0,18) size 77x18 [color=#FF0000] [border: (3px solid #0000FF)]
+            RenderTableCell (anonymous) at (0,18) size 77x18 [color=#000000] [r=1 c=0 rs=1 cs=1]
+              RenderText at (0,0) size 52x18
+                text run at (0,0) width 52: "AFTER"

Added: trunk/LayoutTests/platform/mac/fast/table/table-row-before-child-in-block-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/table/table-row-before-child-in-block-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/table/table-row-before-child-in-block-expected.txt (0 => 93794)


--- trunk/LayoutTests/platform/mac/fast/table/table-row-before-child-in-block-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/table/table-row-before-child-in-block-expected.txt	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,15 @@
+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 {DIV} at (0,0) size 784x74 [color=#FF0000] [border: (3px solid #008000)]
+        RenderTable at (19,19) size 63x18 [color=#000000]
+          RenderTableSection (anonymous) at (0,0) size 63x18
+            RenderTableRow (anonymous) at (0,0) size 63x18 [color=#FF0000] [border: (3px solid #0000FF)]
+              RenderTableCell (anonymous) at (0,0) size 63x18 [color=#000000] [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 63x18
+                  text run at (0,0) width 63: "BEFORE"
+        RenderBlock {DIV} at (19,37) size 746x18
+          RenderText {#text} at (0,0) size 77x18
+            text run at (0,0) width 77: "CONTENT"

Added: trunk/LayoutTests/platform/mac/fast/table/table-row-before-child-in-table-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/table/table-row-before-child-in-table-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/table/table-row-before-child-in-table-expected.txt (0 => 93794)


--- trunk/LayoutTests/platform/mac/fast/table/table-row-before-child-in-table-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/table/table-row-before-child-in-table-expected.txt	2011-08-25 16:58:38 UTC (rev 93794)
@@ -0,0 +1,16 @@
+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
+      RenderTable {DIV} at (0,0) size 115x74 [color=#FF0000] [border: (3px solid #008000)]
+        RenderTableSection (anonymous) at (19,19) size 77x36 [color=#000000]
+          RenderTableRow (anonymous) at (0,0) size 77x18 [color=#FF0000] [border: (3px solid #0000FF)]
+            RenderTableCell (anonymous) at (0,0) size 77x18 [color=#000000] [r=0 c=0 rs=1 cs=1]
+              RenderText at (0,0) size 63x18
+                text run at (0,0) width 63: "BEFORE"
+          RenderTableRow (anonymous) at (0,18) size 77x18
+            RenderTableCell (anonymous) at (0,18) size 77x18 [r=1 c=0 rs=1 cs=1]
+              RenderInline {SPAN} at (0,0) size 77x18 [color=#FF0000]
+                RenderText {#text} at (0,0) size 77x18
+                  text run at (0,0) width 77: "CONTENT"

Modified: trunk/Source/WebCore/ChangeLog (93793 => 93794)


--- trunk/Source/WebCore/ChangeLog	2011-08-25 16:50:35 UTC (rev 93793)
+++ trunk/Source/WebCore/ChangeLog	2011-08-25 16:58:38 UTC (rev 93794)
@@ -1,3 +1,34 @@
+2011-08-25  Abhishek Arya  <[email protected]>
+
+        Incorrect layout of :before and :after content, with display
+        table, table-row and table-cell.
+        https://bugs.webkit.org/show_bug.cgi?id=66699
+
+        Reviewed by David Hyatt.
+
+        Tests: fast/table/table-after-child-in-table.html
+               fast/table/table-before-child-in-table.html
+               fast/table/table-cell-after-child-in-block.html
+               fast/table/table-cell-after-child-in-table.html
+               fast/table/table-cell-before-child-in-block.html
+               fast/table/table-cell-before-child-in-table.html
+               fast/table/table-row-after-child-in-block.html
+               fast/table/table-row-after-child-in-table.html
+               fast/table/table-row-before-child-in-block.html
+               fast/table/table-row-before-child-in-table.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
+        Fix the looping condition to detect :after child correctly.
+        isAnonymousBlock() does not apply to tables, instead
+        using isAnonymous().
+        * rendering/RenderTableRow.cpp:
+        (WebCore::RenderTableRow::addChild): Don't add the new child
+        in the generatedContainer with :before, :after content.
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::addChild): Don't add the new child
+        in the generatedContainer with :before, :after content.
+
 2011-08-25  Sam Weinig  <[email protected]>
 
         JSHTMLImageElement (and associated Node) is abandoned when image load is canceled via beforeload

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (93793 => 93794)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-08-25 16:50:35 UTC (rev 93793)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-08-25 16:58:38 UTC (rev 93794)
@@ -669,10 +669,10 @@
     // Make sure we don't append things after :after-generated content if we have it.
     if (!beforeChild) {
         RenderObject* lastRenderer = lastChild();
-        if (isAfterContent(lastRenderer))
+        while (lastRenderer && lastRenderer->isAnonymous() && !isAfterContent(lastRenderer))
+            lastRenderer = lastRenderer->lastChild();
+        if (lastRenderer && isAfterContent(lastRenderer))
             beforeChild = lastRenderer;
-        else if (lastRenderer && lastRenderer->isAnonymousBlock() && isAfterContent(lastRenderer->lastChild()))
-            beforeChild = lastRenderer->lastChild();
     }
 
     // If the requested beforeChild is not one of our children, then this is because

Modified: trunk/Source/WebCore/rendering/RenderTableRow.cpp (93793 => 93794)


--- trunk/Source/WebCore/rendering/RenderTableRow.cpp	2011-08-25 16:50:35 UTC (rev 93793)
+++ trunk/Source/WebCore/rendering/RenderTableRow.cpp	2011-08-25 16:58:38 UTC (rev 93794)
@@ -90,7 +90,7 @@
         RenderObject* last = beforeChild;
         if (!last)
             last = lastChild();
-        if (last && last->isAnonymous() && last->isTableCell()) {
+        if (last && last->isAnonymous() && last->isTableCell() && !isAfterContent(last) && !isBeforeContent(last)) {
             if (beforeChild == last)
                 beforeChild = last->firstChild();
             last->addChild(child, beforeChild);
@@ -98,7 +98,7 @@
         }
 
         // If beforeChild is inside an anonymous cell, insert into the cell.
-        if (last && !last->isTableCell() && last->parent() && last->parent()->isAnonymous()) {
+        if (last && !last->isTableCell() && last->parent() && last->parent()->isAnonymous() && !isAfterContent(last->parent()) && !isBeforeContent(last->parent())) {
             last->parent()->addChild(child, beforeChild);
             return;
         }

Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (93793 => 93794)


--- trunk/Source/WebCore/rendering/RenderTableSection.cpp	2011-08-25 16:50:35 UTC (rev 93793)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp	2011-08-25 16:58:38 UTC (rev 93794)
@@ -99,7 +99,7 @@
         RenderObject* last = beforeChild;
         if (!last)
             last = lastChild();
-        if (last && last->isAnonymous()) {
+        if (last && last->isAnonymous() && !isAfterContent(last) && !isBeforeContent(last)) {
             if (beforeChild == last)
                 beforeChild = last->firstChild();
             last->addChild(child, beforeChild);
@@ -111,7 +111,7 @@
         RenderObject* lastBox = last;
         while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableRow())
             lastBox = lastBox->parent();
-        if (lastBox && lastBox->isAnonymous()) {
+        if (lastBox && lastBox->isAnonymous() && !isAfterContent(lastBox) && !isBeforeContent(lastBox)) {
             lastBox->addChild(child, beforeChild);
             return;
         }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to