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

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
Index: Source/core/editing/FrameSelection.cpp
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index 249dbe2971a8aef46f5b1312110060470eb50b9f..112b5dfcaefd9ba497eda47fd1761008d4a37a15 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));
}
@@ -1505,6 +1507,11 @@ void FrameSelection::notifyCompositorForSelectionChange()
scheduleVisualUpdate();
}
+void FrameSelection::notifyEventHandlerForSelectionChange()
+{
+ m_frame->eventHandler().selectionController().notifySelectionChanged();
+}
+
void FrameSelection::focusedOrActiveStateChanged()
{
bool activeAndFocused = isFocusedAndActive();

Powered by Google App Engine
This is Rietveld 408576698