Skip to content
  • ddkilzer@apple.com's avatar
    <http://webkit.org/b/52512> REGRESSION(r73818): range.cloneContents() ignores end offset · d673f252
    ddkilzer@apple.com authored
    Reviewed by Adele Peterson.
    
    WebCore:
    
    The fix for Bug 50710 in r73799 introduced an off-by-one error
    when copying nodes to a local NodeVector for processing.  A fix
    was attempted for Bug 50854 in r73818, but instead of stopping
    at the end offset, it iterates through all the sibling nodes
    because the loop variable (i) is never incremented.  To clean
    this up, revert back to the code in r73799 and fix the
    off-by-one error.
    
    Test: fast/dom/Range/range-clone-contents.html
    
    * dom/Range.cpp:
    (WebCore::Range::processContents): Fix the loop that copies
    nodes to a local NodeVector by restoring the code from r73799
    and fixing the off-by-one error.
    
    LayoutTests:
    
    * fast/dom/Range/range-clone-contents-expected.txt: Added.
    * fast/dom/Range/range-clone-contents.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75882 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d673f252