Simple line layout: Wrong text offsetting when range does not start from the first...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 20:19:13 +0000 (20:19 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 20:19:13 +0000 (20:19 +0000)
commit93cc8124a9ef3d651e75ba8840f36b230847eb78
tree1c7d0669d08cb8798f0ef8f9705c60edc53ec913
parent24d0355bcb259ec864ee7c3252fd0f08a5f1c151
Simple line layout: Wrong text offsetting when range does not start from the first renderer.
https://bugs.webkit.org/show_bug.cgi?id=144167
rdar://problem/20639857

Reviewed by Simon Fraser.

This patch ensures that TextIterator returns the right text when the input range starts
from a sibling node.

TextIterator::m_previousTextLengthInFlow keeps track of the current node offset from the parent.
Source/WebCore:

It is required to map simple line layout runs to RenderText positions.
This patch sets the offset value when the iteration start with a sibling node.

Test: fast/text/range-text-with-simple-line-layout.html

* editing/TextIterator.cpp:
(WebCore::TextIterator::TextIterator):
(WebCore::TextIterator::handleTextNode):

LayoutTests:

it is required to map simple line layout runs to RenderText positions.
This patch sets the offset value when the iteration start with a sibling node.

* fast/text/range-text-with-simple-line-layout-expected.txt: Added.
* fast/text/range-text-with-simple-line-layout.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183413 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/range-text-with-simple-line-layout-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/range-text-with-simple-line-layout.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/TextIterator.cpp