void InlineTextBox::setLogicalOverflowRect(const LayoutRect& rect)
{
    ASSERT(!knownToHaveNoOverflow());
    if (!gTextBoxesWithOverflow)
        gTextBoxesWithOverflow = new InlineTextBoxOverflowMap;
    gTextBoxesWithOverflow->set(this, rect);
}
示例#2
0
void InlineTextBox::destroy() {
  AbstractInlineTextBox::willDestroy(this);

  if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow)
    gTextBoxesWithOverflow->remove(this);
  InlineTextBoxPainter::removeFromTextBlobCache(*this);
  InlineBox::destroy();
}
示例#3
0
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);
    }
}
示例#5
0
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);
}