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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2431153002: Introduce FrameSelection::moveCaretSelection() as replacement of moveTo() (Closed)
Patch Set: 2016-10-19T14:44:09 Created 4 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 | « third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index efe1fe56aa7c0a9d1a22a1ee8207305873fa102a..31e64e509ee1f9d2f2c3fdfb859ba171039921f3 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -1262,13 +1262,9 @@ void WebLocalFrameImpl::moveCaretSelection(const WebPoint& pointInViewport) {
// TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
// needs to be audited. see http://crbug.com/590369 for more details.
frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
-
- Element* editable = frame()->selection().rootEditableElement();
- if (!editable)
- return;
-
- VisiblePosition position = visiblePositionForViewportPoint(pointInViewport);
- frame()->selection().moveTo(position, UserTriggered);
+ const IntPoint pointInContents =
+ frame()->view()->viewportToContents(pointInViewport);
+ frame()->selection().moveCaretSelection(pointInContents);
}
bool WebLocalFrameImpl::setEditableSelectionOffsets(int start, int end) {
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698