Title: [93893] trunk
- Revision
- 93893
- Author
- [email protected]
- Date
- 2011-08-26 11:07:39 -0700 (Fri, 26 Aug 2011)
Log Message
WebViewImpl::selectionRange should return range in the right order.
https://bugs.webkit.org/show_bug.cgi?id=66973
Patch by Varun Jain <[email protected]> on 2011-08-26
Reviewed by Darin Fisher.
* Source/WebKit/chromium/public/WebWidget.h:
* Source/WebKit/chromium/src/WebViewImpl.cpp:
Modified Paths
Diff
Modified: trunk/ChangeLog (93892 => 93893)
--- trunk/ChangeLog 2011-08-26 18:04:46 UTC (rev 93892)
+++ trunk/ChangeLog 2011-08-26 18:07:39 UTC (rev 93893)
@@ -1,3 +1,13 @@
+2011-08-26 Varun Jain <[email protected]>
+
+ 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 <[email protected]>
Reviewed by Xan Lopez.
Modified: trunk/Source/WebKit/chromium/public/WebWidget.h (93892 => 93893)
--- trunk/Source/WebKit/chromium/public/WebWidget.h 2011-08-26 18:04:46 UTC (rev 93892)
+++ trunk/Source/WebKit/chromium/public/WebWidget.h 2011-08-26 18:07:39 UTC (rev 93893)
@@ -152,7 +152,8 @@
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
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (93892 => 93893)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-08-26 18:04:46 UTC (rev 93892)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-08-26 18:07:39 UTC (rev 93893)
@@ -1562,6 +1562,8 @@
start = frame->view()->contentsToWindow(start);
end = frame->view()->contentsToWindow(end);
+ if (!frame->selection()->selection().isBaseFirst())
+ std::swap(start, end);
return true;
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes