Ensure that TextIterator::m_pastEndNode is not skipped in advance()
In the current implemetation of |TextIterator::advance()|, when facing a
node that is neither a shadow root nor a laid-out node, the node and its
entire subtree are directly skipped, which is incorrect if the ending
position is in the subtree.
This CL fixes the issue by setting |m_pastEndNode| as the first non-skippable
node after the ending position. It also ensures that |m_pastEndNode| is
only used for checking loop ending condition, and replaces the other usage
with an equivalent implementation.
BUG=630921
TEST=webkit_unit_tests --gtest_filter=TextIteratorTest.EndingConditionWithDisplayNone*
Review-Url: https://codereview.chromium.org/2131103002
Cr-Commit-Position: refs/heads/master@{#408071}
3 files changed