<http://webkit.org/b/52512> REGRESSION(r73818): range.cloneContents() ignores end...
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jan 2011 20:44:35 +0000 (20:44 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jan 2011 20:44:35 +0000 (20:44 +0000)
commita54e2e108958fe573a3b02085163ce0a1d293df5
treefbb832158c328f255b42bafa5e6957ff93407245
parent4e58fa1866c4fe6f2bd8a4760448cc11f53e11f1
<webkit.org/b/52512> REGRESSION(r73818): range.cloneContents() ignores end offset

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: https://svn.webkit.org/repository/webkit/trunk@75882 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/Range/range-clone-contents-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Range/range-clone-contents.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Range.cpp