Diff
Modified: trunk/LayoutTests/ChangeLog (95460 => 95461)
--- trunk/LayoutTests/ChangeLog 2011-09-19 20:09:39 UTC (rev 95460)
+++ trunk/LayoutTests/ChangeLog 2011-09-19 20:17:53 UTC (rev 95461)
@@ -1,3 +1,27 @@
+2011-09-16 Abhishek Arya <infe...@chromium.org>
+
+ Child not placed correctly when beforeChild (table part)
+ has both :before, :after content.
+ https://bugs.webkit.org/show_bug.cgi?id=67656
+
+ Reviewed by James Robinson.
+
+ * fast/table/table-cell-before-after-content-around-table-block-expected.png: Added.
+ * fast/table/table-cell-before-after-content-around-table-block-expected.txt: Added.
+ * fast/table/table-cell-before-after-content-around-table-block.html: Added.
+ * fast/table/table-cell-before-after-content-around-table-expected.png: Added.
+ * fast/table/table-cell-before-after-content-around-table-expected.txt: Added.
+ * fast/table/table-cell-before-after-content-around-table-row-expected.png: Added.
+ * fast/table/table-cell-before-after-content-around-table-row-expected.txt: Added.
+ * fast/table/table-cell-before-after-content-around-table-row.html: Added.
+ * fast/table/table-cell-before-after-content-around-table.html: Added.
+ * fast/table/table-row-before-after-content-around-block-expected.png: Added.
+ * fast/table/table-row-before-after-content-around-block-expected.txt: Added.
+ * fast/table/table-row-before-after-content-around-block.html: Added.
+ * fast/table/table-row-before-after-content-around-table-expected.png: Added.
+ * fast/table/table-row-before-after-content-around-table-expected.txt: Added.
+ * fast/table/table-row-before-after-content-around-table.html: Added.
+
2011-09-19 Tom Sepez <tse...@chromium.org>
Fix xssauditor bypass with unterminated closing tag by making the HTMLSourceTracker
Added: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-block-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-block-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-block-expected.txt (0 => 95461)
--- trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-block-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-block-expected.txt 2011-09-19 20:17:53 UTC (rev 95461)
@@ -0,0 +1,21 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x64
+ RenderBlock {HTML} at (0,0) size 800x64
+ RenderBody {BODY} at (8,8) size 784x48 [color=#0000FF]
+ RenderBlock {DIV} at (0,0) size 784x48
+ RenderTable at (0,0) size 64x16 [color=#000000]
+ RenderTableSection (anonymous) at (0,0) size 64x16
+ RenderTableRow (anonymous) at (0,0) size 64x16
+ RenderTableCell (anonymous) at (0,0) size 64x16 [color=#0000FF] [r=0 c=0 rs=1 cs=1]
+ RenderText at (0,0) size 64x16
+ text run at (0,0) width 64: "ABCD"
+ RenderBlock {DIV} at (0,16) size 784x16
+ RenderText {#text} at (0,0) size 64x16
+ text run at (0,0) width 64: "1234"
+ RenderTable at (0,32) size 64x16 [color=#000000]
+ RenderTableSection (anonymous) at (0,0) size 64x16
+ RenderTableRow (anonymous) at (0,0) size 64x16
+ RenderTableCell (anonymous) at (0,0) size 64x16 [color=#0000FF] [r=0 c=0 rs=1 cs=1]
+ RenderText at (0,0) size 64x16
+ text run at (0,0) width 64: "EFGH"
Added: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-block.html (0 => 95461)
--- trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-block.html (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-block.html 2011-09-19 20:17:53 UTC (rev 95461)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<!-- Test passes if you see three blue boxes in three seperate rows. -->
+<html style="font: 1em/1 Ahem, sans-serif;">
+<style type="text/css">
+.container:before {
+ content: "ABCD";
+ display: table-cell;
+}
+
+.container:after {
+ content: "EFGH";
+ display: table-cell;
+}
+
+</style>
+</head>
+<body>
+<div class="container">
+<div style="display: block">1234</div>
+</div>
+<script>
+document.body.offsetTop;
+document.body.style.color = 'blue';
+</script>
+</html>
Added: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-expected.txt (0 => 95461)
--- trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-expected.txt 2011-09-19 20:17:53 UTC (rev 95461)
@@ -0,0 +1,24 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x64
+ RenderBlock {HTML} at (0,0) size 800x64
+ RenderBody {BODY} at (8,8) size 784x48 [color=#0000FF]
+ RenderBlock {DIV} at (0,0) size 784x48
+ RenderTable at (0,0) size 64x16 [color=#000000]
+ RenderTableSection (anonymous) at (0,0) size 64x16
+ RenderTableRow (anonymous) at (0,0) size 64x16
+ RenderTableCell (anonymous) at (0,0) size 64x16 [color=#0000FF] [r=0 c=0 rs=1 cs=1]
+ RenderText at (0,0) size 64x16
+ text run at (0,0) width 64: "ABCD"
+ RenderTable {DIV} at (0,16) size 64x16
+ RenderTableSection (anonymous) at (0,0) size 64x16
+ RenderTableRow (anonymous) at (0,0) size 64x16
+ RenderTableCell (anonymous) at (0,0) size 64x16 [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 64x16
+ text run at (0,0) width 64: "1234"
+ RenderTable at (0,32) size 64x16 [color=#000000]
+ RenderTableSection (anonymous) at (0,0) size 64x16
+ RenderTableRow (anonymous) at (0,0) size 64x16
+ RenderTableCell (anonymous) at (0,0) size 64x16 [color=#0000FF] [r=0 c=0 rs=1 cs=1]
+ RenderText at (0,0) size 64x16
+ text run at (0,0) width 64: "EFGH"
Added: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-row-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-row-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-row-expected.txt (0 => 95461)
--- trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-row-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-row-expected.txt 2011-09-19 20:17:53 UTC (rev 95461)
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x64
+ RenderBlock {HTML} at (0,0) size 800x64
+ RenderBody {BODY} at (8,8) size 784x48 [color=#0000FF]
+ RenderTable {DIV} at (0,0) size 64x48
+ RenderTableSection (anonymous) at (0,0) size 64x48
+ RenderTableRow (anonymous) at (0,0) size 64x16
+ RenderTableCell (anonymous) at (0,0) size 64x16 [r=0 c=0 rs=1 cs=1]
+ RenderText at (0,0) size 64x16
+ text run at (0,0) width 64: "ABCD"
+ RenderTableRow {DIV} at (0,16) size 64x16
+ RenderTableCell (anonymous) at (0,16) size 64x16 [r=1 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 64x16
+ text run at (0,0) width 64: "1234"
+ RenderTableRow (anonymous) at (0,32) size 64x16
+ RenderTableCell (anonymous) at (0,32) size 64x16 [r=2 c=0 rs=1 cs=1]
+ RenderText at (0,0) size 64x16
+ text run at (0,0) width 64: "EFGH"
Added: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-row.html (0 => 95461)
--- trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-row.html (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table-row.html 2011-09-19 20:17:53 UTC (rev 95461)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<!-- Test passes if you see three blue boxes in three seperate rows. -->
+<html style="font: 1em/1 Ahem, sans-serif;">
+<style type="text/css">
+.container:before {
+ content: "ABCD";
+ display: table-cell;
+}
+
+.container:after {
+ content: "EFGH";
+ display: table-cell;
+}
+
+</style>
+</head>
+<body>
+<div class="container" style="display:table">
+<div style="display:table-row">1234</div>
+</div>
+<script>
+document.body.offsetTop;
+document.body.style.color = 'blue';
+</script>
+</html>
Added: trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table.html (0 => 95461)
--- trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table.html (rev 0)
+++ trunk/LayoutTests/fast/table/table-cell-before-after-content-around-table.html 2011-09-19 20:17:53 UTC (rev 95461)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<!-- Test passes if you see three blue boxes in three seperate rows. -->
+<html style="font: 1em/1 Ahem, sans-serif;">
+<style type="text/css">
+.container:before {
+ content: "ABCD";
+ display: table-cell;
+}
+
+.container:after {
+ content: "EFGH";
+ display: table-cell;
+}
+
+</style>
+</head>
+<body>
+<div class="container">
+<div style="display: table">1234</div>
+</div>
+<script>
+document.body.offsetTop;
+document.body.style.color = 'blue';
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/fast/table/table-row-before-after-content-around-block-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/fast/table/table-row-before-after-content-around-block-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/fast/table/table-row-before-after-content-around-block-expected.txt (0 => 95461)
--- trunk/LayoutTests/fast/table/table-row-before-after-content-around-block-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/table/table-row-before-after-content-around-block-expected.txt 2011-09-19 20:17:53 UTC (rev 95461)
@@ -0,0 +1,21 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x64
+ RenderBlock {HTML} at (0,0) size 800x64
+ RenderBody {BODY} at (8,8) size 784x48 [color=#0000FF]
+ RenderBlock {DIV} at (0,0) size 784x48
+ RenderTable at (0,0) size 64x16 [color=#000000]
+ RenderTableSection (anonymous) at (0,0) size 64x16
+ RenderTableRow (anonymous) at (0,0) size 64x16 [color=#0000FF]
+ RenderTableCell (anonymous) at (0,0) size 64x16 [r=0 c=0 rs=1 cs=1]
+ RenderText at (0,0) size 64x16
+ text run at (0,0) width 64: "ABCD"
+ RenderBlock {DIV} at (0,16) size 784x16
+ RenderText {#text} at (0,0) size 64x16
+ text run at (0,0) width 64: "1234"
+ RenderTable at (0,32) size 64x16 [color=#000000]
+ RenderTableSection (anonymous) at (0,0) size 64x16
+ RenderTableRow (anonymous) at (0,0) size 64x16 [color=#0000FF]
+ RenderTableCell (anonymous) at (0,0) size 64x16 [r=0 c=0 rs=1 cs=1]
+ RenderText at (0,0) size 64x16
+ text run at (0,0) width 64: "EFGH"
Added: trunk/LayoutTests/fast/table/table-row-before-after-content-around-block.html (0 => 95461)
--- trunk/LayoutTests/fast/table/table-row-before-after-content-around-block.html (rev 0)
+++ trunk/LayoutTests/fast/table/table-row-before-after-content-around-block.html 2011-09-19 20:17:53 UTC (rev 95461)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- Test passes if you see three blue boxes in three seperate rows. -->
+<html style="font: 1em/1 Ahem, sans-serif;">
+<style type="text/css">
+.container:before
+{
+ content: "ABCD";
+ display: table-row;
+}
+
+.container:after
+{
+ content: "EFGH";
+ display: table-row;
+}
+
+</style>
+</head>
+<body>
+<div class="container">
+<div style="display: block">1234</div>
+</div>
+<script>
+document.body.offsetTop;
+document.body.style.color = 'blue';
+</script>
+</html>
Added: trunk/LayoutTests/fast/table/table-row-before-after-content-around-table-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/fast/table/table-row-before-after-content-around-table-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/fast/table/table-row-before-after-content-around-table-expected.txt (0 => 95461)
--- trunk/LayoutTests/fast/table/table-row-before-after-content-around-table-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/table/table-row-before-after-content-around-table-expected.txt 2011-09-19 20:17:53 UTC (rev 95461)
@@ -0,0 +1,24 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x64
+ RenderBlock {HTML} at (0,0) size 800x64
+ RenderBody {BODY} at (8,8) size 784x48 [color=#0000FF]
+ RenderBlock {DIV} at (0,0) size 784x48
+ RenderTable at (0,0) size 64x16 [color=#000000]
+ RenderTableSection (anonymous) at (0,0) size 64x16
+ RenderTableRow (anonymous) at (0,0) size 64x16 [color=#0000FF]
+ RenderTableCell (anonymous) at (0,0) size 64x16 [r=0 c=0 rs=1 cs=1]
+ RenderText at (0,0) size 64x16
+ text run at (0,0) width 64: "ABCD"
+ RenderTable {DIV} at (0,16) size 64x16
+ RenderTableSection (anonymous) at (0,0) size 64x16
+ RenderTableRow (anonymous) at (0,0) size 64x16
+ RenderTableCell (anonymous) at (0,0) size 64x16 [r=0 c=0 rs=1 cs=1]
+ RenderText {#text} at (0,0) size 64x16
+ text run at (0,0) width 64: "1234"
+ RenderTable at (0,32) size 64x16 [color=#000000]
+ RenderTableSection (anonymous) at (0,0) size 64x16
+ RenderTableRow (anonymous) at (0,0) size 64x16 [color=#0000FF]
+ RenderTableCell (anonymous) at (0,0) size 64x16 [r=0 c=0 rs=1 cs=1]
+ RenderText at (0,0) size 64x16
+ text run at (0,0) width 64: "EFGH"
Added: trunk/LayoutTests/fast/table/table-row-before-after-content-around-table.html (0 => 95461)
--- trunk/LayoutTests/fast/table/table-row-before-after-content-around-table.html (rev 0)
+++ trunk/LayoutTests/fast/table/table-row-before-after-content-around-table.html 2011-09-19 20:17:53 UTC (rev 95461)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<!-- Test passes if you see three blue boxes in three seperate rows. -->
+<html style="font: 1em/1 Ahem, sans-serif;">
+<style type="text/css">
+.container:before
+{
+ content: "ABCD";
+ display: table-row;
+}
+
+.container:after
+{
+ content: "EFGH";
+ display: table-row;
+}
+
+</style>
+</head>
+<body>
+<div class="container">
+<div style="display: table">1234</div>
+</div>
+<script>
+document.body.offsetTop;
+document.body.style.color = 'blue';
+</script>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (95460 => 95461)
--- trunk/Source/WebCore/ChangeLog 2011-09-19 20:09:39 UTC (rev 95460)
+++ trunk/Source/WebCore/ChangeLog 2011-09-19 20:17:53 UTC (rev 95461)
@@ -1,3 +1,48 @@
+2011-09-16 Abhishek Arya <infe...@chromium.org>
+
+ Child not placed correctly when beforeChild (table part)
+ has both :before, :after content.
+ https://bugs.webkit.org/show_bug.cgi?id=67656
+
+ Reviewed by James Robinson.
+
+ Tests: fast/table/table-cell-before-after-content-around-table-block.html
+ fast/table/table-cell-before-after-content-around-table-row.html
+ fast/table/table-cell-before-after-content-around-table.html
+ fast/table/table-row-before-after-content-around-block.html
+ fast/table/table-row-before-after-content-around-table.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
+ 1. Use the new helper functions findAfterContentRenderer,
+ anonymousContainer.
+ 2. Rename anonymousChild to better name - beforeChildAnonymousContainer.
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::addChild):
+ When adding a new child, if beforeChild is a table part(
+ Table/TableSection/TableRow), we need to check if both
+ :before, :after content are shoved in one of the anonymous child.
+ If yes, we need to split the :before, :after content before adding
+ newChild. Easiest approach is to destroy the :before content, then add
+ the newChild and then call updateBeforeAfterContent to recreate the
+ :before content.
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::findBeforeContentRenderer): same as
+ beforePseudoElementRenderer, but ignores text childs since they are
+ sequentially added.
+ (WebCore::RenderObject::findAfterContentRenderer): same.
+ (WebCore::RenderObject::anonymousContainer):
+ (WebCore::objectIsRelayoutBoundary):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::addChild): use the new helpers and functionally
+ correct functions - findAfterContentRenderer, anonymousContainer. previous
+ implementation was wrong since it would not go inside, if :after content
+ is embedded deeper than one level.
+ * rendering/RenderTableRow.cpp:
+ (WebCore::RenderTableRow::addChild): same.
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::addChild): same.
+
2011-09-19 Robert Kroeger <rjkro...@chromium.org>
[chromium] Gesture recognizer fires taptype only every other touch
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (95460 => 95461)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-09-19 20:09:39 UTC (rev 95460)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-09-19 20:17:53 UTC (rev 95461)
@@ -668,26 +668,17 @@
void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild)
{
// Make sure we don't append things after :after-generated content if we have it.
- if (!beforeChild) {
- RenderObject* lastRenderer = lastChild();
- while (lastRenderer && lastRenderer->isAnonymous() && !isAfterContent(lastRenderer))
- lastRenderer = lastRenderer->lastChild();
- if (lastRenderer && isAfterContent(lastRenderer))
- beforeChild = lastRenderer;
- }
+ if (!beforeChild)
+ beforeChild = findAfterContentRenderer();
// If the requested beforeChild is not one of our children, then this is because
// there is an anonymous container within this object that contains the beforeChild.
if (beforeChild && beforeChild->parent() != this) {
- RenderObject* anonymousChild = beforeChild->parent();
- ASSERT(anonymousChild);
+ RenderObject* beforeChildAnonymousContainer = anonymousContainer(beforeChild);
+ ASSERT(beforeChildAnonymousContainer);
+ ASSERT(beforeChildAnonymousContainer->isAnonymous());
- while (anonymousChild->parent() != this)
- anonymousChild = anonymousChild->parent();
-
- ASSERT(anonymousChild->isAnonymous());
-
- if (anonymousChild->isAnonymousBlock()) {
+ if (beforeChildAnonymousContainer->isAnonymousBlock()) {
// Insert the child into the anonymous block box instead of here.
if (newChild->isInline() || beforeChild->parent()->firstChild() != beforeChild)
beforeChild->parent()->addChild(newChild, beforeChild);
@@ -696,19 +687,19 @@
return;
}
- ASSERT(anonymousChild->isTable());
+ ASSERT(beforeChildAnonymousContainer->isTable());
if ((newChild->isTableCol() && newChild->style()->display() == TABLE_COLUMN_GROUP)
|| (newChild->isRenderBlock() && newChild->style()->display() == TABLE_CAPTION)
|| newChild->isTableSection()
|| newChild->isTableRow()
|| newChild->isTableCell()) {
// Insert into the anonymous table.
- anonymousChild->addChild(newChild, beforeChild);
+ beforeChildAnonymousContainer->addChild(newChild, beforeChild);
return;
}
// Go on to insert before the anonymous table.
- beforeChild = anonymousChild;
+ beforeChild = beforeChildAnonymousContainer;
}
// Check for a spanning element in columns.
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (95460 => 95461)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2011-09-19 20:09:39 UTC (rev 95460)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2011-09-19 20:17:53 UTC (rev 95461)
@@ -282,6 +282,17 @@
if (!children)
return;
+ RenderObject* beforeContent = 0;
+ bool beforeChildHasBeforeAndAfterContent = false;
+ if (beforeChild && (beforeChild->isTable() || beforeChild->isTableSection() || beforeChild->isTableRow())) {
+ beforeContent = beforeChild->findBeforeContentRenderer();
+ RenderObject* afterContent = beforeChild->findAfterContentRenderer();
+ if (beforeContent && afterContent) {
+ beforeChildHasBeforeAndAfterContent = true;
+ beforeContent->destroy();
+ }
+ }
+
bool needsTable = false;
if (newChild->isTableCol() && newChild->style()->display() == TABLE_COLUMN_GROUP)
@@ -320,11 +331,15 @@
// Just add it...
children->insertChildNode(this, newChild, beforeChild);
}
+
if (newChild->isText() && newChild->style()->textTransform() == CAPITALIZE) {
RefPtr<StringImpl> textToTransform = toRenderText(newChild)->originalText();
if (textToTransform)
toRenderText(newChild)->setText(textToTransform.release(), true);
}
+
+ if (beforeChildHasBeforeAndAfterContent)
+ children->updateBeforeAfterContent(this, BEFORE);
}
void RenderObject::removeChild(RenderObject* oldChild)
Modified: trunk/Source/WebCore/rendering/RenderObject.h (95460 => 95461)
--- trunk/Source/WebCore/rendering/RenderObject.h 2011-09-19 20:09:39 UTC (rev 95460)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2011-09-19 20:17:53 UTC (rev 95461)
@@ -337,6 +337,28 @@
static inline bool isAfterContent(const RenderObject* obj) { return obj && obj->isAfterContent(); }
static inline bool isBeforeOrAfterContent(const RenderObject* obj) { return obj && obj->isBeforeOrAfterContent(); }
+ inline RenderObject* findBeforeContentRenderer() const
+ {
+ RenderObject* renderer = beforePseudoElementRenderer();
+ return isBeforeContent(renderer) ? renderer : 0;
+ }
+
+ inline RenderObject* findAfterContentRenderer() const
+ {
+ RenderObject* renderer = afterPseudoElementRenderer();
+ return isAfterContent(renderer) ? renderer : 0;
+ }
+
+ inline RenderObject* anonymousContainer(RenderObject* child)
+ {
+ RenderObject* container = child;
+ while (container->parent() != this)
+ container = container->parent();
+
+ ASSERT(container->isAnonymous());
+ return container;
+ }
+
bool childrenInline() const { return m_childrenInline; }
void setChildrenInline(bool b = true) { m_childrenInline = b; }
bool hasColumns() const { return m_hasColumns; }
Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (95460 => 95461)
--- trunk/Source/WebCore/rendering/RenderTable.cpp 2011-09-19 20:09:39 UTC (rev 95460)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp 2011-09-19 20:17:53 UTC (rev 95461)
@@ -107,8 +107,10 @@
void RenderTable::addChild(RenderObject* child, RenderObject* beforeChild)
{
// Make sure we don't append things after :after-generated content if we have it.
- if (!beforeChild && isAfterContent(lastChild()))
- beforeChild = lastChild();
+ if (!beforeChild) {
+ if (RenderObject* afterContentRenderer = findAfterContentRenderer())
+ beforeChild = anonymousContainer(afterContentRenderer);
+ }
bool wrapInAnonymousSection = !child->isPositioned();
Modified: trunk/Source/WebCore/rendering/RenderTableRow.cpp (95460 => 95461)
--- trunk/Source/WebCore/rendering/RenderTableRow.cpp 2011-09-19 20:09:39 UTC (rev 95460)
+++ trunk/Source/WebCore/rendering/RenderTableRow.cpp 2011-09-19 20:17:53 UTC (rev 95461)
@@ -83,8 +83,10 @@
void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild)
{
// Make sure we don't append things after :after-generated content if we have it.
- if (!beforeChild && isAfterContent(lastChild()))
- beforeChild = lastChild();
+ if (!beforeChild) {
+ if (RenderObject* afterContentRenderer = findAfterContentRenderer())
+ beforeChild = anonymousContainer(afterContentRenderer);
+ }
if (!child->isTableCell()) {
RenderObject* last = beforeChild;
Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (95460 => 95461)
--- trunk/Source/WebCore/rendering/RenderTableSection.cpp 2011-09-19 20:09:39 UTC (rev 95460)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp 2011-09-19 20:17:53 UTC (rev 95461)
@@ -98,8 +98,10 @@
void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild)
{
// Make sure we don't append things after :after-generated content if we have it.
- if (!beforeChild && isAfterContent(lastChild()))
- beforeChild = lastChild();
+ if (!beforeChild) {
+ if (RenderObject* afterContentRenderer = findAfterContentRenderer())
+ beforeChild = anonymousContainer(afterContentRenderer);
+ }
if (!child->isTableRow()) {
RenderObject* last = beforeChild;