[Webkit-unassigned] [Bug 66681] Need API for getting surrounding text from webkit in chromium
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Sep 1 16:41:18 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=66681
Ryosuke Niwa <rniwa at webkit.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #106061|review? |review-
Flag| |
--- Comment #39 from Ryosuke Niwa <rniwa at webkit.org> 2011-09-01 16:41:18 PST ---
(From update of attachment 106061)
View in context: https://bugs.webkit.org/attachment.cgi?id=106061&action=review
> Source/WebKit/chromium/ChangeLog:8
> + Add surroundingTextWithSelection() to Chromium's WebViewImpl
This doesn't explain anything about the function. In fact, I can see that from the code change. What I'd like to know instead is why we're adding this function and why it has this particular interface, etc...
> Source/WebKit/chromium/public/WebWidget.h:154
> + virtual bool surroundingTextWithSelection(WebString&, size_t& focus, size_t& anchor) const { return false; }
I don't think "surroundingText" is a good name here because what it surrounds is ambiguous. Maybe getSelectionOffsetsAndTextInEditableElement?
> Source/WebKit/chromium/src/WebViewImpl.cpp:1512
> +bool WebViewImpl::surroundingTextWithSelection(
> + WebString& text, size_t& focus, size_t& anchor) const
Nit: I would put all in one line.
> Source/WebKit/chromium/src/WebViewImpl.cpp:1523
> + text = element->innerText();
It seems odd that we'll obtain text even when selection range is 0 or locationAndLengthFromRange returns false.
Since innerText is a pretty expensive operation, we should probably move this below that return statement.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list