Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(702)

Unified Diff: WebCore/dom/Range.cpp

Issue 6217002: Merge 73818 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/dom/Range.cpp
===================================================================
--- WebCore/dom/Range.cpp (revision 75433)
+++ WebCore/dom/Range.cpp (working copy)
@@ -794,11 +794,15 @@
Node* n = m_end.container()->firstChild();
if (n && m_end.offset()) {
NodeVector nodes;
- for (int i = 0; i + 1 < m_end.offset() && n; i++, n = n->nextSibling()) {
+ int i = 0;
+ do {
nodes.append(n);
- }
+ if (!n->nextSibling())
+ break;
+ n = n->nextSibling();
+ } while (i + 1 < m_end.offset());
for (int i = nodes.size() - 1; i >= 0; i--) {
- Node* n = nodes[i].get();
+ n = nodes[i].get();
if (action == EXTRACT_CONTENTS)
rightContents->insertBefore(n, rightContents->firstChild(), ec); // will remove n from its parent
else if (action == CLONE_CONTENTS)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698