Changeset 94988 in webkit


Ignore:
Timestamp:
Sep 12, 2011 4:32:07 PM (13 years ago)
Author:
rniwa@webkit.org
Message:

REGRESSION: Moving up doesn't work in some cases
https://bugs.webkit.org/show_bug.cgi?id=67522

Reviewed by Eric Seidel.

Source/WebCore:

The bug was caused by previousLinePosition's attempting to obtain the last root line box using
a position at minCaretOffset (which is, in practice, located at the beginning of wrapped lines).

Fix the bug by calling maxCaretOffset instead. Because isCandidate returns false at (br, 1),
use the positionBeforeNode for br elements.

Test: editing/selection/move-up-into-wrapped-line.html

  • editing/visible_units.cpp:

(WebCore::previousLinePosition):

LayoutTests:

Add a test to move caret upwards from an empty line below wrapped lines.

WebKit used to skip wrapped lines and placed caret at the beginning of the first of those wrapped lines
instead of before the last.

  • editing/selection/move-up-into-wrapped-line-expected.txt: Added.
  • editing/selection/move-up-into-wrapped-line.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r94980 r94988  
     12011-09-12  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        REGRESSION: Moving up doesn't work in some cases
     4        https://bugs.webkit.org/show_bug.cgi?id=67522
     5
     6        Reviewed by Eric Seidel.
     7
     8        Add a test to move caret upwards from an empty line below wrapped lines.
     9
     10        WebKit used to skip wrapped lines and placed caret at the beginning of the first of those wrapped lines
     11        instead of before the last.
     12
     13        * editing/selection/move-up-into-wrapped-line-expected.txt: Added.
     14        * editing/selection/move-up-into-wrapped-line.html: Added.
     15
    1162011-09-12  Beth Dakin  <bdakin@apple.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r94986 r94988  
     12011-09-12  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        REGRESSION: Moving up doesn't work in some cases
     4        https://bugs.webkit.org/show_bug.cgi?id=67522
     5
     6        Reviewed by Eric Seidel.
     7
     8        The bug was caused by previousLinePosition's attempting to obtain the last root line box using
     9        a position at minCaretOffset (which is, in practice, located at the beginning of wrapped lines).
     10
     11        Fix the bug by calling maxCaretOffset instead. Because isCandidate returns false at (br, 1),
     12        use the positionBeforeNode for br elements.
     13
     14        Test: editing/selection/move-up-into-wrapped-line.html
     15
     16        * editing/visible_units.cpp:
     17        (WebCore::previousLinePosition):
     18
    1192011-09-12  David Levin  <levin@chromium.org>
    220
  • trunk/Source/WebCore/editing/visible_units.cpp

    r93935 r94988  
    534534            if (highestEditableRoot(firstPositionInOrBeforeNode(n)) != highestRoot)
    535535                break;
    536             Position pos = createLegacyEditingPosition(n, caretMinOffset(n));
     536            Position pos = n->hasTagName(brTag) ? positionBeforeNode(n) : createLegacyEditingPosition(n, caretMaxOffset(n));
    537537            if (pos.isCandidate()) {
    538538                pos.getInlineBoxAndOffset(DOWNSTREAM, box, ignoredCaretOffset);
Note: See TracChangeset for help on using the changeset viewer.