LayoutRect InlineTextBox::logicalOverflowRect() const { if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow) return logicalFrameRect(); const auto& it = gTextBoxesWithOverflow->find(this); if (it != gTextBoxesWithOverflow->end()) return it->value; return logicalFrameRect(); }
void InlineTextBox::setLogicalOverflowRect(const LayoutRect& rect) { ASSERT(!knownToHaveNoOverflow()); DCHECK(rect != logicalFrameRect()); if (!gTextBoxesWithOverflow) gTextBoxesWithOverflow = new InlineTextBoxOverflowMap; gTextBoxesWithOverflow->set(this, rect); }
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); }
bool InlineBox::nodeAtPoint(HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit /* lineTop */, LayoutUnit /* lineBottom */) { // Hit test all phases of replaced elements atomically, as though the replaced element established its // own stacking context. (See Appendix E.2, section 6.4 on inline block/table elements in the CSS2.1 // specification.) LayoutPoint childPoint = accumulatedOffset; if (parent()->lineLayoutItem().hasFlippedBlocksWritingMode()) // Faster than calling containingBlock(). childPoint = layoutObject().containingBlock()->flipForWritingModeForChild(&toLayoutBox(layoutObject()), childPoint); if (lineLayoutItem().style()->hasBorderRadius()) { LayoutRect borderRect = logicalFrameRect(); borderRect.moveBy(accumulatedOffset); FloatRoundedRect border = lineLayoutItem().style()->getRoundedBorderFor(borderRect); if (!locationInContainer.intersects(border)) return false; } return lineLayoutItem().hitTest(result, locationInContainer, childPoint); }