void LayoutRubyAsBlock::removeChild(LayoutObject* child)
{
    // If the child's parent is *this (must be a ruby run), just use the normal remove method.
    if (child->parent() == this) {
        ASSERT(child->isRubyRun());
        LayoutBlockFlow::removeChild(child);
        return;
    }

    // Otherwise find the containing run and remove it from there.
    LayoutRubyRun* run = findRubyRunParent(child);
    ASSERT(run);
    run->removeChild(child);
}
Beispiel #2
0
void RenderRubyAsBlock::removeChild(RenderObject* child)
{
    // If the child's parent is *this (a ruby run or :before or :after content),
    // just use the normal remove method.
    if (child->isRubyRun() || child->isBeforeContent() || child->isAfterContent()) {
        RenderBlock::removeChild(child);
        return;
    }

    // Otherwise find the containing run and remove it from there.
    ASSERT(child->parent() != this);
    RenderRubyRun* run = findRubyRunParent(child);
    ASSERT(run);
    run->removeChild(child);
}
RenderObject* RenderRubyAsBlock::removeChild(RenderObject& child)
{
    // If the child's parent is *this (must be a ruby run or generated content or anonymous block),
    // just use the normal remove method.
    if (child.parent() == this) {
        ASSERT(child.isRubyRun() || child.isBeforeContent() || child.isAfterContent() || isAnonymousRubyInlineBlock(&child));
        return RenderBlockFlow::removeChild(child);
    }
    // If the child's parent is an anoymous block (must be generated :before/:after content)
    // just use the block's remove method.
    if (isAnonymousRubyInlineBlock(child.parent())) {
        ASSERT(child.isBeforeContent() || child.isAfterContent());
        RenderObject* next = child.parent()->removeChild(child);
        removeChild(*child.parent());
        return next;
    }

    // Otherwise find the containing run and remove it from there.
    RenderRubyRun& run = findRubyRunParent(child);
    return run.removeChild(child);
}
Beispiel #4
0
void RenderRubyAsInline::removeChild(RenderObject* child)
{
    // If the child's parent is *this (must be a ruby run or generated content or anonymous block),
    // just use the normal remove method.
    if (child->parent() == this) {
        ASSERT(child->isRubyRun() || child->isBeforeContent() || child->isAfterContent() || isAnonymousRubyInlineBlock(child));
        RenderInline::removeChild(child);
        return;
    }
    // If the child's parent is an anoymous block (must be generated :before/:after content)
    // just use the block's remove method.
    if (isAnonymousRubyInlineBlock(child->parent())) {
        ASSERT(child->isBeforeContent() || child->isAfterContent());
        child->parent()->removeChild(child);
        removeChild(child->parent());
        return;
    }

    // Otherwise find the containing run and remove it from there.
    RenderRubyRun* run = findRubyRunParent(child);
    ASSERT(run);
    run->removeChild(child);
}