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

Unified Diff: Source/core/editing/TypingCommand.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/TypingCommand.cpp
diff --git a/Source/core/editing/TypingCommand.cpp b/Source/core/editing/TypingCommand.cpp
index 741019b4975a4bc51c64e63f16bf29ae2279900a..09f85a4031b5bebf0b6d47a4fcf14c57cfa0ec66 100644
--- a/Source/core/editing/TypingCommand.cpp
+++ b/Source/core/editing/TypingCommand.cpp
@@ -454,8 +454,8 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
VisiblePosition visibleStart(endingSelection().visibleStart());
// If we have a caret selection at the beginning of a cell, we have nothing to do.
- Node* enclosingTableCell = enclosingNodeOfType(visibleStart.deepEquivalent(), &isTableCell);
- if (enclosingTableCell && visibleStart == firstPositionInNode(adoptRawResult(enclosingTableCell)))
+ Handle<Node> enclosingTableCell = enclosingNodeOfType(visibleStart.deepEquivalent(), &isTableCell);
+ if (enclosingTableCell && visibleStart == firstPositionInNode(enclosingTableCell))
return;
// If the caret is at the start of a paragraph after a table, move content into the last table cell.
@@ -466,8 +466,8 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
// Extend the selection backward into the last cell, then deletion will handle the move.
selection.modify(FrameSelection::AlterationExtend, DirectionBackward, granularity);
// If the caret is just after a table, select the table and don't delete anything.
- } else if (Node* table = isFirstPositionAfterTable(visibleStart)) {
- setEndingSelection(VisibleSelection(positionBeforeNode(adoptRawResult(table)), endingSelection().start(), DOWNSTREAM, endingSelection().isDirectional()));
+ } else if (Handle<Node> table = isFirstPositionAfterTable(visibleStart)) {
+ setEndingSelection(VisibleSelection(positionBeforeNode(table), endingSelection().start(), DOWNSTREAM, endingSelection().isDirectional()));
typingAddedToOpenCommand(DeleteKey);
return;
}
@@ -543,14 +543,14 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity, bool ki
Position downstreamEnd = endingSelection().end().downstream();
VisiblePosition visibleEnd = endingSelection().visibleEnd();
- Node* enclosingTableCell = enclosingNodeOfType(visibleEnd.deepEquivalent(), &isTableCell);
- if (enclosingTableCell && visibleEnd == lastPositionInNode(adoptRawResult(enclosingTableCell)))
+ Handle<Node> enclosingTableCell = enclosingNodeOfType(visibleEnd.deepEquivalent(), &isTableCell);
+ if (enclosingTableCell && visibleEnd == lastPositionInNode(enclosingTableCell))
return;
if (visibleEnd == endOfParagraph(visibleEnd))
downstreamEnd = visibleEnd.next(CannotCrossEditingBoundary).deepEquivalent().downstream();
// When deleting tables: Select the table first, then perform the deletion
if (downstreamEnd.containerNode() && downstreamEnd.containerNode()->renderer() && downstreamEnd.containerNode()->renderer()->isTable()
- && downstreamEnd.computeOffsetInContainerNode() <= caretMinOffset(downstreamEnd.containerNode().handle().raw())) {
+ && downstreamEnd.computeOffsetInContainerNode() <= caretMinOffset(downstreamEnd.containerNode())) {
setEndingSelection(VisibleSelection(endingSelection().end(), positionAfterNode(downstreamEnd.containerNode()), DOWNSTREAM, endingSelection().isDirectional()));
typingAddedToOpenCommand(ForwardDeleteKey);
return;

Powered by Google App Engine
This is Rietveld 408576698