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; }
IntRect RenderReplaced::selectionRect(bool clipToVisibleContent) { ASSERT(!needsLayout()); if (!isSelected()) return IntRect(); IntRect rect = localSelectionRect(); if (clipToVisibleContent) computeAbsoluteRepaintRect(rect); else { FloatPoint absPos = localToAbsoluteForContent(FloatPoint()); rect.move(absPos.x(), absPos.y()); } return rect; }
IntRect RenderListMarker::selectionRect(bool clipToVisibleContent) { ASSERT(!needsLayout()); if (selectionState() == SelectionNone || !inlineBoxWrapper()) return IntRect(); RootInlineBox* root = inlineBoxWrapper()->root(); IntRect rect(0, root->selectionTop() - yPos(), width(), root->selectionHeight()); if (clipToVisibleContent) computeAbsoluteRepaintRect(rect); else { int absx, absy; absolutePosition(absx, absy); rect.move(absx, absy); } return rect; }
IntRect RenderReplaced::absoluteClippedOverflowRect() { if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent()) return IntRect(); // The selectionRect can project outside of the overflowRect, so use // that for repainting to avoid selection painting glitches IntRect r = localSelectionRect(false); RenderView* v = view(); if (v) r.move(v->layoutDelta()); if (style()) { if (style()->hasAppearance()) // The theme may wish to inflate the rect used when repainting. theme()->adjustRepaintRect(this, r); if (v) r.inflate(style()->outlineSize()); } computeAbsoluteRepaintRect(r); return r; }