static inline bool isRubyAfterBlock(const RenderObject* object) { return isAnonymousRubyInlineBlock(object) && !object->nextSibling() && object->firstChild() && object->firstChild()->style()->styleType() == AFTER; }
static inline bool isRubyBeforeBlock(const RenderObject* object) { return isAnonymousRubyInlineBlock(object) && !object->previousSibling() && object->firstChild() && object->firstChild()->style()->styleType() == BEFORE; }
static inline bool isRubyChildForNormalRemoval(const RenderObject& object) { return object.isRubyRun() || object.isBeforeContent() || object.isAfterContent() || object.isRenderMultiColumnFlowThread() || object.isRenderMultiColumnSet() || isAnonymousRubyInlineBlock(&object); }
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); }
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); }