Пример #1
0
InlineBox* EllipsisBox::markupBox() const
{
    if (!m_shouldPaintMarkupBox || !m_renderer->isRenderBlock())
        return 0;

    RenderBlock* block = toRenderBlock(m_renderer);
    RootInlineBox* lastLine = block->lineAtIndex(block->lineCount() - 1);
    if (!lastLine)
        return 0;

    // If the last line-box on the last line of a block is a link, -webkit-line-clamp paints that box after the ellipsis.
    // It does not actually move the link.
    InlineBox* anchorBox = lastLine->lastChild();
    if (!anchorBox || !anchorBox->renderer()->style()->isLink())
        return 0;

    return anchorBox;
}