void InlineTextBox::setLogicalOverflowRect(const LayoutRect& rect) { ASSERT(!knownToHaveNoOverflow()); if (!gTextBoxesWithOverflow) gTextBoxesWithOverflow = new InlineTextBoxOverflowMap; gTextBoxesWithOverflow->set(this, rect); }
void InlineTextBox::destroy() { AbstractInlineTextBox::willDestroy(this); if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow) gTextBoxesWithOverflow->remove(this); InlineTextBoxPainter::removeFromTextBlobCache(*this); InlineBox::destroy(); }
void InlineTextBox::move(const LayoutSize& delta) { InlineBox::move(delta); if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow) { const auto& it = gTextBoxesWithOverflow->find(this); if (it != gTextBoxesWithOverflow->end()) it->value.move(isHorizontal() ? delta : delta.transposedSize()); } }
void InlineTextBox::move(const LayoutSize& delta) { InlineBox::move(delta); if (!knownToHaveNoOverflow()) { LayoutRect logicalOverflowRect = this->logicalOverflowRect(); logicalOverflowRect.move(isHorizontal() ? delta : delta.transposedSize()); setLogicalOverflowRect(logicalOverflowRect); } }
LayoutRect InlineTextBox::logicalOverflowRect() const { if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow) return logicalFrameRect(); const auto& it = gTextBoxesWithOverflow->find(this); if (it != gTextBoxesWithOverflow->end()) return it->value; return logicalFrameRect(); }
LayoutRect InlineTextBox::logicalOverflowRect() const { if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow) { // FIXME: the call to rawValue() below is temporary and should be removed once the transition // to LayoutUnit-based types is complete (crbug.com/321237). The call to enclosingIntRect() // should also likely be switched to LayoutUnit pixel-snapping. return LayoutRect(enclosingIntRect(logicalFrameRect())); } return gTextBoxesWithOverflow->get(this); }