Child not placed correctly when beforeChild (table part)
[WebKit.git] / Source / WebCore / rendering / RenderTableRow.cpp
index c705348..082eef4 100644 (file)
@@ -83,8 +83,10 @@ void RenderTableRow::styleDidChange(StyleDifference diff, const RenderStyle* old
 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;