#include "config.h"
#include "core/editing/TextInsertionBaseCommand.h"
-#include "bindings/v8/ExceptionStatePlaceholder.h"
+#include "bindings/core/v8/ExceptionStatePlaceholder.h"
#include "core/events/BeforeTextInsertedEvent.h"
#include "core/dom/Element.h"
#include "core/dom/Node.h"
#include "core/editing/FrameSelection.h"
#include "core/frame/LocalFrame.h"
-namespace WebCore {
+namespace blink {
TextInsertionBaseCommand::TextInsertionBaseCommand(Document& document)
: CompositeEditCommand(document)
{
}
-void TextInsertionBaseCommand::applyTextInsertionCommand(LocalFrame* frame, PassRefPtr<TextInsertionBaseCommand> command, const VisibleSelection& selectionForInsertion, const VisibleSelection& endingSelection)
+void TextInsertionBaseCommand::applyTextInsertionCommand(LocalFrame* frame, PassRefPtrWillBeRawPtr<TextInsertionBaseCommand> command, const VisibleSelection& selectionForInsertion, const VisibleSelection& endingSelection)
{
bool changeSelection = selectionForInsertion != endingSelection;
if (changeSelection) {
if (Node* startNode = selectionForInsertion.start().containerNode()) {
if (startNode->rootEditableElement()) {
// Send BeforeTextInsertedEvent. The event handler will update text if necessary.
- RefPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text);
+ RefPtrWillBeRawPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(text);
startNode->rootEditableElement()->dispatchEvent(evt, IGNORE_EXCEPTION);
newText = evt->text();
}
bool canAppendNewLineFeedToSelection(const VisibleSelection& selection)
{
- Node* node = selection.rootEditableElement();
- if (!node)
+ Element* element = selection.rootEditableElement();
+ if (!element)
return false;
- RefPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n"));
- node->dispatchEvent(event, IGNORE_EXCEPTION);
+ RefPtrWillBeRawPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n"));
+ element->dispatchEvent(event, IGNORE_EXCEPTION);
return event->text().length();
}