Commit ffa2189d authored by mjs@apple.com's avatar mjs@apple.com

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: svn://svn.chromium.org/blink/trunk@83255 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 18517db0
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.
2011-04-07 Ryosuke Niwa <rniwa@webkit.org>
Reviewed by Darin Adler.
This test should load without crashing. It checks that generated content in tables is initialized properly.
<html>
<head>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<style>
body :after {
content: ".";
}
</style>
</head>
<body>
<p>This test should load without crashing. It checks that generated
content in tables is initialized properly.</p>
<table style="border-collapse: collapse;">
<tr>
<td><input type="text"></td>
<td><input type="submit"></td>
</tr>
</table>
</body>
</html>
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 Beth Dakin <bdakin@apple.com>
Reviewed by Simon Fraser.
......@@ -63,17 +63,23 @@ void RenderTableRow::styleWillChange(StyleDifference diff, const RenderStyle* ne
RenderBox::styleWillChange(diff, newStyle);
}
void RenderTableRow::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
void RenderTableRow::updateBeforeAndAfterContent()
{
RenderBox::styleDidChange(diff, oldStyle);
// Update pseudos for :before and :after now.
if (!isAnonymous() && document()->usesBeforeAfterRules()) {
children()->updateBeforeAfterContent(this, BEFORE);
children()->updateBeforeAfterContent(this, AFTER);
}
}
void RenderTableRow::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderBox::styleDidChange(diff, oldStyle);
if (parent())
updateBeforeAndAfterContent();
}
void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild)
{
// Make sure we don't append things after :after-generated content if we have it.
......
......@@ -39,6 +39,8 @@ public:
RenderTableSection* section() const { return toRenderTableSection(parent()); }
RenderTable* table() const { return toRenderTable(parent()->parent()); }
void updateBeforeAndAfterContent();
private:
virtual RenderObjectChildList* virtualChildren() { return children(); }
virtual const RenderObjectChildList* virtualChildren() const { return children(); }
......
......@@ -144,6 +144,7 @@ void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild
ASSERT(!beforeChild || beforeChild->isTableRow());
RenderBox::addChild(child, beforeChild);
toRenderTableRow(child)->updateBeforeAndAfterContent();
}
void RenderTableSection::removeChild(RenderObject* oldChild)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment