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