Caret positioned at the end of a text line (followed by an empty block) in vertical...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2013 05:59:02 +0000 (05:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2013 05:59:02 +0000 (05:59 +0000)
commit7308529378a84327b175733f51a0546ed998593f
tree14902083a084a8bae22c25f3b7e34af6f19b499d
parentfe428e4b9ae20dde938b3f7f6f51322e4c8bfdbc
Caret positioned at the end of a text line (followed by an empty block) in vertical writing mode disappears when pressing the right/down arrow key.
https://bugs.webkit.org/show_bug.cgi?id=106452

Patch by Arpita Bahuguna <arpitabahuguna@gmail.com> on 2013-02-14
Reviewed by Ryosuke Niwa.

Source/WebCore:

Pressing the down or the right arrow key at the end of a text line in
vertical writing mode would make the caret dissapear. This occurs only
when the text line is followed by an empty block.

When trying to compute the next position for placing the caret (for
down/right key), we try to ascertain whether the renderer (in this
case the empty block) is a valid candidate or not. For blockFlow
elements we check against their height.
In vertical writing mode though we would fail such a check since we
should instead be comparing against the renderer's width and not
it's height. Thus, a valid position for the placement of the caret
was not found in such a case.

Test: editing/selection/caret-at-end-of-text-line-followed-by-empty-block-in-vertical-mode.html

* dom/Position.cpp:
(WebCore::Position::isCandidate):
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::isCandidate):
Instead of checking against the height(), check against the
logicalHeight() of the renderer has been added. logicalHeight()
on blockFlow renderer's returns a value in accordance with
the writing mode.

LayoutTests:

* editing/selection/caret-at-end-of-text-line-followed-by-empty-block-in-vertical-mode-expected.txt: Added.
* editing/selection/caret-at-end-of-text-line-followed-by-empty-block-in-vertical-mode.html: Added.
Layout test case added for verifying that pressing the down or the right arrow
key at the end of the text line in vertical writing mode will not make the caret
dissapear.
Caret positions at the start, the end, and after pressing the right and the down
arrow keys at the end of the text line, are compared for verification.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/selection/caret-at-end-of-text-line-followed-by-empty-block-in-vertical-mode-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/caret-at-end-of-text-line-followed-by-empty-block-in-vertical-mode.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Position.cpp
Source/WebCore/dom/PositionIterator.cpp