IntRect RenderReplaced::selectionRect(bool clipToVisibleContent) { ASSERT(!needsLayout()); if (!isSelected()) return IntRect(); if (!m_inlineBoxWrapper) // We're a block-level replaced element. Just return our own dimensions. return absoluteBoundingBoxRect(); RenderBlock* cb = containingBlock(); if (!cb) return IntRect(); RootInlineBox* root = m_inlineBoxWrapper->root(); IntRect rect(0, root->selectionTop() - yPos(), width(), root->selectionHeight()); if (clipToVisibleContent) computeAbsoluteRepaintRect(rect); else { int absx, absy; absolutePositionForContent(absx, absy); rect.move(absx, absy); } return rect; }
void RenderContainer::addLineBoxRects(Vector<IntRect>& rects, unsigned start, unsigned end, bool) { if (!m_firstChild && (isInline() || isAnonymousBlock())) { int x, y; absolutePositionForContent(x, y); absoluteRects(rects, x, y); return; } if (!m_firstChild) return; unsigned offset = start; for (RenderObject* child = childAt(start); child && offset < end; child = child->nextSibling(), ++offset) { if (child->isText() || child->isInline() || child->isAnonymousBlock()) { int x, y; child->absolutePositionForContent(x, y); child->absoluteRects(rects, x, y); } } }