Changeset 109984 in webkit


Ignore:
Timestamp:
Mar 6, 2012 5:13:54 PM (12 years ago)
Author:
rniwa@webkit.org
Message:

Can't select a line of RTL text on Facebook
https://bugs.webkit.org/show_bug.cgi?id=59435

Reviewed by Eric Seidel.

Source/WebCore:

Deploy prevLeafChildIgnoringLineBreak and nextLeafChildIgnoringLineBreak
in RenderedPosition::leftBoundaryOfBidiRun and RenderedPosition::rightBoundaryOfBidiRun.

Without this patch, WebKit extends selection from right to left when the user selects
<span dir="rtl">ABC<br></span> from left to right by a mouse drag.

Test: editing/selection/select-bidi-run.html

  • editing/RenderedPosition.cpp:

(WebCore::RenderedPosition::leftBoundaryOfBidiRun):
(WebCore::RenderedPosition::rightBoundaryOfBidiRun):

LayoutTests:

Added a regression test case.

  • editing/selection/select-bidi-run-expected.txt:
  • editing/selection/select-bidi-run.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r109981 r109984  
     12012-03-06  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Can't select a line of RTL text on Facebook
     4        https://bugs.webkit.org/show_bug.cgi?id=59435
     5
     6        Reviewed by Eric Seidel.
     7
     8        Added a regression test case.
     9
     10        * editing/selection/select-bidi-run-expected.txt:
     11        * editing/selection/select-bidi-run.html:
     12
    1132012-03-06  Adrienne Walker  <enne@google.com>
    214
  • trunk/LayoutTests/editing/selection/select-bidi-run-expected.txt

    r101561 r109984  
    123123PASS selected "ABC"
    124124
     125Test "ABC" in "ABC":
     126Selecting from left to right
     127PASS selected "C"
     128PASS selected "BC"
     129PASS selected "ABC"
     130Selecting from right to left
     131PASS selected "A"
     132PASS selected "AB"
     133PASS selected "ABC"
     134
    125135PASS successfullyParsed is true
    126136
  • trunk/LayoutTests/editing/selection/select-bidi-run.html

    r101561 r109984  
    4747
    4848<dt contenteditable style="position: relative;">aאבגb<div class="targetContainer">a<span class="target">אבג</span>b</div></dt>
     49<dd>C,BC,ABC|A,AB,ABC</dd>
     50
     51<dt contenteditable dir="ltr"><span class="target" dir="rtl">אבג<br></span></dt>
    4952<dd>C,BC,ABC|A,AB,ABC</dd>
    5053
  • trunk/Source/WebCore/ChangeLog

    r109983 r109984  
     12012-03-06  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Can't select a line of RTL text on Facebook
     4        https://bugs.webkit.org/show_bug.cgi?id=59435
     5
     6        Reviewed by Eric Seidel.
     7
     8        Deploy prevLeafChildIgnoringLineBreak and nextLeafChildIgnoringLineBreak
     9        in RenderedPosition::leftBoundaryOfBidiRun and RenderedPosition::rightBoundaryOfBidiRun.
     10
     11        Without this patch, WebKit extends selection from right to left when the user selects
     12        <span dir="rtl">ABC<br></span> from left to right by a mouse drag.
     13
     14        Test: editing/selection/select-bidi-run.html
     15
     16        * editing/RenderedPosition.cpp:
     17        (WebCore::RenderedPosition::leftBoundaryOfBidiRun):
     18        (WebCore::RenderedPosition::rightBoundaryOfBidiRun):
     19
    1202012-03-06  Raphael Kubo da Costa  <kubo@profusion.mobi>
    221
  • trunk/Source/WebCore/editing/RenderedPosition.cpp

    r109593 r109984  
    138138    InlineBox* box = m_inlineBox;
    139139    do {
    140         InlineBox* prev = box->prevLeafChild();
     140        InlineBox* prev = box->prevLeafChildIgnoringLineBreak();
    141141        if (!prev || prev->bidiLevel() < bidiLevelOfRun)
    142142            return RenderedPosition(box->renderer(), box, box->caretLeftmostOffset());
     
    155155    InlineBox* box = m_inlineBox;
    156156    do {
    157         InlineBox* next = box->nextLeafChild();
     157        InlineBox* next = box->nextLeafChildIgnoringLineBreak();
    158158        if (!next || next->bidiLevel() < bidiLevelOfRun)
    159159            return RenderedPosition(box->renderer(), box, box->caretRightmostOffset());
Note: See TracChangeset for help on using the changeset viewer.