Changeset 136225 in webkit


Ignore:
Timestamp:
Nov 30, 2012 4:32:15 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Caret is painted horizontally in vertical writing mode when there are no visible text
https://bugs.webkit.org/show_bug.cgi?id=102359

Patch by Arpita Bahuguna <arpitabahuguna@gmail.com> on 2012-11-30
Reviewed by Ryosuke Niwa.

Source/WebCore:

In the vertical writing mode the caret rect on an empty editable box or
an empty line is rendered as per the horizontal writing mode.

This changes though when any text is added; the caret is then displayed
in accordance with the vertical writing mode.

Test: editing/selection/caret-alignment-for-vertical-text.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::localCaretRect):

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::localCaretRectForEmptyElement):
The caret rect should be transposed for the vertical writing mode. Its
width and height values need to be interchanged for it to be oriented
as per the vertical text.

LayoutTests:

  • editing/selection/caret-alignment-for-vertical-text-expected.txt: Added.
  • editing/selection/caret-alignment-for-vertical-text.html: Added.

Test to verify that the orientation of the caret on an empty vertical text
line or container is same as that for a non-empty container.

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r136223 r136225  
     12012-11-30  Arpita Bahuguna  <arpitabahuguna@gmail.com>
     2
     3        Caret is painted horizontally in vertical writing mode when there are no visible text
     4        https://bugs.webkit.org/show_bug.cgi?id=102359
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * editing/selection/caret-alignment-for-vertical-text-expected.txt: Added.
     9        * editing/selection/caret-alignment-for-vertical-text.html: Added.
     10        Test to verify that the orientation of the caret on an empty vertical text
     11        line or container is same as that for a non-empty container.
     12
    1132012-11-30  Nandor Huszka  <hnandor@inf.u-szeged.hu>
    214
  • trunk/Source/WebCore/ChangeLog

    r136220 r136225  
     12012-11-30  Arpita Bahuguna  <arpitabahuguna@gmail.com>
     2
     3        Caret is painted horizontally in vertical writing mode when there are no visible text
     4        https://bugs.webkit.org/show_bug.cgi?id=102359
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        In the vertical writing mode the caret rect on an empty editable box or
     9        an empty line is rendered as per the horizontal writing mode.
     10
     11        This changes though when any text is added; the caret is then displayed
     12        in accordance with the vertical writing mode.
     13
     14        Test: editing/selection/caret-alignment-for-vertical-text.html
     15
     16        * rendering/RenderBox.cpp:
     17        (WebCore::RenderBox::localCaretRect):
     18        * rendering/RenderBoxModelObject.cpp:
     19        (WebCore::RenderBoxModelObject::localCaretRectForEmptyElement):
     20        The caret rect should be transposed for the vertical writing mode. Its
     21        width and height values need to be interchanged for it to be oriented
     22        as per the vertical text.
     23
    1242012-11-30  Sankeerth V S  <sankeerth.vs@samsung.com>
    225
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r135965 r136225  
    36253625    // Move to local coords
    36263626    rect.moveBy(-location());
     3627
     3628    if (!isHorizontalWritingMode())
     3629        return rect.transposedRect();
     3630
    36273631    return rect;
    36283632}
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r135629 r136225  
    27592759    LayoutUnit y = paddingTop() + borderTop();
    27602760
    2761     return LayoutRect(x, y, caretWidth, height);
     2761    return currentStyle->isHorizontalWritingMode() ? LayoutRect(x, y, caretWidth, height) : LayoutRect(y, x, height, caretWidth);
    27622762}
    27632763
Note: See TracChangeset for help on using the changeset viewer.