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

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 1123563003: Improving direction-based selection strategy. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing rotated text + comment cleanup Created 5 years, 7 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/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index b4b9eaedcccf30a82306f5b2da1d1a06845429a3..e6d2868bec3b8e9c8dfbedcff1d1762e933d52cd 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -1261,7 +1261,7 @@ void WebLocalFrameImpl::selectRange(const WebRange& webRange)
void WebLocalFrameImpl::moveRangeSelectionExtent(const WebPoint& point)
{
- frame()->selection().moveRangeSelectionExtent(visiblePositionForViewportPoint(point));
+ frame()->selection().moveRangeSelectionExtent(frame()->view()->viewportToContents(point));
}
void WebLocalFrameImpl::moveRangeSelection(const WebPoint& baseInViewport, const WebPoint& extentInViewport, WebFrame::TextGranularity granularity)
@@ -1322,13 +1322,7 @@ void WebLocalFrameImpl::setCaretVisible(bool visible)
VisiblePosition WebLocalFrameImpl::visiblePositionForViewportPoint(const WebPoint& pointInViewport)
{
- HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping;
- HitTestResult result(request, frame()->view()->viewportToContents(pointInViewport));
- frame()->document()->layoutView()->hitTest(result);
-
- if (Node* node = result.innerNode())
- return frame()->selection().selection().visiblePositionRespectingEditingBoundary(result.localPoint(), node);
- return VisiblePosition();
+ return visiblePositionForContentsPoint(frame()->view()->viewportToContents(pointInViewport), frame());
}
WebPlugin* WebLocalFrameImpl::focusedPluginIfInputMethodSupported()
« Source/core/editing/GranularityStrategy.h ('K') | « Source/core/editing/VisibleUnits.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698