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

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

Issue 24278008: [oilpan] Handlify Nodes in htmlediting (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years, 3 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
Index: Source/core/editing/BreakBlockquoteCommand.cpp
diff --git a/Source/core/editing/BreakBlockquoteCommand.cpp b/Source/core/editing/BreakBlockquoteCommand.cpp
index c2f9ee54218eb57b22552778a079eb958762ac4b..eacdd406719dca0f7f05799bf69a2a9a5ffa19e5 100644
--- a/Source/core/editing/BreakBlockquoteCommand.cpp
+++ b/Source/core/editing/BreakBlockquoteCommand.cpp
@@ -67,7 +67,7 @@ void BreakBlockquoteCommand::doApply()
Position pos = endingSelection().start().downstream();
// Find the top-most blockquote from the start.
- Handle<Node> topBlockquote = adoptRawResult(highestEnclosingNodeOfType(pos, isMailBlockquote));
+ Handle<Node> topBlockquote = highestEnclosingNodeOfType(pos, isMailBlockquote);
if (!topBlockquote || !topBlockquote->parentNode() || !topBlockquote->isElementNode())
return;
@@ -100,8 +100,12 @@ void BreakBlockquoteCommand::doApply()
pos = pos.next();
// Adjust the position so we don't split at the beginning of a quote.
- while (isFirstVisiblePositionInNode(VisiblePosition(pos), enclosingNodeOfType(pos, isMailBlockquote)))
+ while (true) {
+ HandleScope scope;
+ if (!isFirstVisiblePositionInNode(VisiblePosition(pos), enclosingNodeOfType(pos, isMailBlockquote).handle().raw()))
+ break;
pos = pos.previous();
+ }
// startNode is the first node that we need to move to the new blockquote.
Handle<Node> startNode = pos.deprecatedNode();
@@ -122,7 +126,7 @@ void BreakBlockquoteCommand::doApply()
// If there's nothing inside topBlockquote to move, we're finished.
if (!startNode->isDescendantOf(topBlockquote.raw())) {
- setEndingSelection(VisibleSelection(VisiblePosition(firstPositionInOrBeforeNode(startNode.raw())), endingSelection().isDirectional()));
+ setEndingSelection(VisibleSelection(VisiblePosition(firstPositionInOrBeforeNode(startNode)), endingSelection().isDirectional()));
return;
}

Powered by Google App Engine
This is Rietveld 408576698