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); }
void 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)); RenderBlock::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); }