https://bugs.webkit.org/show_bug.cgi?id=65377
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 17:23:48 +0000 (17:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 17:23:48 +0000 (17:23 +0000)
commit2926f9e85e16bda73843cf33e50f54345790bad4
tree526f47b9b81ec3303a9e4a78d362a78032cbd65f
parent41c7d55393dcf7938d52f67558e94a60cb750af6
https://bugs.webkit.org/show_bug.cgi?id=65377
Skip the entire node when it is right to do so, instead of stepping
through every character, so we save CPU time on checking every position
unnecessarily.

Patch by Yong Li <yoli@rim.com> on 2012-01-25
Reviewed by Darin Adler.

Source/WebCore:

Test: perf/selection-skip-hidden-node.html

* dom/Position.cpp:
(WebCore::Position::upstream):
(WebCore::Position::downstream):
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::moveToLeafNodeStart):
(WebCore::PositionIterator::moveToLeafNodeEnd):
* dom/PositionIterator.h:
* editing/htmlediting.cpp:
(WebCore::nextCandidate):
(WebCore::nextVisuallyDistinctCandidate):
(WebCore::previousCandidate):
(WebCore::previousVisuallyDistinctCandidate):

LayoutTests:

* perf/selection-skip-hidden-node-expected.txt: Added.
* perf/selection-skip-hidden-node.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/perf/selection-skip-hidden-node-expected.txt [new file with mode: 0644]
LayoutTests/perf/selection-skip-hidden-node.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Position.cpp
Source/WebCore/dom/PositionIterator.cpp
Source/WebCore/dom/PositionIterator.h
Source/WebCore/editing/htmlediting.cpp