Eliminate the use of lastChild in TextIterator
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2016 09:11:32 +0000 (09:11 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Dec 2016 09:11:32 +0000 (09:11 +0000)
commite15b8f4e12c7158dc914156f75dd4e12dfbfe037
tree48a5cdf583cc7c048e35d0c3670e83f58e07c604
parentfa7a9fb03d06d01e60bb7ee915fe4af396360e9c
Eliminate the use of lastChild in TextIterator
https://bugs.webkit.org/show_bug.cgi?id=166456

Reviewed by Antti Koivisto.

Just use the node we just existed in TextIterator::exitNode and in emitting additional new line
to eliminate the use of Node::lastChild.

Also initialize member variables in the declaration instead of the constructor to modernize the code.

* editing/TextIterator.cpp:
(WebCore::TextIterator::TextIterator):
(WebCore::TextIterator::advance):
(WebCore::TextIterator::exitNode):
* editing/TextIterator.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/editing/TextIterator.h