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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 1 10:30:53 PST 2011


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

           Summary: Consider padding and border when looking for the
                    next/previous line position
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Text
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: msanchez at igalia.com
            Blocks: 25533


In WebCore/editing/visible_units.cpp, in nextLinePosition() and previousLinePosition() functions there are the following lines at some point:

  renderer->positionForPoint(IntPoint(x - absPos.x(), root->lineTop()));

...the problem with this line is that it doesn't take into consideration that objects RootInlineBoxes could have a non-zero padding and/or border so you could be sometimes looking for the wrong point when trying to target the line above or below the current object. Instead, root->selectionTop() should be used, which does take those "extra" values into account.

See https://bugs.webkit.org/show_bug.cgi?id=25533#c10 for an example of problems happening because of this: when having links rendered with 1px width border at the bottom (border-bottom: 1px), and having the caret positioned inside that element, pressing down to move the caret to the line below will result on keeping the caret in the wrong place, since the lineTop() won't take into account that border at the bottom and will still point to the current line, not the one below.

I've just seen this in the GTK port with caret browsing enabled, so I'm not sure whether this is reproducible in other ports, but I swear the problem is there.

I'm marking this bug as blocking bug 25533 since it directly impacts its resolution (as it's a more general bug in the way that it tries to fix "wrong vertical navigation").

Attaching a patch + layout test write after committing this report.

-- 
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