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

Unified Diff: Source/core/editing/DeleteSelectionCommand.cpp

Issue 54803003: Have Node::lastDescendant() return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Kill firstDescendant()! Created 7 years, 2 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 | « Source/core/dom/Node.cpp ('k') | Source/core/editing/ReplaceSelectionCommand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/DeleteSelectionCommand.cpp
diff --git a/Source/core/editing/DeleteSelectionCommand.cpp b/Source/core/editing/DeleteSelectionCommand.cpp
index 4ccf5258bd338597bb0009c2a81c1623d0e81319..8b07307c10abd6d0920576f69f7decfa298d2dc1 100644
--- a/Source/core/editing/DeleteSelectionCommand.cpp
+++ b/Source/core/editing/DeleteSelectionCommand.cpp
@@ -523,8 +523,8 @@ void DeleteSelectionCommand::handleGeneralDelete()
removeNode(node.get());
node = nextNode.get();
} else {
- Node* n = node->lastDescendant();
- if (m_downstreamEnd.deprecatedNode() == n && m_downstreamEnd.deprecatedEditingOffset() >= caretMaxOffset(n)) {
+ Node& n = node->lastDescendant();
+ if (m_downstreamEnd.deprecatedNode() == n && m_downstreamEnd.deprecatedEditingOffset() >= caretMaxOffset(&n)) {
removeNode(node.get());
node = 0;
} else
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/editing/ReplaceSelectionCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698