<https://webkit.org/b/119882> Speed up moving cursor/selection up or down past non...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Aug 2013 11:12:41 +0000 (11:12 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Aug 2013 11:12:41 +0000 (11:12 +0000)
commit60070646f472dccbdaace9adb7e74f279ede35ab
treecef658259c588af9a2e996e82bcaa7a85fbd6630
parentfbb8f1686abac83f65f60223a5e2746186dcf6b7
<https://webkit.org/b/119882> Speed up moving cursor/selection up or down past non-rendered elements.

Patch by Mario Sanchez Prada <mario.prada@samsung.com> on 2013-08-19
Reviewed by Darin Adler.

This is a port from Blink originally written by Dominic Mazzoni:
https://src.chromium.org/viewvc/blink?revision=154977&view=revision

Source/WebCore:

From the original commit:

Skips calling firstPositionInOrBeforeNode when a node doesn't have a
renderer, since there couldn't possibly be a visible position there.
This was particularly wasteful when trying to move the cursor up when at
the beginning of a document, as it did a O(n^2) scan through the document head.

Test: editing/execCommand/move-up-down-should-skip-hidden-elements.html

* editing/VisibleUnits.cpp:
(WebCore::previousRootInlineBoxCandidatePosition): Updated.
(WebCore::nextRootInlineBoxCandidatePosition): Updates.

LayoutTests:

* editing/execCommand/move-up-down-should-skip-hidden-elements-expected.txt: Added.
* editing/execCommand/move-up-down-should-skip-hidden-elements.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/move-up-down-should-skip-hidden-elements-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/move-up-down-should-skip-hidden-elements.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/VisibleUnits.cpp