diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 543f83a4a23ad6b0000433e4b563e8d9838ed646..665d84b41808832be1a18c9d2e12e95c83e73af4 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2010-08-30 Adam Barth + + Reviewed by Darin Adler. + + WebCore::RenderBlock::addChild* NULL ptrs + https://bugs.webkit.org/show_bug.cgi?id=43722 + + * fast/ruby/before-doesnt-crash-expected.txt: Added. + * fast/ruby/before-doesnt-crash.html: Added. + 2010-08-29 Adam Barth Reviewed by Darin Adler. diff --git a/LayoutTests/fast/ruby/before-doesnt-crash-expected.txt b/LayoutTests/fast/ruby/before-doesnt-crash-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..3b0bc20ebfbc1a70b182b046598c34331778df88 --- /dev/null +++ b/LayoutTests/fast/ruby/before-doesnt-crash-expected.txt @@ -0,0 +1,2 @@ + + This test passes if it doesn't crash. diff --git a/LayoutTests/fast/ruby/before-doesnt-crash.html b/LayoutTests/fast/ruby/before-doesnt-crash.html new file mode 100644 index 0000000000000000000000000000000000000000..c93af26879756eb68a044db475ad1406ef5330bd --- /dev/null +++ b/LayoutTests/fast/ruby/before-doesnt-crash.html @@ -0,0 +1,19 @@ + + + + + + + + + + This test passes if it doesn't crash. + + diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 9e9d9606e49b389a40a30fd273ddd6c9ed3ab8d3..665823cebebc1d9cd2e7013727301ae73ea781b3 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,17 @@ +2010-08-30 Adam Barth + + Reviewed by Darin Adler. + + WebCore::RenderBlock::addChild* NULL ptrs + https://bugs.webkit.org/show_bug.cgi?id=43722 + + Also includes some cleanup of comments and ASSERTs. + + Test: fast/ruby/before-doesnt-crash.html + + * rendering/RenderRuby.cpp: + (WebCore::RenderRubyAsInline::addChild): + 2010-08-30 Marc-Antoine Ruel Reviewed by Kent Tamura diff --git a/WebCore/rendering/RenderRuby.cpp b/WebCore/rendering/RenderRuby.cpp index 4ab9d735e6159455e6ffe1562c2ebc8fbdb4d3b2..2f543d51a8cd2bc7e322f9b23c166bd323240aba 100644 --- a/WebCore/rendering/RenderRuby.cpp +++ b/WebCore/rendering/RenderRuby.cpp @@ -75,24 +75,19 @@ bool RenderRubyAsInline::isChildAllowed(RenderObject* child, RenderStyle*) const void RenderRubyAsInline::addChild(RenderObject* child, RenderObject* beforeChild) { - // Note: ':after' content is handled implicitely below + // Note: ':after' content is handled implicitly below - // if child is a ruby run, just add it normally if (child->isRubyRun()) { RenderInline::addChild(child, beforeChild); return; } - if (beforeChild && !isAfterContent(beforeChild)) { - // insert child into run - ASSERT(!beforeChild->isRubyRun()); - RenderRubyRun* run = findRubyRunParent(beforeChild); - ASSERT(run); // beforeChild should always have a run as parent - if (run) { + if (beforeChild && !isAfterContent(beforeChild) && !beforeChild->isRubyRun()) { + if (RenderRubyRun* run = findRubyRunParent(beforeChild)) { run->addChild(child, beforeChild); return; } - ASSERT(false); // beforeChild should always have a run as parent! + ASSERT_NOT_REACHED(); // beforeChild should always have a run as parent! // Emergency fallback: fall through and just append. }