Title: [97114] trunk
Revision
97114
Author
[email protected]
Date
2011-10-10 17:46:53 -0700 (Mon, 10 Oct 2011)

Log Message

<rdar://problem/10246137> Duplicate ::after content when both ::before and ::after are styled as table parts

Reviewed by Sam Weinig.

Source/WebCore: 

Test: fast/css-generated-content/table-parts-before-and-after.html

* rendering/RenderObject.cpp:
(WebCore::RenderObject::addChild): Prevented table part childern after a ::before table from being merged
into it.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild): Prevented children after a ::before table section from being merged
into it.

LayoutTests: 

* fast/css-generated-content/table-parts-before-and-after-expected.png: Added.
* fast/css-generated-content/table-parts-before-and-after-expected.txt: Added.
* fast/css-generated-content/table-parts-before-and-after.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (97113 => 97114)


--- trunk/LayoutTests/ChangeLog	2011-10-11 00:41:18 UTC (rev 97113)
+++ trunk/LayoutTests/ChangeLog	2011-10-11 00:46:53 UTC (rev 97114)
@@ -1,3 +1,13 @@
+2011-10-10  Dan Bernstein  <[email protected]>
+
+        <rdar://problem/10246137> Duplicate ::after content when both ::before and ::after are styled as table parts
+
+        Reviewed by Sam Weinig.
+
+        * fast/css-generated-content/table-parts-before-and-after-expected.png: Added.
+        * fast/css-generated-content/table-parts-before-and-after-expected.txt: Added.
+        * fast/css-generated-content/table-parts-before-and-after.html: Added.
+
 2011-10-10  Ryosuke Niwa  <[email protected]>
 
         Chromium rebaseline after r97102.

Added: trunk/LayoutTests/fast/css-generated-content/table-parts-before-and-after-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/fast/css-generated-content/table-parts-before-and-after-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/fast/css-generated-content/table-parts-before-and-after-expected.txt (0 => 97114)


--- trunk/LayoutTests/fast/css-generated-content/table-parts-before-and-after-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/table-parts-before-and-after-expected.txt	2011-10-11 00:46:53 UTC (rev 97114)
@@ -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"

Added: trunk/LayoutTests/fast/css-generated-content/table-parts-before-and-after.html (0 => 97114)


--- trunk/LayoutTests/fast/css-generated-content/table-parts-before-and-after.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/table-parts-before-and-after.html	2011-10-11 00:46:53 UTC (rev 97114)
@@ -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: trunk/Source/WebCore/ChangeLog (97113 => 97114)


--- trunk/Source/WebCore/ChangeLog	2011-10-11 00:41:18 UTC (rev 97113)
+++ trunk/Source/WebCore/ChangeLog	2011-10-11 00:46:53 UTC (rev 97114)
@@ -1,3 +1,18 @@
+2011-10-10  Dan Bernstein  <[email protected]>
+
+        <rdar://problem/10246137> Duplicate ::after content when both ::before and ::after are styled as table parts
+
+        Reviewed by Sam Weinig.
+
+        Test: fast/css-generated-content/table-parts-before-and-after.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::addChild): Prevented table part childern after a ::before table from being merged
+        into it.
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::addChild): Prevented children after a ::before table section from being merged
+        into it.
+
 2011-10-10  Nate Chapin  <[email protected]>
 
         Most of the functions in CachedResourceClient are specific

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (97113 => 97114)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2011-10-11 00:41:18 UTC (rev 97113)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2011-10-11 00:46:53 UTC (rev 97114)
@@ -309,7 +309,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: trunk/Source/WebCore/rendering/RenderTable.cpp (97113 => 97114)


--- trunk/Source/WebCore/rendering/RenderTable.cpp	2011-10-11 00:41:18 UTC (rev 97113)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp	2011-10-11 00:46:53 UTC (rev 97114)
@@ -179,7 +179,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
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to