Copied: branches/chromium/874/LayoutTests/fast/css-generated-content/first-letter-in-nested-before-table-expected.txt (from rev 97124, trunk/LayoutTests/fast/css-generated-content/first-letter-in-nested-before-table-expected.txt) (0 => 97125)
--- branches/chromium/874/LayoutTests/fast/css-generated-content/first-letter-in-nested-before-table-expected.txt (rev 0)
+++ branches/chromium/874/LayoutTests/fast/css-generated-content/first-letter-in-nested-before-table-expected.txt 2011-10-11 05:12:53 UTC (rev 97125)
@@ -0,0 +1,40 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x266
+ RenderBlock {HTML} at (0,0) size 800x266
+ RenderBody {BODY} at (8,8) size 784x250 [color=#0000FF]
+ RenderBlock {DIV} at (0,0) size 784x100
+ RenderTable at (0,0) size 100x50
+ RenderTableSection (anonymous) at (0,0) size 100x50
+ RenderTableRow (anonymous) at (0,0) size 100x50
+ RenderTableCell (anonymous) at (0,0) size 100x50 [r=0 c=0 rs=1 cs=1]
+ RenderInline (generated) at (0,0) size 50x50 [color=#008000]
+ RenderText at (0,0) size 50x50
+ text run at (0,0) width 50: "A"
+ RenderText at (50,0) size 50x50
+ text run at (50,0) width 50: "B"
+ RenderBlock (anonymous) at (0,50) size 784x50
+ RenderText {#text} at (0,0) size 50x50
+ text run at (0,0) width 50: "C"
+ RenderBlock {DIV} at (0,100) size 784x100
+ RenderBlock (anonymous) at (0,0) size 784x50
+ RenderInline (generated) at (0,0) size 50x50 [color=#008000]
+ RenderText {#text} at (0,0) size 50x50
+ text run at (0,0) width 50: "D"
+ RenderText {#text} at (0,0) size 0x0
+ RenderTable at (0,50) size 100x50
+ RenderTableSection (anonymous) at (0,0) size 100x50
+ RenderTableRow (anonymous) at (0,0) size 100x50
+ RenderTableCell (anonymous) at (0,0) size 100x50 [r=0 c=0 rs=1 cs=1]
+ RenderText at (0,0) size 100x50
+ text run at (0,0) width 100: "EF"
+ RenderBlock {DIV} at (0,200) size 784x50
+ RenderTable at (0,0) size 100x50
+ RenderTableSection (anonymous) at (0,0) size 100x50
+ RenderTableRow (anonymous) at (0,0) size 100x50
+ RenderTableCell (anonymous) at (0,0) size 100x50 [r=0 c=0 rs=1 cs=1]
+ RenderInline (generated) at (0,0) size 50x50 [color=#008000]
+ RenderText at (0,0) size 50x50
+ text run at (0,0) width 50: "E"
+ RenderText at (50,0) size 50x50
+ text run at (50,0) width 50: "F"
Copied: branches/chromium/874/LayoutTests/fast/css-generated-content/first-letter-in-nested-before-table.html (from rev 97124, trunk/LayoutTests/fast/css-generated-content/first-letter-in-nested-before-table.html) (0 => 97125)
--- branches/chromium/874/LayoutTests/fast/css-generated-content/first-letter-in-nested-before-table.html (rev 0)
+++ branches/chromium/874/LayoutTests/fast/css-generated-content/first-letter-in-nested-before-table.html 2011-10-11 05:12:53 UTC (rev 97125)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<!-- No text in black, B and F should be blue. -->
+<html>
+<body style="font-family: ahem; font-size: 50px; -webkit-font-smoothing: none;">
+<style>
+.test1:before {
+ display: table;
+ content: "AB";
+}
+.test2:after {
+ display: table;
+ content: "EF";
+}
+.test1:first-letter { color: green; }
+.test2:first-letter { color: green; }
+</style>
+<div class="test1">C</div>
+<div class="test2">D</div>
+<div class="test2"></div>
+<script>
+document.body.offsetTop;
+document.body.style.color = "blue";
+</script>
+</html>
\ No newline at end of file
Modified: branches/chromium/874/Source/WebCore/rendering/RenderObjectChildList.cpp (97124 => 97125)
--- branches/chromium/874/Source/WebCore/rendering/RenderObjectChildList.cpp 2011-10-11 05:08:13 UTC (rev 97124)
+++ branches/chromium/874/Source/WebCore/rendering/RenderObjectChildList.cpp 2011-10-11 05:12:53 UTC (rev 97125)
@@ -446,6 +446,14 @@
ASSERT(genChild->isListMarker() || genChild->style()->styleType() == FIRST_LETTER);
}
}
+
+ // Update style on the remaining text fragment after the first-letter.
+ if (beforeAfterParent->style()->styleType() == FIRST_LETTER) {
+ if (RenderObject* nextSibling = beforeAfterParent->nextSibling()) {
+ if (nextSibling->isText() && nextSibling->style()->styleType() == child->style()->styleType())
+ nextSibling->setStyle(pseudoElementStyle);
+ }
+ }
}
return; // We've updated the generated content. That's all we needed to do.
}