Changeset 137213 in webkit


Ignore:
Timestamp:
Dec 10, 2012, 3:30:36 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Keyboard caret movement in textarea with RTL Override Character can make tab unresponsive
https://bugs.webkit.org/show_bug.cgi?id=103067

Patch by Yi Shen <max.hong.shen@gmail.com> on 2012-12-10
Reviewed by Ryosuke Niwa.

Source/WebCore:

For textarea with RTL override character, the line break could be the previous leaf InlineTextBox of
the InlineTextBox for the RTL override text. When overshots the left/right, make sure the
leftVisuallyDistinctCandidate and rightVisuallyDistinctCandidate return the visually distinct
left/right position by ignoring the line break.

Test: editing/selection/move-by-character-crash-test-textarea.html

  • editing/VisiblePosition.cpp:

(WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
(WebCore::VisiblePosition::rightVisuallyDistinctCandidate):

LayoutTests:

New test for moving caret in textarea with RTL override character causes crash.

  • editing/selection/move-by-character-crash-test-textarea-expected.txt: Added.
  • editing/selection/move-by-character-crash-test-textarea.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r137208 r137213  
     12012-12-10  Yi Shen  <max.hong.shen@gmail.com>
     2
     3        Keyboard caret movement in textarea with RTL Override Character can make tab unresponsive
     4        https://bugs.webkit.org/show_bug.cgi?id=103067
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        New test for moving caret in textarea with RTL override character causes crash.
     9
     10        * editing/selection/move-by-character-crash-test-textarea-expected.txt: Added.
     11        * editing/selection/move-by-character-crash-test-textarea.html: Added.
     12
    1132012-12-10  Dirk Pranke  <dpranke@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r137211 r137213  
     12012-12-10  Yi Shen  <max.hong.shen@gmail.com>
     2
     3        Keyboard caret movement in textarea with RTL Override Character can make tab unresponsive
     4        https://bugs.webkit.org/show_bug.cgi?id=103067
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        For textarea with RTL override character, the line break could be the previous leaf InlineTextBox of
     9        the InlineTextBox for the RTL override text. When overshots the left/right, make sure the
     10        leftVisuallyDistinctCandidate and rightVisuallyDistinctCandidate return the visually distinct
     11        left/right position by ignoring the line break.
     12
     13        Test: editing/selection/move-by-character-crash-test-textarea.html
     14
     15        * editing/VisiblePosition.cpp:
     16        (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
     17        (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
     18
    1192012-12-10  Kondapally Kalyan  <kalyan.kondapally@intel.com>
    220
  • trunk/Source/WebCore/editing/VisiblePosition.cpp

    r131111 r137213  
    146146            if (box->isLeftToRightDirection() ? offset < caretMinOffset : offset > caretMaxOffset) {
    147147                // Overshot to the left.
    148                 InlineBox* prevBox = box->prevLeafChild();
     148                InlineBox* prevBox = box->prevLeafChildIgnoringLineBreak();
    149149                if (!prevBox) {
    150150                    Position positionOnLeft = primaryDirection == LTR ? previousVisuallyDistinctCandidate(m_deepPosition) : nextVisuallyDistinctCandidate(m_deepPosition);
     
    311311            if (box->isLeftToRightDirection() ? offset > caretMaxOffset : offset < caretMinOffset) {
    312312                // Overshot to the right.
    313                 InlineBox* nextBox = box->nextLeafChild();
     313                InlineBox* nextBox = box->nextLeafChildIgnoringLineBreak();
    314314                if (!nextBox) {
    315315                    Position positionOnRight = primaryDirection == LTR ? nextVisuallyDistinctCandidate(m_deepPosition) : previousVisuallyDistinctCandidate(m_deepPosition);
Note: See TracChangeset for help on using the changeset viewer.