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

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

Issue 330613002: Copying text closes the keyboard and the text input gets unfocused, forcing virtual keyboard is get… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review comments Created 6 years, 6 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 df236f8f75946dda54c909588173f5a4d24b6f50..b15480a15be9b8c16fc14e0b8e9744f9c66192bc 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -299,6 +299,18 @@ void FrameSelection::setSelection(const VisibleSelection& newSelection, SetSelec
m_frame->domWindow()->enqueueDocumentEvent(Event::create(EventTypeNames::selectionchange));
}
+bool FrameSelection::collapseToEnd()
+{
+ // Check for selection is editable and whether it's range selection or not.
+ if (!selection().rootEditableElement() || !isRange())
+ return false;
+
+ // Collapsing the selection to end of range selection.
+ moveTo(m_selection.end(), DOWNSTREAM);
+
+ return true;
+}
+
static bool removingNodeRemovesPosition(Node& node, const Position& position)
{
if (!position.anchorNode())

Powered by Google App Engine
This is Rietveld 408576698