Changeset 76610 in webkit


Ignore:
Timestamp:
Jan 25, 2011 10:42:43 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-01-25 Benjamin Kalman <kalman@chromium.org>

Reviewed by Ryosuke Niwa.

Cannot extend or modify forward by word over a non-contenteditable region
https://bugs.webkit.org/show_bug.cgi?id=53070

Add regression test.

  • editing/selection/extend-forward-by-word-over-non-editable-expected.txt: Added.
  • editing/selection/extend-forward-by-word-over-non-editable.html: Added.

2011-01-25 Benjamin Kalman <kalman@chromium.org>

Reviewed by Ryosuke Niwa.

Cannot extend or modify forward by word over a non-contenteditable region
https://bugs.webkit.org/show_bug.cgi?id=53070

Test: editing/selection/extend-forward-by-word-over-non-editable.html

Change all instances of honorEditableBoundaryAtOrAfter to honorEditableBoundaryAtOrBefore and vice versa in the
functions which determine the end/start of words/lines/sentences in visible_units.cpp.

This fixes the bug where moving forwards by a word over a non-contenteditable region would place the cursor
inside that region, and then get moved back to the start of the word due to honorEditableBoundaryAtOrBefore.
The cursor is now moved to the end of the region (which is effectively a noop in this case).

  • editing/visible_units.cpp: Change all instances of honorEditableBoundaryAtOrAfter to honorEditableBoundaryAtOrBefore and vice versa. (WebCore::previousWordPosition): (WebCore::nextWordPosition): (WebCore::startOfLine): (WebCore::endOfLine): (WebCore::previousSentencePosition): (WebCore::nextSentencePosition): (WebCore::logicalStartOfLine): (WebCore::logicalEndOfLine):
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r76607 r76610  
     12011-01-25  Benjamin Kalman  <kalman@chromium.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        Cannot extend or modify forward by word over a non-contenteditable region
     6        https://bugs.webkit.org/show_bug.cgi?id=53070
     7
     8        Add regression test.
     9
     10        * editing/selection/extend-forward-by-word-over-non-editable-expected.txt: Added.
     11        * editing/selection/extend-forward-by-word-over-non-editable.html: Added.
     12
    1132011-01-25  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r76606 r76610  
     12011-01-25  Benjamin Kalman  <kalman@chromium.org>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        Cannot extend or modify forward by word over a non-contenteditable region
     6        https://bugs.webkit.org/show_bug.cgi?id=53070
     7
     8        Test: editing/selection/extend-forward-by-word-over-non-editable.html
     9
     10        Change all instances of honorEditableBoundaryAtOrAfter to honorEditableBoundaryAtOrBefore and vice versa in the
     11        functions which determine the end/start of words/lines/sentences in visible_units.cpp.
     12
     13        This fixes the bug where moving forwards by a word over a non-contenteditable region would place the cursor
     14        inside that region, and then get moved back to the start of the word due to honorEditableBoundaryAtOrBefore.
     15        The cursor is now moved to the end of the region (which is effectively a noop in this case).
     16
     17        * editing/visible_units.cpp: Change all instances of honorEditableBoundaryAtOrAfter to
     18        honorEditableBoundaryAtOrBefore and vice versa.
     19        (WebCore::previousWordPosition):
     20        (WebCore::nextWordPosition):
     21        (WebCore::startOfLine):
     22        (WebCore::endOfLine):
     23        (WebCore::previousSentencePosition):
     24        (WebCore::nextSentencePosition):
     25        (WebCore::logicalStartOfLine):
     26        (WebCore::logicalEndOfLine):
     27
    1282011-01-25  Yael Aharon  <yael.aharon@nokia.com>
    229
  • trunk/Source/WebCore/editing/visible_units.cpp

    r76438 r76610  
    293293{
    294294    VisiblePosition prev = previousBoundary(c, previousWordPositionBoundary);
    295     return c.honorEditableBoundaryAtOrAfter(prev);
     295    return c.honorEditableBoundaryAtOrBefore(prev);
    296296}
    297297
     
    309309{
    310310    VisiblePosition next = nextBoundary(c, nextWordPositionBoundary);   
    311     return c.honorEditableBoundaryAtOrBefore(next);
     311    return c.honorEditableBoundaryAtOrAfter(next);
    312312}
    313313
     
    392392    VisiblePosition visPos = startPositionForLine(c);
    393393
    394     return c.honorEditableBoundaryAtOrAfter(visPos);
     394    return c.honorEditableBoundaryAtOrBefore(visPos);
    395395}
    396396
     
    459459    }
    460460   
    461     return c.honorEditableBoundaryAtOrBefore(visPos);
     461    return c.honorEditableBoundaryAtOrAfter(visPos);
    462462}
    463463
     
    721721{
    722722    VisiblePosition prev = previousBoundary(c, previousSentencePositionBoundary);
    723     return c.honorEditableBoundaryAtOrAfter(prev);
     723    return c.honorEditableBoundaryAtOrBefore(prev);
    724724}
    725725
     
    735735{
    736736    VisiblePosition next = nextBoundary(c, nextSentencePositionBoundary);   
    737     return c.honorEditableBoundaryAtOrBefore(next);
     737    return c.honorEditableBoundaryAtOrAfter(next);
    738738}
    739739
     
    11341134    VisiblePosition visPos = logicalStartPositionForLine(c);
    11351135   
    1136     return c.honorEditableBoundaryAtOrAfter(visPos);
     1136    return c.honorEditableBoundaryAtOrBefore(visPos);
    11371137}
    11381138
     
    11911191        visPos = visPos.previous();
    11921192   
    1193     return c.honorEditableBoundaryAtOrBefore(visPos);
     1193    return c.honorEditableBoundaryAtOrAfter(visPos);
    11941194}
    11951195
Note: See TracChangeset for help on using the changeset viewer.