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

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

Issue 21030005: Editor: Deffer event dispatch after selection change. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove redundant expectation file Created 7 years, 2 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
« no previous file with comments | « LayoutTests/editing/selection/drag-drop-restore-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/Editor.cpp
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index 9fb0bf081d45c2bee01466f2997de6742f46a3e9..c8e6d505ff0f449ac6f78391f1e8834938c0dc0a 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -59,6 +59,7 @@
#include "core/events/ClipboardEvent.h"
#include "core/events/EventNames.h"
#include "core/events/KeyboardEvent.h"
+#include "core/events/ScopedEventQueue.h"
#include "core/events/TextEvent.h"
#include "core/fetch/ResourceFetcher.h"
#include "core/html/HTMLImageElement.h"
@@ -758,15 +759,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();
@@ -786,11 +788,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;
client().registerRedoStep(cmd);
@@ -799,11 +803,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;
client().registerUndoStep(cmd);
« no previous file with comments | « LayoutTests/editing/selection/drag-drop-restore-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698