[Webkit-unassigned] [Bug 55481] Consider padding and border when looking for the next/previous line position

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 26 16:27:40 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=55481





--- Comment #11 from Eric Seidel <eric at webkit.org>  2011-04-26 16:27:40 PST ---
(From update of attachment 84250)
int lineTop() const { return m_lineTop; }

int RootInlineBox::selectionTop() const
{
    int selectionTop = m_lineTop;

    if (m_hasAnnotationsBefore)
        selectionTop -= !renderer()->style()->isFlippedLinesWritingMode() ? computeOverAnnotationAdjustment(m_lineTop) : computeUnderAnnotationAdjustment(m_lineTop);

    if (renderer()->style()->isFlippedLinesWritingMode())
        return selectionTop;

    int prevBottom = prevRootBox() ? prevRootBox()->selectionBottom() : block()->borderBefore() + block()->paddingBefore();
    if (prevBottom < selectionTop && block()->containsFloats()) {
        // This line has actually been moved further down, probably from a large line-height, but possibly because the
        // line was forced to clear floats.  If so, let's check the offsets, and only be willing to use the previous
        // line's bottom if the offsets are greater on both sides.
        int prevLeft = block()->logicalLeftOffsetForLine(prevBottom, false);
        int prevRight = block()->logicalRightOffsetForLine(prevBottom, false);
        int newLeft = block()->logicalLeftOffsetForLine(selectionTop, false);
        int newRight = block()->logicalRightOffsetForLine(selectionTop, false);
        if (prevLeft > newLeft || prevRight < newRight)
            return selectionTop;
    }

    return prevBottom;
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list