Title: [97116] branches/chromium/874
Revision
97116
Author
infe...@chromium.org
Date
2011-10-10 17:57:11 -0700 (Mon, 10 Oct 2011)

Log Message

Merge 97114 - <rdar://problem/10246137> Duplicate ::after content when both ::before and ::after are styled as table parts
BUG=99348
Review URL: http://codereview.chromium.org/8222024

Modified Paths

Added Paths

Diff

Copied: branches/chromium/874/LayoutTests/fast/css-generated-content/table-parts-before-and-after-expected.png (from rev 97114, trunk/LayoutTests/fast/css-generated-content/table-parts-before-and-after-expected.png)


(Binary files differ)

Copied: branches/chromium/874/LayoutTests/fast/css-generated-content/table-parts-before-and-after-expected.txt (from rev 97114, trunk/LayoutTests/fast/css-generated-content/table-parts-before-and-after-expected.txt) (0 => 97116)


--- branches/chromium/874/LayoutTests/fast/css-generated-content/table-parts-before-and-after-expected.txt	                        (rev 0)
+++ branches/chromium/874/LayoutTests/fast/css-generated-content/table-parts-before-and-after-expected.txt	2011-10-11 00:57:11 UTC (rev 97116)
@@ -0,0 +1,101 @@
+layer at (0,0) size 785x736
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x736
+  RenderBlock {HTML} at (0,0) size 785x736
+    RenderBody {BODY} at (8,8) size 769x720
+      RenderBlock {DIV} at (0,0) size 769x120
+        RenderTable at (0,0) size 40x40
+          RenderTableSection (anonymous) at (0,0) size 40x40
+            RenderTableRow (anonymous) at (0,0) size 40x40
+              RenderTableCell (anonymous) at (0,0) size 40x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 40x40
+                  text run at (0,0) width 40: "1"
+        RenderBlock (anonymous) at (0,40) size 769x40
+          RenderText {#text} at (0,0) size 80x40
+            text run at (0,0) width 80: "22"
+        RenderTable at (0,80) size 120x40
+          RenderTableSection (anonymous) at (0,0) size 120x40
+            RenderTableRow (anonymous) at (0,0) size 120x40
+              RenderTableCell (anonymous) at (0,0) size 120x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 120x40
+                  text run at (0,0) width 120: "333"
+      RenderBlock {DIV} at (0,120) size 769x120 [color=#0000FF]
+        RenderTable at (0,0) size 40x40
+          RenderTableSection (anonymous) at (0,0) size 40x40
+            RenderTableRow (anonymous) at (0,0) size 40x40
+              RenderTableCell (anonymous) at (0,0) size 40x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 40x40
+                  text run at (0,0) width 40: "1"
+        RenderBlock (anonymous) at (0,40) size 769x40
+          RenderText {#text} at (0,0) size 80x40
+            text run at (0,0) width 80: "22"
+        RenderTable at (0,80) size 120x40
+          RenderTableSection (anonymous) at (0,0) size 120x40
+            RenderTableRow (anonymous) at (0,0) size 120x40
+              RenderTableCell (anonymous) at (0,0) size 120x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 120x40
+                  text run at (0,0) width 120: "333"
+      RenderBlock {DIV} at (0,240) size 769x120
+        RenderTable at (0,0) size 40x40
+          RenderTableSection (anonymous) at (0,0) size 40x40
+            RenderTableRow (anonymous) at (0,0) size 40x40
+              RenderTableCell (anonymous) at (0,0) size 40x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 40x40
+                  text run at (0,0) width 40: "1"
+        RenderBlock (anonymous) at (0,40) size 769x40
+          RenderText {#text} at (0,0) size 80x40
+            text run at (0,0) width 80: "22"
+        RenderTable at (0,80) size 120x40
+          RenderTableSection (anonymous) at (0,0) size 120x40
+            RenderTableRow (anonymous) at (0,0) size 120x40
+              RenderTableCell (anonymous) at (0,0) size 120x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 120x40
+                  text run at (0,0) width 120: "333"
+      RenderBlock {DIV} at (0,360) size 769x120 [color=#0000FF]
+        RenderTable at (0,0) size 40x40
+          RenderTableSection (anonymous) at (0,0) size 40x40
+            RenderTableRow (anonymous) at (0,0) size 40x40
+              RenderTableCell (anonymous) at (0,0) size 40x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 40x40
+                  text run at (0,0) width 40: "1"
+        RenderBlock (anonymous) at (0,40) size 769x40
+          RenderText {#text} at (0,0) size 80x40
+            text run at (0,0) width 80: "22"
+        RenderTable at (0,80) size 120x40
+          RenderTableSection (anonymous) at (0,0) size 120x40
+            RenderTableRow (anonymous) at (0,0) size 120x40
+              RenderTableCell (anonymous) at (0,0) size 120x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 120x40
+                  text run at (0,0) width 120: "333"
+      RenderBlock {DIV} at (0,480) size 769x120
+        RenderTable at (0,0) size 40x40
+          RenderTableSection (anonymous) at (0,0) size 40x40
+            RenderTableRow (anonymous) at (0,0) size 40x40
+              RenderTableCell (anonymous) at (0,0) size 40x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 40x40
+                  text run at (0,0) width 40: "1"
+        RenderBlock (anonymous) at (0,40) size 769x40
+          RenderText {#text} at (0,0) size 80x40
+            text run at (0,0) width 80: "22"
+        RenderTable at (0,80) size 120x40
+          RenderTableSection (anonymous) at (0,0) size 120x40
+            RenderTableRow (anonymous) at (0,0) size 120x40
+              RenderTableCell (anonymous) at (0,0) size 120x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 120x40
+                  text run at (0,0) width 120: "333"
+      RenderBlock {DIV} at (0,600) size 769x120 [color=#0000FF]
+        RenderTable at (0,0) size 40x40
+          RenderTableSection (anonymous) at (0,0) size 40x40
+            RenderTableRow (anonymous) at (0,0) size 40x40
+              RenderTableCell (anonymous) at (0,0) size 40x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 40x40
+                  text run at (0,0) width 40: "1"
+        RenderBlock (anonymous) at (0,40) size 769x40
+          RenderText {#text} at (0,0) size 80x40
+            text run at (0,0) width 80: "22"
+        RenderTable at (0,80) size 120x40
+          RenderTableSection (anonymous) at (0,0) size 120x40
+            RenderTableRow (anonymous) at (0,0) size 120x40
+              RenderTableCell (anonymous) at (0,0) size 120x40 [r=0 c=0 rs=1 cs=1]
+                RenderText at (0,0) size 120x40
+                  text run at (0,0) width 120: "333"

Copied: branches/chromium/874/LayoutTests/fast/css-generated-content/table-parts-before-and-after.html (from rev 97114, trunk/LayoutTests/fast/css-generated-content/table-parts-before-and-after.html) (0 => 97116)


--- branches/chromium/874/LayoutTests/fast/css-generated-content/table-parts-before-and-after.html	                        (rev 0)
+++ branches/chromium/874/LayoutTests/fast/css-generated-content/table-parts-before-and-after.html	2011-10-11 00:57:11 UTC (rev 97116)
@@ -0,0 +1,39 @@
+<style>
+    body {
+        font-family: ahem;
+        font-size: 40px;
+        -webkit-font-smoothing: none;
+    }
+
+    div::before {
+        content: "1";
+    }
+
+    div.table-before::before {
+        display: table;
+    }
+
+    div.row-group-before::before {
+        display: table-row-group;
+    }
+
+    div.row-before::before {
+        display: table-row;
+    }
+
+    div::after {
+        content: "333";
+        display: table-cell;
+    }
+</style>
+<div class="table-before">22</div>
+<div id="target-1" class="table-before">22</div>
+<div class="row-group-before">22</div>
+<div id="target-2" class="row-group-before">22</div>
+<div class="row-before">22</div>
+<div id="target-3" class="row-before">22</div>
+<script>
+    document.getElementById("target-1").style.color = "blue";
+    document.getElementById("target-2").style.color = "blue";
+    document.getElementById("target-3").style.color = "blue";
+</script>

Modified: branches/chromium/874/Source/WebCore/rendering/RenderObject.cpp (97115 => 97116)


--- branches/chromium/874/Source/WebCore/rendering/RenderObject.cpp	2011-10-11 00:49:43 UTC (rev 97115)
+++ branches/chromium/874/Source/WebCore/rendering/RenderObject.cpp	2011-10-11 00:57:11 UTC (rev 97116)
@@ -317,7 +317,7 @@
     if (needsTable) {
         RenderTable* table;
         RenderObject* afterChild = beforeChild ? beforeChild->previousSibling() : children->lastChild();
-        if (afterChild && afterChild->isAnonymous() && afterChild->isTable())
+        if (afterChild && afterChild->isAnonymous() && afterChild->isTable() && !afterChild->isBeforeContent())
             table = toRenderTable(afterChild);
         else {
             table = new (renderArena()) RenderTable(document() /* is anonymous */);

Modified: branches/chromium/874/Source/WebCore/rendering/RenderTable.cpp (97115 => 97116)


--- branches/chromium/874/Source/WebCore/rendering/RenderTable.cpp	2011-10-11 00:49:43 UTC (rev 97115)
+++ branches/chromium/874/Source/WebCore/rendering/RenderTable.cpp	2011-10-11 00:57:11 UTC (rev 97116)
@@ -175,7 +175,7 @@
         return;
     }
 
-    if (!beforeChild && lastChild() && lastChild()->isTableSection() && lastChild()->isAnonymous()) {
+    if (!beforeChild && lastChild() && lastChild()->isTableSection() && lastChild()->isAnonymous() && !lastChild()->isBeforeContent()) {
         lastChild()->addChild(child);
         return;
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to