RESOLVED FIXED 110618
[Chromium] Add expandedToParagraph() method to WebRange
https://bugs.webkit.org/show_bug.cgi?id=110618
Summary [Chromium] Add expandedToParagraph() method to WebRange
Rouslan Solomakhin
Reported 2013-02-22 09:50:30 PST
Add paragraphAroundCaret() method to WebFrame
Attachments
Patch (3.45 KB, patch)
2013-02-22 09:55 PST, Rouslan Solomakhin
no flags
Patch (2.38 KB, patch)
2013-02-22 16:40 PST, Rouslan Solomakhin
no flags
Patch for landing (2.43 KB, patch)
2013-02-25 09:13 PST, Rouslan Solomakhin
no flags
Rouslan Solomakhin
Comment 1 2013-02-22 09:55:10 PST
Rouslan Solomakhin
Comment 2 2013-02-22 09:56:31 PST
Groby, Tony: PTAL.
Rouslan Solomakhin
Comment 3 2013-02-22 09:59:19 PST
Groby: This method allows to query the spelling context. As you mentioned, we would not want to pass the spelling context up together with context click data. Another possibility would be add expandParagraph() method to WebRange object, but its comment says that WebRange is intended to be read-only.
WebKit Review Bot
Comment 4 2013-02-22 13:05:13 PST
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Tony Chang
Comment 5 2013-02-22 15:05:27 PST
(In reply to comment #3) > Groby: This method allows to query the spelling context. As you mentioned, we would not want to pass the spelling context up together with context click data. Another possibility would be add expandParagraph() method to WebRange object, but its comment says that WebRange is intended to be read-only. Could you have WebRange::expandParagraph return a new WebRange with the extra text?
Rouslan Solomakhin
Comment 6 2013-02-22 15:07:08 PST
I certainly could! Let me get that done...
Rouslan Solomakhin
Comment 7 2013-02-22 16:40:01 PST
Rouslan Solomakhin
Comment 8 2013-02-22 16:40:32 PST
Tony: PTAL.
Tony Chang
Comment 9 2013-02-22 18:04:00 PST
Comment on attachment 189859 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=189859&action=review > Source/WebKit/chromium/src/WebRange.cpp:101 > + ExceptionCode ec; > + copy.m_private->expand("block", ec); I think you want to use IGNORE_EXCEPTION here.
Tony Chang
Comment 10 2013-02-22 18:04:24 PST
(In reply to comment #9) > (From update of attachment 189859 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=189859&action=review > > > Source/WebKit/chromium/src/WebRange.cpp:101 > > + ExceptionCode ec; > > + copy.m_private->expand("block", ec); > > I think you want to use IGNORE_EXCEPTION here. LGTM with that change, but one of the API owners needs to approve.
Adam Barth
Comment 11 2013-02-23 09:52:54 PST
Comment on attachment 189859 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=189859&action=review > Source/WebKit/chromium/public/WebRange.h:76 > + WEBKIT_EXPORT WebRange expandParagraph() const; It looks like the WebCore version mutates the Rang whereas this one returns a new range that has been expanded. Perhaps we should pick a name like "expandedToParagraph" to make it clear that we're not mutating the object.
Rouslan Solomakhin
Comment 12 2013-02-25 09:13:21 PST
Created attachment 190073 [details] Patch for landing
Rouslan Solomakhin
Comment 13 2013-02-25 09:14:10 PST
Comment on attachment 190073 [details] Patch for landing Adam: PTAL.
Adam Barth
Comment 14 2013-02-25 11:51:33 PST
Comment on attachment 190073 [details] Patch for landing I should ask you for a test. :)
WebKit Review Bot
Comment 15 2013-02-25 19:20:17 PST
Comment on attachment 190073 [details] Patch for landing Clearing flags on attachment: 190073 Committed r144002: <http://trac.webkit.org/changeset/144002>
WebKit Review Bot
Comment 16 2013-02-25 19:20:21 PST
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.