| Index: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
|
| index a173feeba206e01c70fcc6b1ef75249bd08e49a9..1db70e161361e7d297db5d6d78793166677c61f1 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
|
| @@ -73,7 +73,7 @@ void TypingCommand::deleteSelection(Document& document, Options options)
|
| if (!frame->selection().isRange())
|
| return;
|
|
|
| - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) {
|
| + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) {
|
| updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand.get(), frame);
|
|
|
| lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking);
|
| @@ -90,7 +90,7 @@ void TypingCommand::deleteKeyPressed(Document& document, Options options, TextGr
|
| {
|
| if (granularity == CharacterGranularity) {
|
| LocalFrame* frame = document.frame();
|
| - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) {
|
| + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) {
|
| // If the last typing command is not Delete, open a new typing command.
|
| // We need to group continuous delete commands alone in a single typing command.
|
| if (lastTypingCommand->commandTypeOfOpenCommand() == DeleteKey) {
|
| @@ -111,7 +111,7 @@ void TypingCommand::forwardDeleteKeyPressed(Document& document, EditingState* ed
|
| // FIXME: Forward delete in TextEdit appears to open and close a new typing command.
|
| if (granularity == CharacterGranularity) {
|
| LocalFrame* frame = document.frame();
|
| - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) {
|
| + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) {
|
| updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand.get(), frame);
|
| lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking);
|
| lastTypingCommand->forwardDeleteKeyPressed(granularity, options & KillRing, editingState);
|
| @@ -142,7 +142,7 @@ static String dispatchBeforeTextInsertedEvent(const String& text, const VisibleS
|
| if (Node* startNode = selectionForInsertion.start().computeContainerNode()) {
|
| if (startNode->rootEditableElement()) {
|
| // Send BeforeTextInsertedEvent. The event handler will update text if necessary.
|
| - RefPtrWillBeRawPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text);
|
| + RawPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text);
|
| startNode->rootEditableElement()->dispatchEvent(evt);
|
| newText = evt->text();
|
| }
|
| @@ -164,7 +164,7 @@ void TypingCommand::insertText(Document& document, const String& text, Options o
|
| // FIXME: We shouldn't need to take selectionForInsertion. It should be identical to FrameSelection's current selection.
|
| void TypingCommand::insertText(Document& document, const String& text, const VisibleSelection& selectionForInsertion, Options options, TextCompositionType compositionType)
|
| {
|
| - RefPtrWillBeRawPtr<LocalFrame> frame = document.frame();
|
| + RawPtr<LocalFrame> frame = document.frame();
|
| ASSERT(frame);
|
|
|
| VisibleSelection currentSelection = frame->selection().selection();
|
| @@ -174,7 +174,7 @@ void TypingCommand::insertText(Document& document, const String& text, const Vis
|
| // Set the starting and ending selection appropriately if we are using a selection
|
| // that is different from the current selection. In the future, we should change EditCommand
|
| // to deal with custom selections in a general way that can be used by all of the commands.
|
| - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame.get())) {
|
| + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame.get())) {
|
| if (!equalSelectionsInDOMTree(lastTypingCommand->endingSelection(), selectionForInsertion)) {
|
| lastTypingCommand->setStartingSelection(selectionForInsertion);
|
| lastTypingCommand->setEndingSelection(selectionForInsertion);
|
| @@ -189,7 +189,7 @@ void TypingCommand::insertText(Document& document, const String& text, const Vis
|
| return;
|
| }
|
|
|
| - RefPtrWillBeRawPtr<TypingCommand> command = TypingCommand::create(document, InsertText, newText, options, compositionType);
|
| + RawPtr<TypingCommand> command = TypingCommand::create(document, InsertText, newText, options, compositionType);
|
| bool changeSelection = !equalSelectionsInDOMTree(selectionForInsertion, currentSelection);
|
| if (changeSelection) {
|
| command->setStartingSelection(selectionForInsertion);
|
| @@ -204,7 +204,7 @@ void TypingCommand::insertText(Document& document, const String& text, const Vis
|
|
|
| bool TypingCommand::insertLineBreak(Document& document)
|
| {
|
| - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) {
|
| + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) {
|
| lastTypingCommand->setShouldRetainAutocorrectionIndicator(false);
|
| EditingState editingState;
|
| lastTypingCommand->insertLineBreak(&editingState);
|
| @@ -216,7 +216,7 @@ bool TypingCommand::insertLineBreak(Document& document)
|
|
|
| bool TypingCommand::insertParagraphSeparatorInQuotedContent(Document& document)
|
| {
|
| - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) {
|
| + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) {
|
| EditingState editingState;
|
| lastTypingCommand->insertParagraphSeparatorInQuotedContent(&editingState);
|
| return !editingState.isAborted();
|
| @@ -227,7 +227,7 @@ bool TypingCommand::insertParagraphSeparatorInQuotedContent(Document& document)
|
|
|
| bool TypingCommand::insertParagraphSeparator(Document& document)
|
| {
|
| - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) {
|
| + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) {
|
| lastTypingCommand->setShouldRetainAutocorrectionIndicator(false);
|
| EditingState editingState;
|
| lastTypingCommand->insertParagraphSeparator(&editingState);
|
| @@ -237,11 +237,11 @@ bool TypingCommand::insertParagraphSeparator(Document& document)
|
| return TypingCommand::create(document, InsertParagraphSeparator, "", 0)->apply();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<TypingCommand> TypingCommand::lastTypingCommandIfStillOpenForTyping(LocalFrame* frame)
|
| +RawPtr<TypingCommand> TypingCommand::lastTypingCommandIfStillOpenForTyping(LocalFrame* frame)
|
| {
|
| ASSERT(frame);
|
|
|
| - RefPtrWillBeRawPtr<CompositeEditCommand> lastEditCommand = frame->editor().lastEditCommand();
|
| + RawPtr<CompositeEditCommand> lastEditCommand = frame->editor().lastEditCommand();
|
| if (!lastEditCommand || !lastEditCommand->isTypingCommand() || !static_cast<TypingCommand*>(lastEditCommand.get())->isOpenForMoreTyping())
|
| return nullptr;
|
|
|
| @@ -250,7 +250,7 @@ PassRefPtrWillBeRawPtr<TypingCommand> TypingCommand::lastTypingCommandIfStillOpe
|
|
|
| void TypingCommand::closeTyping(LocalFrame* frame)
|
| {
|
| - if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame))
|
| + if (RawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame))
|
| lastTypingCommand->closeTyping();
|
| }
|
|
|
| @@ -383,7 +383,7 @@ void TypingCommand::insertText(const String &text, bool selectInsertedText, Edit
|
|
|
| void TypingCommand::insertTextRunWithoutNewlines(const String &text, bool selectInsertedText, EditingState* editingState)
|
| {
|
| - RefPtrWillBeRawPtr<InsertTextCommand> command = InsertTextCommand::create(document(), text, selectInsertedText,
|
| + RawPtr<InsertTextCommand> command = InsertTextCommand::create(document(), text, selectInsertedText,
|
| m_compositionType == TextCompositionNone ? InsertTextCommand::RebalanceLeadingAndTrailingWhitespaces : InsertTextCommand::RebalanceAllWhitespaces);
|
|
|
| applyCommandToComposite(command, endingSelection(), editingState);
|
| @@ -398,7 +398,7 @@ static bool canAppendNewLineFeedToSelection(const VisibleSelection& selection)
|
| if (!element)
|
| return false;
|
|
|
| - RefPtrWillBeRawPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n"));
|
| + RawPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n"));
|
| element->dispatchEvent(event);
|
| return event->text().length();
|
| }
|
| @@ -495,7 +495,7 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing,
|
|
|
| m_smartDelete = false;
|
|
|
| - OwnPtrWillBeRawPtr<FrameSelection> selection = FrameSelection::create();
|
| + RawPtr<FrameSelection> selection = FrameSelection::create();
|
| selection->setSelection(endingSelection());
|
| selection->modify(FrameSelection::AlterationExtend, DirectionBackward, granularity);
|
| if (killRing && selection->isCaret() && granularity != CharacterGranularity)
|
| @@ -605,7 +605,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity, bool ki
|
| // Handle delete at beginning-of-block case.
|
| // Do nothing in the case that the caret is at the start of a
|
| // root editable element or at the start of a document.
|
| - OwnPtrWillBeRawPtr<FrameSelection> selection = FrameSelection::create();
|
| + RawPtr<FrameSelection> selection = FrameSelection::create();
|
| selection->setSelection(endingSelection());
|
| selection->modify(FrameSelection::AlterationExtend, DirectionForward, granularity);
|
| if (killRing && selection->isCaret() && granularity != CharacterGranularity)
|
|
|