| Index: Source/core/editing/Editor.cpp
|
| diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
|
| index 9bbc1f14ce565e3967f4f96271cb57016a02d0d6..c64ae65c9789176bcfb8a636e5c0ce5299d00b1c 100644
|
| --- a/Source/core/editing/Editor.cpp
|
| +++ b/Source/core/editing/Editor.cpp
|
| @@ -42,6 +42,7 @@
|
| #include "core/dom/KeyboardEvent.h"
|
| #include "core/dom/NodeList.h"
|
| #include "core/dom/NodeTraversal.h"
|
| +#include "core/dom/ScopedEventQueue.h"
|
| #include "core/dom/Text.h"
|
| #include "core/dom/TextEvent.h"
|
| #include "core/dom/UserTypingGestureIndicator.h"
|
| @@ -716,15 +717,16 @@ static void dispatchEditableContentChangedEvents(PassRefPtr<Element> startRoot,
|
|
|
| void Editor::appliedEditing(PassRefPtr<CompositeEditCommand> cmd)
|
| {
|
| + EventQueueScope scope;
|
| m_frame->document()->updateLayout();
|
|
|
| EditCommandComposition* composition = cmd->composition();
|
| ASSERT(composition);
|
| + dispatchEditableContentChangedEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement());
|
| VisibleSelection newSelection(cmd->endingSelection());
|
|
|
| // Don't clear the typing style with this selection change. We do those things elsewhere if necessary.
|
| changeSelectionAfterCommand(newSelection, 0);
|
| - dispatchEditableContentChangedEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement());
|
|
|
| if (!cmd->preservesTypingStyle())
|
| m_frame->selection()->clearTypingStyle();
|
| @@ -745,11 +747,13 @@ void Editor::appliedEditing(PassRefPtr<CompositeEditCommand> cmd)
|
|
|
| void Editor::unappliedEditing(PassRefPtr<EditCommandComposition> cmd)
|
| {
|
| + EventQueueScope scope;
|
| m_frame->document()->updateLayout();
|
|
|
| + dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), cmd->endingRootEditableElement());
|
| +
|
| VisibleSelection newSelection(cmd->startingSelection());
|
| changeSelectionAfterCommand(newSelection, FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle);
|
| - dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), cmd->endingRootEditableElement());
|
|
|
| m_lastEditCommand = 0;
|
| if (client())
|
| @@ -759,11 +763,13 @@ void Editor::unappliedEditing(PassRefPtr<EditCommandComposition> cmd)
|
|
|
| void Editor::reappliedEditing(PassRefPtr<EditCommandComposition> cmd)
|
| {
|
| + EventQueueScope scope;
|
| m_frame->document()->updateLayout();
|
|
|
| + dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), cmd->endingRootEditableElement());
|
| +
|
| VisibleSelection newSelection(cmd->endingSelection());
|
| changeSelectionAfterCommand(newSelection, FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle);
|
| - dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), cmd->endingRootEditableElement());
|
|
|
| m_lastEditCommand = 0;
|
| if (client())
|
|
|