Commit 9b381bf1 authored by abarth@webkit.org's avatar abarth@webkit.org

2010-08-30 Adam Barth <abarth@webkit.org>

        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-30  Adam Barth  <abarth@webkit.org>

        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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent dc3b19e7
2010-08-30 Adam Barth <abarth@webkit.org>
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 <abarth@webkit.org> 2010-08-29 Adam Barth <abarth@webkit.org>
Reviewed by Darin Adler. Reviewed by Darin Adler.
<html>
<head>
<style>
:before{
content:""
};
</style>
</head>
<body onload="document.linkColor=0;">
<ruby>
<rt></rt>
</ruby>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
This test passes if it doesn't crash.
</body>
</html>
2010-08-30 Adam Barth <abarth@webkit.org>
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 <maruel@chromium.org> 2010-08-30 Marc-Antoine Ruel <maruel@chromium.org>
Reviewed by Kent Tamura Reviewed by Kent Tamura
...@@ -75,24 +75,19 @@ bool RenderRubyAsInline::isChildAllowed(RenderObject* child, RenderStyle*) const ...@@ -75,24 +75,19 @@ bool RenderRubyAsInline::isChildAllowed(RenderObject* child, RenderStyle*) const
void RenderRubyAsInline::addChild(RenderObject* child, RenderObject* beforeChild) 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()) { if (child->isRubyRun()) {
RenderInline::addChild(child, beforeChild); RenderInline::addChild(child, beforeChild);
return; return;
} }
if (beforeChild && !isAfterContent(beforeChild)) { if (beforeChild && !isAfterContent(beforeChild) && !beforeChild->isRubyRun()) {
// insert child into run if (RenderRubyRun* run = findRubyRunParent(beforeChild)) {
ASSERT(!beforeChild->isRubyRun());
RenderRubyRun* run = findRubyRunParent(beforeChild);
ASSERT(run); // beforeChild should always have a run as parent
if (run) {
run->addChild(child, beforeChild); run->addChild(child, beforeChild);
return; 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. // Emergency fallback: fall through and just append.
} }
......
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