2011-04-07  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Simon Fraser.

        REGRESSION (r80871): Crash when visiting http://broadband.biglobe.ne.jp/
        https://bugs.webkit.org/show_bug.cgi?id=56297
        <rdar://problem/9131597>

        Test: fast/css-generated-content/table-row-after-no-crash.html

        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::styleDidChange): Factor out generation of before/after
        content, and only do it if the row already has a parent. For construction of
        anonymous cells to work correctly, the row needs to already have a parent, so
        in that case wait a bit.
        (WebCore::RenderTableRow::updateBeforeAndAfterContent): Factored out to here.
        * rendering/RenderTableRow.h:
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::addChild): When adding a row, update its
        before/after content, in case it had any.
2011-04-07  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Simon Fraser.

        REGRESSION (r80871): Crash when visiting http://broadband.biglobe.ne.jp/
        https://bugs.webkit.org/show_bug.cgi?id=56297
        <rdar://problem/9131597>

        * fast/css-generated-content/table-row-after-no-crash-expected.txt: Added.
        * fast/css-generated-content/table-row-after-no-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83255 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp
index 8f80c6f..6b080b8 100644
--- a/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/Source/WebCore/rendering/RenderTableSection.cpp
@@ -144,6 +144,7 @@
 
     ASSERT(!beforeChild || beforeChild->isTableRow());
     RenderBox::addChild(child, beforeChild);
+    toRenderTableRow(child)->updateBeforeAndAfterContent();
 }
 
 void RenderTableSection::removeChild(RenderObject* oldChild)