Changeset 98428 in webkit


Ignore:
Timestamp:
Oct 25, 2011 9:57:39 PM (13 years ago)
Author:
xji@chromium.org
Message:

--webkit-visual-word does not work in multi-line
https://bugs.webkit.org/show_bug.cgi?id=61344

Reviewed by Ryosuke Niwa.

Source/WebCore:

Get next or previous root inline box (which is not in the same
render object as the current root inline box) by traversing DOM node.

Test: editing/selection/move-by-word-visually-inline-block-positioned-element.html

  • editing/visible_units.cpp:

(WebCore::previousRootInlineBox):
(WebCore::nextRootInlineBox):
(WebCore::leftInlineBox):
(WebCore::rightInlineBox):

LayoutTests:

  • editing/selection/move-by-word-visually-inline-block-positioned-element-expected.txt: Added.
  • editing/selection/move-by-word-visually-inline-block-positioned-element.html: Added.
  • editing/selection/move-by-word-visually-multi-line-expected.txt:
  • editing/selection/move-by-word-visually-single-space-one-element-expected.txt:
  • editing/selection/move-by-word-visually-single-space-one-element.html:
  • platform/gtk/editing/selection/move-by-word-visually-multi-line-expected.txt:
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r98425 r98428  
     12011-10-25  Xiaomei Ji  <xji@chromium.org>
     2
     3        --webkit-visual-word does not work in multi-line
     4        https://bugs.webkit.org/show_bug.cgi?id=61344
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * editing/selection/move-by-word-visually-inline-block-positioned-element-expected.txt: Added.
     9        * editing/selection/move-by-word-visually-inline-block-positioned-element.html: Added.
     10        * editing/selection/move-by-word-visually-multi-line-expected.txt:
     11        * editing/selection/move-by-word-visually-single-space-one-element-expected.txt:
     12        * editing/selection/move-by-word-visually-single-space-one-element.html:
     13        * platform/gtk/editing/selection/move-by-word-visually-multi-line-expected.txt:
     14
    1152011-10-25  Erik Arvidsson  <arv@chromium.org>
    216
  • trunk/LayoutTests/editing/selection/move-by-word-visually-multi-line-expected.txt

    r93935 r98428  
    88Test 2, LTR:
    99Move right by one word
    10 "abc def ghi jkl mn "[0, 4, 8, 12, 16, 18]    FAIL expected: ["abc def ghi jkl mn "[ 0,  4,  8,  12,  16,  18, ]"opq rst uvw xyz"[ 0,  4,  8,  12,  15]
    11 "abc def ghi jkl mn "[18, 18]   FAIL expected "opq rst uvw xyz"[ 0]
    12 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
    13 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
    14 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
     10"abc def ghi jkl mn "[0, 4, 8, 12, 16, 18], "opq rst uvw xyz"[0, 4, 8, 12, 15]
    1511Move left by one word
    16 "opq rst uvw xyz"[15, 12, 8, 4, 0]    FAIL expected: ["opq rst uvw xyz"[ 15,  12,  8,  4,  0, ]"abc def ghi jkl mn "[ 16,  12,  8,  4,  0]
    17 "opq rst uvw xyz"[0, 0]   FAIL expected "abc def ghi jkl mn "[ 16]
    18 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 16]
    19 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 16]
    20 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 16]
     12"opq rst uvw xyz"[15, 12, 8, 4, 0], "abc def ghi jkl mn "[16, 12, 8, 4, 0]
    2113Test 3, LTR:
    2214Move right by one word
     
    2618Test 4, LTR:
    2719Move right by one word
    28 "AAA AAA AAA AAA "[0, 3, 8, 11, 16]    FAIL expected: ["AAA AAA AAA AAA "[ 0,  3,  8,  11,  16, ]"AAA AAA AAA AAA"[ 0,  3,  8,  11,  15]
    29 "AAA AAA AAA AAA "[16, 16]   FAIL expected "AAA AAA AAA AAA"[ 0]
    30 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
    31 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
    32 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
     20"AAA AAA AAA AAA "[0, 3, 8, 11, 16], "AAA AAA AAA AAA"[0, 3, 8, 11, 15]
    3321Move left by one word
    34 "AAA AAA AAA AAA"[15, 11, 8, 3, 0]    FAIL expected: ["AAA AAA AAA AAA"[ 15,  11,  8,  3,  0, ]"AAA AAA AAA AAA "[ 11,  8,  3,  0]
    35 "AAA AAA AAA AAA"[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 11]
    36 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 11]
    37 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 11]
    38 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 11]
     22"AAA AAA AAA AAA"[15, 11, 8, 3, 0], "AAA AAA AAA AAA "[11, 8, 3, 0]
    3923Test 5, LTR:
    4024Move right by one word
     
    4428Test 6, LTR:
    4529Move right by one word
    46 " abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 9, 12, 17, 21, 25, 29, 33, 36]    FAIL expected: [" abc def AAA AAA hij AAA AAA uvw xyz "[ 1,  5,  9,  12,  17,  21,  25,  29,  33,  36, ]"AAA kj AAA mn opq AAA AAA"[ 0,  4,  7,  11,  14,  18,  22,  25]
    47 " abc def AAA AAA hij AAA AAA uvw xyz "[36, 36]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    48 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    49 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    50 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
     30" abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 9, 12, 17, 21, 25, 29, 33, 36], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22, 25]
    5131Move left by one word
    52 "AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0]    FAIL expected: ["AAA kj AAA mn opq AAA AAA"[ 25,  22,  18,  14,  11,  7,  4,  0, ]" abc def AAA AAA hij AAA AAA uvw xyz "[ 33,  29,  25,  21,  17,  12,  9,  5,  1]
    53 "AAA kj AAA mn opq AAA AAA"[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 33]
    54 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 33]
    55 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 33]
    56 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 33]
     32"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[33, 29, 25, 21, 17, 12, 9, 5, 1]
    5733Test 7, RTL:
    5834Move left by one word
     
    6238Test 8, RTL:
    6339Move left by one word
    64 "abc def ghi jkl mn "[0, 3, 8, 11, 16, 18]    FAIL expected: ["abc def ghi jkl mn "[ 0,  3,  8,  11,  16,  18, ]"opq rst uvw xyz"[ 0,  3,  8,  11,  15]
    65 "abc def ghi jkl mn "[18, 18]   FAIL expected "opq rst uvw xyz"[ 0]
    66 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
    67 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
    68 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
     40"abc def ghi jkl mn "[0, 3, 8, 11, 16, 18], "opq rst uvw xyz"[0, 3, 8, 11, 15]
    6941Move right by one word
    70 "opq rst uvw xyz"[15, 11, 8, 3, 0]    FAIL expected: ["opq rst uvw xyz"[ 15,  11,  8,  3,  0, ]"abc def ghi jkl mn "[ 18,  16,  11,  8,  3,  0]
    71 "opq rst uvw xyz"[0, 0]   FAIL expected "abc def ghi jkl mn "[ 18]
    72 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 18]
    73 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 18]
    74 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 18]
     42"opq rst uvw xyz"[15, 11, 8, 3, 0], "abc def ghi jkl mn "[18, 16, 11, 8, 3, 0]
    7543Test 9, RTL:
    7644Move left by one word
     
    8048Test 10, RTL:
    8149Move left by one word
    82 "AAA AAA AAA AAA "[0, 4, 8, 12, 16]    FAIL expected: ["AAA AAA AAA AAA "[ 0,  4,  8,  12,  16, ]"AAA AAA AAA AAA"[ 0,  4,  8,  12,  15]
    83 "AAA AAA AAA AAA "[16, 16]   FAIL expected "AAA AAA AAA AAA"[ 0]
    84 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
    85 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
    86 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
     50"AAA AAA AAA AAA "[0, 4, 8, 12, 16], "AAA AAA AAA AAA"[0, 4, 8, 12, 15]
    8751Move right by one word
    88 "AAA AAA AAA AAA"[15, 12, 8, 4, 0]    FAIL expected: ["AAA AAA AAA AAA"[ 15,  12,  8,  4,  0, ]"AAA AAA AAA AAA "[ 12,  8,  4,  0]
    89 "AAA AAA AAA AAA"[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 12]
    90 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 12]
    91 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 12]
    92 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 12]
     52"AAA AAA AAA AAA"[15, 12, 8, 4, 0], "AAA AAA AAA AAA "[12, 8, 4, 0]
    9353Test 11, RTL:
    9454Move left by one word
     
    9858Test 12, RTL:
    9959Move left by one word
    100 " abc def AAA AAA hij AAA AAA uvw xyz "[1, 4, 9, 13, 17, 21, 25, 29, 33, 36]    FAIL expected: [" abc def AAA AAA hij AAA AAA uvw xyz "[ 1,  4,  9,  13,  17,  21,  25,  29,  33,  36, ]"AAA kj AAA mn opq AAA AAA"[ 0,  4,  7,  11,  14,  18,  22,  25]
    101 " abc def AAA AAA hij AAA AAA uvw xyz "[36, 36]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    102 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    103 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    104 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
     60" abc def AAA AAA hij AAA AAA uvw xyz "[1, 4, 9, 13, 17, 21, 25, 29, 33, 36], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22, 25]
    10561Move right by one word
    106 "AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0]    FAIL expected: ["AAA kj AAA mn opq AAA AAA"[ 25,  22,  18,  14,  11,  7,  4,  0, ]" abc def AAA AAA hij AAA AAA uvw xyz "[ 36,  33,  29,  25,  21,  17,  13,  9,  4,  1]
    107 "AAA kj AAA mn opq AAA AAA"[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 36]
    108 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 36]
    109 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 36]
    110 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 36]
     62"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[36, 33, 29, 25, 21, 17, 13, 9, 4, 1]
    11163Test 13, LTR:
    11264Move right by one word
  • trunk/LayoutTests/editing/selection/move-by-word-visually-single-space-one-element-expected.txt

    r92223 r98428  
    8181Move right by one word
    8282"ZQB abc RIG"[11, 8, 4, 0]
     83Test 17, LTR:
     84Move right by one word
     85<DIV>[0]
     86Move left by one word
     87<DIV>[0]
    8388
  • trunk/LayoutTests/editing/selection/move-by-word-visually-single-space-one-element.html

    r92223 r98428  
    6464<div dir=rtl class="test_move_by_word" title="11 8 4 0|0 4 8 11" contenteditable>שנב abc סטז</div>
    6565
     66<!-- empty div -->
     67<div dir=ltr class="test_move_by_word" title="0|0" contenteditable></div>
     68
    6669</div>
    6770<pre id="console"></pre>
  • trunk/LayoutTests/platform/gtk/editing/selection/move-by-word-visually-multi-line-expected.txt

    r94702 r98428  
    88Test 2, LTR:
    99Move right by one word
    10 "abc def ghi jkl mn "[0, 4, 8, 12, 16, 18]    FAIL expected: ["abc def ghi jkl mn "[ 0,  4,  8,  12,  16,  18, ]"opq rst uvw xyz"[ 0,  4,  8,  12,  15]
    11 "abc def ghi jkl mn "[18, 18]   FAIL expected "opq rst uvw xyz"[ 0]
    12 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
    13 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
    14 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
     10"abc def ghi jkl mn "[0, 4, 8, 12, 16, 18], "opq rst uvw xyz"[0, 4, 8, 12, 15]
    1511Move left by one word
    16 "opq rst uvw xyz"[15, 12, 8, 4, 0]    FAIL expected: ["opq rst uvw xyz"[ 15,  12,  8,  4,  0, ]"abc def ghi jkl mn "[ 16,  12,  8,  4,  0]
    17 "opq rst uvw xyz"[0, 0]   FAIL expected "abc def ghi jkl mn "[ 16]
    18 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 16]
    19 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 16]
    20 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 16]
     12"opq rst uvw xyz"[15, 12, 8, 4, 0], "abc def ghi jkl mn "[16, 12, 8, 4, 0]
    2113Test 3, LTR:
    2214Move right by one word
     
    2618Test 4, LTR:
    2719Move right by one word
    28 "AAA AAA AAA AAA "[0, 3, 8, 11, 16]    FAIL expected: ["AAA AAA AAA AAA "[ 0,  3,  8,  11,  16, ]"AAA AAA AAA AAA"[ 0,  3,  8,  11,  15]
    29 "AAA AAA AAA AAA "[16, 16]   FAIL expected "AAA AAA AAA AAA"[ 0]
    30 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
    31 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
    32 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
     20"AAA AAA AAA AAA "[0, 3, 8, 11, 16], "AAA AAA AAA AAA"[0, 3, 8, 11, 15]
    3321Move left by one word
    34 "AAA AAA AAA AAA"[15, 11, 8, 3, 0]    FAIL expected: ["AAA AAA AAA AAA"[ 15,  11,  8,  3,  0, ]"AAA AAA AAA AAA "[ 11,  8,  3,  0]
    35 "AAA AAA AAA AAA"[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 11]
    36 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 11]
    37 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 11]
    38 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 11]
     22"AAA AAA AAA AAA"[15, 11, 8, 3, 0], "AAA AAA AAA AAA "[11, 8, 3, 0]
    3923Test 5, LTR:
    4024Move right by one word
     
    4428Test 6, LTR:
    4529Move right by one word
    46 " abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 9, 12, 17, 21, 25, 29, 33, 36]    FAIL expected: [" abc def AAA AAA hij AAA AAA uvw xyz "[ 1,  5,  9,  12,  17,  21,  25,  29,  33,  36, ]"AAA kj AAA mn opq AAA AAA"[ 0,  4,  7,  11,  14,  18,  22,  25]
    47 " abc def AAA AAA hij AAA AAA uvw xyz "[36, 36]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    48 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    49 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    50 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
     30" abc def AAA AAA hij AAA AAA uvw xyz "[1, 5, 9, 12, 17, 21, 25, 29, 33, 36], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22, 25]
    5131Move left by one word
    52 "AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0]    FAIL expected: ["AAA kj AAA mn opq AAA AAA"[ 25,  22,  18,  14,  11,  7,  4,  0, ]" abc def AAA AAA hij AAA AAA uvw xyz "[ 33,  29,  25,  21,  17,  12,  9,  5,  1]
    53 "AAA kj AAA mn opq AAA AAA"[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 33]
    54 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 33]
    55 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 33]
    56 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 33]
     32"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[33, 29, 25, 21, 17, 12, 9, 5, 1]
    5733Test 7, RTL:
    5834Move left by one word
     
    6238Test 8, RTL:
    6339Move left by one word
    64 "abc def ghi jkl mn "[0, 3, 8, 11, 16, 18]    FAIL expected: ["abc def ghi jkl mn "[ 0,  3,  8,  11,  16,  18, ]"opq rst uvw xyz"[ 0,  3,  8,  11,  15]
    65 "abc def ghi jkl mn "[18, 18]   FAIL expected "opq rst uvw xyz"[ 0]
    66 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
    67 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
    68 <DIV>[0, 0]   FAIL expected "opq rst uvw xyz"[ 0]
     40"abc def ghi jkl mn "[0, 3, 8, 11, 16, 18], "opq rst uvw xyz"[0, 3, 8, 11, 15]
    6941Move right by one word
    70 "opq rst uvw xyz"[15, 11, 8, 3, 0]    FAIL expected: ["opq rst uvw xyz"[ 15,  11,  8,  3,  0, ]"abc def ghi jkl mn "[ 18,  16,  11,  8,  3,  0]
    71 "opq rst uvw xyz"[0, 0]   FAIL expected "abc def ghi jkl mn "[ 18]
    72 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 18]
    73 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 18]
    74 <DIV>[0, 0]   FAIL expected "abc def ghi jkl mn "[ 18]
     42"opq rst uvw xyz"[15, 11, 8, 3, 0], "abc def ghi jkl mn "[18, 16, 11, 8, 3, 0]
    7543Test 9, RTL:
    7644Move left by one word
     
    8048Test 10, RTL:
    8149Move left by one word
    82 "AAA AAA AAA AAA "[0, 4, 8, 12, 16]    FAIL expected: ["AAA AAA AAA AAA "[ 0,  4,  8,  12,  16, ]"AAA AAA AAA AAA"[ 0,  4,  8,  12,  15]
    83 "AAA AAA AAA AAA "[16, 16]   FAIL expected "AAA AAA AAA AAA"[ 0]
    84 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
    85 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
    86 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA"[ 0]
     50"AAA AAA AAA AAA "[0, 4, 8, 12, 16], "AAA AAA AAA AAA"[0, 4, 8, 12, 15]
    8751Move right by one word
    88 "AAA AAA AAA AAA"[15, 12, 8, 4, 0]    FAIL expected: ["AAA AAA AAA AAA"[ 15,  12,  8,  4,  0, ]"AAA AAA AAA AAA "[ 12,  8,  4,  0]
    89 "AAA AAA AAA AAA"[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 12]
    90 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 12]
    91 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 12]
    92 <DIV>[0, 0]   FAIL expected "AAA AAA AAA AAA "[ 12]
     52"AAA AAA AAA AAA"[15, 12, 8, 4, 0], "AAA AAA AAA AAA "[12, 8, 4, 0]
    9353Test 11, RTL:
    9454Move left by one word
     
    9858Test 12, RTL:
    9959Move left by one word
    100 " abc def AAA AAA hij AAA AAA uvw xyz "[1, 4, 9, 13, 17, 21, 25, 29, 33, 36]    FAIL expected: [" abc def AAA AAA hij AAA AAA uvw xyz "[ 1,  4,  9,  13,  17,  21,  25,  29,  33,  36, ]"AAA kj AAA mn opq AAA AAA"[ 0,  4,  7,  11,  14,  18,  22,  25]
    101 " abc def AAA AAA hij AAA AAA uvw xyz "[36, 36]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    102 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    103 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
    104 <DIV>[0, 0]   FAIL expected "AAA kj AAA mn opq AAA AAA"[ 0]
     60" abc def AAA AAA hij AAA AAA uvw xyz "[1, 4, 9, 13, 17, 21, 25, 29, 33, 36], "AAA kj AAA mn opq AAA AAA"[0, 4, 7, 11, 14, 18, 22, 25]
    10561Move right by one word
    106 "AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0]    FAIL expected: ["AAA kj AAA mn opq AAA AAA"[ 25,  22,  18,  14,  11,  7,  4,  0, ]" abc def AAA AAA hij AAA AAA uvw xyz "[ 36,  33,  29,  25,  21,  17,  13,  9,  4,  1]
    107 "AAA kj AAA mn opq AAA AAA"[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 36]
    108 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 36]
    109 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 36]
    110 <DIV>[0, 0]   FAIL expected " abc def AAA AAA hij AAA AAA uvw xyz "[ 36]
     62"AAA kj AAA mn opq AAA AAA"[25, 22, 18, 14, 11, 7, 4, 0], " abc def AAA AAA hij AAA AAA uvw xyz "[36, 33, 29, 25, 21, 17, 13, 9, 4, 1]
    11163Test 13, LTR:
    11264Move right by one word
  • trunk/Source/WebCore/ChangeLog

    r98427 r98428  
     12011-10-25  Xiaomei Ji  <xji@chromium.org>
     2
     3        --webkit-visual-word does not work in multi-line
     4        https://bugs.webkit.org/show_bug.cgi?id=61344
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Get next or previous root inline box (which is not in the same
     9        render object as the current root inline box) by traversing DOM node.
     10
     11        Test: editing/selection/move-by-word-visually-inline-block-positioned-element.html
     12
     13        * editing/visible_units.cpp:
     14        (WebCore::previousRootInlineBox):
     15        (WebCore::nextRootInlineBox):
     16        (WebCore::leftInlineBox):
     17        (WebCore::rightInlineBox):
     18
    1192011-10-25  Adam Barth  <abarth@webkit.org>
    220
  • trunk/Source/WebCore/editing/visible_units.cpp

    r98408 r98428  
    14271427}
    14281428
     1429static const RootInlineBox* previousRootInlineBox(const InlineBox* box)
     1430{
     1431    Node* node = box->renderer()->node();
     1432    Node* enclosingBlockNode = enclosingNodeWithNonInlineRenderer(node);
     1433    Node* previousNode = node->previousLeafNode();
     1434    while (previousNode && enclosingBlockNode == enclosingNodeWithNonInlineRenderer(previousNode))
     1435        previousNode = previousNode->previousLeafNode();
     1436 
     1437    while (previousNode) {
     1438        Position pos = createLegacyEditingPosition(previousNode, caretMaxOffset(previousNode));
     1439       
     1440        if (pos.isCandidate()) {
     1441            RenderedPosition renderedPos(pos, DOWNSTREAM);
     1442            RootInlineBox* root = renderedPos.rootBox();
     1443            if (root)
     1444                return root;
     1445        }
     1446
     1447        previousNode = previousNode->previousLeafNode();
     1448    }
     1449    return 0;
     1450}
     1451
     1452static const RootInlineBox* nextRootInlineBox(const InlineBox* box)
     1453{
     1454    Node* node = box->renderer()->node();
     1455    Node* enclosingBlockNode = enclosingNodeWithNonInlineRenderer(node);
     1456    Node* nextNode = node->nextLeafNode();
     1457    while (nextNode && enclosingBlockNode == enclosingNodeWithNonInlineRenderer(nextNode))
     1458        nextNode = nextNode->nextLeafNode();
     1459 
     1460    while (nextNode) {
     1461        Position pos;
     1462        pos = createLegacyEditingPosition(nextNode, caretMinOffset(nextNode));
     1463       
     1464        if (pos.isCandidate()) {
     1465            RenderedPosition renderedPos(pos, DOWNSTREAM);
     1466            RootInlineBox* root = renderedPos.rootBox();
     1467            if (root)
     1468                return root;
     1469        }
     1470
     1471        nextNode = nextNode->nextLeafNode();
     1472    }
     1473    return 0;
     1474}
     1475
    14291476static const InlineBox* leftInlineBox(const InlineBox* box, TextDirection blockDirection)
    14301477{
     
    14381485        return leftLineBox->lastLeafChild();
    14391486
    1440     return 0;
     1487    const RootInlineBox* leftRootInlineBox = isBlockLTR ? previousRootInlineBox(box) :
     1488        nextRootInlineBox(box);
     1489    return leftRootInlineBox ? leftRootInlineBox->lastLeafChild() : 0;
    14411490}
    14421491
     
    14521501        return rightLineBox->firstLeafChild();
    14531502
    1454     return 0;
     1503    const RootInlineBox* rightRootInlineBox = isBlockLTR ? nextRootInlineBox(box) :
     1504        previousRootInlineBox(box);
     1505    return rightRootInlineBox ? rightRootInlineBox->firstLeafChild() : 0;
    14551506}
    14561507
Note: See TracChangeset for help on using the changeset viewer.