Skip to content
  • commit-queue@webkit.org's avatar
    <https://webkit.org/b/119882> Speed up moving cursor/selection up or down past... · a7116879
    commit-queue@webkit.org authored
    <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: http://svn.webkit.org/repository/webkit/trunk@154274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    a7116879