WebViewImpl::selectionRange should return range in the right order.

https://bugs.webkit.org/show_bug.cgi?id=66973

Patch by Varun Jain <varunjain@google.com> on 2011-08-26
Reviewed by Darin Fisher.

*  Source/WebKit/chromium/public/WebWidget.h:
*  Source/WebKit/chromium/src/WebViewImpl.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 50c6deae
2011-08-26 Varun Jain <varunjain@google.com>
WebViewImpl::selectionRange should return range in the right order.
https://bugs.webkit.org/show_bug.cgi?id=66973
Reviewed by Darin Fisher.
* Source/WebKit/chromium/public/WebWidget.h:
* Source/WebKit/chromium/src/WebViewImpl.cpp:
2011-08-25 Martin Robinson <mrobinson@igalia.com>
Reviewed by Xan Lopez.
......
......@@ -152,7 +152,8 @@ public:
virtual WebRect caretOrSelectionBounds() { return WebRect(); }
// Returns the start and end point for the current selection, aligned to the
// bottom of the selected line.
// bottom of the selected line. start and end are the logical beginning and
// ending positions of the selection. Visually, start may lie after end.
virtual bool selectionRange(WebPoint& start, WebPoint& end) const { return false; }
// Fetch the current selection range of this WebWidget. If there is no
......
......@@ -1562,6 +1562,8 @@ bool WebViewImpl::selectionRange(WebPoint& start, WebPoint& end) const
start = frame->view()->contentsToWindow(start);
end = frame->view()->contentsToWindow(end);
if (!frame->selection()->selection().isBaseFirst())
std::swap(start, end);
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment