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

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

Issue 1049233003: Keep the selection of the text field when changed by JS. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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 | « Source/core/editing/FrameSelection.h ('k') | Source/core/editing/SelectionController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/FrameSelection.cpp
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index 2e3e6109d5f8f33b50b17c627b47872dc0971f58..e082284475f6e6d6bff9d84be802c41bc0c9de38 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -41,6 +41,7 @@
#include "core/editing/GranularityStrategy.h"
#include "core/editing/InputMethodController.h"
#include "core/editing/RenderedPosition.h"
+#include "core/editing/SelectionController.h"
#include "core/editing/SpellChecker.h"
#include "core/editing/TypingCommand.h"
#include "core/editing/VisibleUnits.h"
@@ -327,6 +328,7 @@ void FrameSelection::setSelection(const VisibleSelection& newSelection, SetSelec
notifyAccessibilityForSelectionChange();
notifyCompositorForSelectionChange();
+ notifyEventHandlerForSelectionChange();
m_frame->localDOMWindow()->enqueueDocumentEvent(Event::create(EventTypeNames::selectionchange));
}
@@ -1508,6 +1510,11 @@ void FrameSelection::notifyCompositorForSelectionChange()
scheduleVisualUpdate();
}
+void FrameSelection::notifyEventHandlerForSelectionChange()
+{
+ m_frame->eventHandler().selectionController().notifySelectionChanged();
+}
+
void FrameSelection::focusedOrActiveStateChanged()
{
bool activeAndFocused = isFocusedAndActive();
« no previous file with comments | « Source/core/editing/FrameSelection.h ('k') | Source/core/editing/SelectionController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698