RESOLVED FIXED 69028
[chromium] Add a selectionBounds() method to WebWidget.
https://bugs.webkit.org/show_bug.cgi?id=69028
Summary [chromium] Add a selectionBounds() method to WebWidget.
Peng Huang
Reported 2011-09-28 14:08:28 PDT
Add getSubstringFromRange() and modify selectionRange() for chromium
Attachments
Patch (7.20 KB, patch)
2011-09-28 14:13 PDT, Peng Huang
no flags
Patch (8.74 KB, patch)
2011-09-29 12:51 PDT, Peng Huang
no flags
Patch (8.69 KB, patch)
2011-10-11 11:36 PDT, Peng Huang
no flags
Patch (6.83 KB, patch)
2011-10-12 14:56 PDT, Peng Huang
no flags
Patch (6.79 KB, patch)
2011-10-12 18:06 PDT, Peng Huang
no flags
Patch (6.80 KB, patch)
2011-10-13 07:37 PDT, Peng Huang
no flags
Peng Huang
Comment 1 2011-09-28 14:13:04 PDT
James Su
Comment 2 2011-09-29 01:59:50 PDT
I'm not authorized to add comment to the patch. Just paste my comment here: View in context: https://bugs.webkit.org/attachment.cgi?id=109076&action=review And it's probably reasonable to rename WebWidget::caretOrSelectionRange() to selectionRange() to match the name of other similar methods. I'm not qualified for reviewing the actual implementation, please find a webkit reviewer to help review that part. > Source/WebKit/chromium/public/WebWidget.h:148 > virtual bool getSelectionOffsetsAndTextInEditableContent(WebString&, size_t& focus, size_t& anchor) const { return false; } Will this method be deprecated in favor of getSubstringFromRange()? If yes, then I suggest to add a comment and then remove it in an upcoming CL. > Source/WebKit/chromium/public/WebWidget.h:155 > virtual WebRect caretOrSelectionBounds() { return WebRect(); } ditto. > Source/WebKit/chromium/public/WebWidget.h:-159 > - virtual bool selectionRange(WebPoint& start, WebPoint& end) const { return false; } You cannot remove this method in this CL, otherwise you will break chrome code. Removing this method in an upcoming CL after landing this CL and migrating chrome to use to new methods. So just add a comment in this CL stating that this method has been deprecated.
Peng Huang
Comment 3 2011-09-29 12:51:24 PDT
Peng Huang
Comment 4 2011-09-29 13:10:44 PDT
Hi Darin, Could you please review this patch? Thanks.
Peng Huang
Comment 5 2011-10-11 11:36:32 PDT
WebKit Review Bot
Comment 6 2011-10-11 11:40:16 PDT
Please wait for approval from fishd@chromium.org before submitting because this patch contains changes to the Chromium public API.
Darin Fisher (:fishd, Google)
Comment 7 2011-10-11 15:56:09 PDT
Comment on attachment 110547 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=110547&action=review > Source/WebKit/chromium/public/WebWidget.h:154 > + virtual WebString getSubstringFromRange(size_t location, size_t length) const { return WebString(); } shouldn't this just be a method on WebRange? it seems like we should be using WebRange for more of these range related APIs. we should also be providing ways to get a WebRange or construct a WebRange.
Darin Fisher (:fishd, Google)
Comment 8 2011-10-11 15:56:32 PDT
Peng Huang
Comment 9 2011-10-12 10:48:43 PDT
Comment on attachment 110547 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=110547&action=review >> Source/WebKit/chromium/public/WebWidget.h:154 >> + virtual WebString getSubstringFromRange(size_t location, size_t length) const { return WebString(); } > > shouldn't this just be a method on WebRange? it seems like we should be using WebRange > for more of these range related APIs. we should also be providing ways to get a WebRange > or construct a WebRange. Did you mean add a function `WebRange WebView::getRange(size_t location, size_t length)' here? Or add a constructor WebRange::WebRange(WebFrame *frame, size_t location, size_t length). For adding WebRange::WebRange, WebRange can not get enough information from WebFrame for creating a new WebRange. I think we need a function to convert WebFrame back to WebCore::Frame. Is it OK? What's you suggestion?
Peng Huang
Comment 10 2011-10-12 14:56:10 PDT
Darin Fisher (:fishd, Google)
Comment 11 2011-10-12 17:48:17 PDT
Comment on attachment 110751 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=110751&action=review Otherwise, this patch looks fine to me. R=me. > Source/WebKit/chromium/src/WebViewImpl.h:123 > + // TODO(penghuang): It has been replaced by selectionBounds. Remove it when nit: we use FIXME in WebKit instead of TODO(user)
Peng Huang
Comment 12 2011-10-12 18:06:35 PDT
Darin Fisher (:fishd, Google)
Comment 13 2011-10-12 22:15:24 PDT
Comment on attachment 110784 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=110784&action=review still R=me otherwise. > Source/WebKit/chromium/src/WebViewImpl.cpp:1573 > + return false; nit: should be 4 space indent. sorry for not catching this earlier :(
Peng Huang
Comment 14 2011-10-13 07:37:08 PDT
Peng Huang
Comment 15 2011-10-13 07:43:48 PDT
Fixed. Sorry for the mistake.
WebKit Review Bot
Comment 16 2011-10-13 09:11:55 PDT
Comment on attachment 110842 [details] Patch Clearing flags on attachment: 110842 Committed r97368: <http://trac.webkit.org/changeset/97368>
WebKit Review Bot
Comment 17 2011-10-13 09:11:59 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.