[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 17:43:03 PDT 2011


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





--- Comment #41 from Peng Huang <penghuang at chromium.org>  2011-09-01 17:43:03 PST ---
(In reply to comment #39)
> 
> I don't think "surroundingText" is a good name here because what it surrounds is ambiguous. Maybe getSelectionOffsetsAndTextInEditableElement?

I think surroundingText is accurate even without WithSelection suffix (Without the cursor position, this text is useless. Or we need return two pieces of text. before cursor and after cursor). Maybe it is little brief, but it could be clear with a good document. At same time, the input methods just need a small piece of text surrounding the input cursor (The Surrounding Text concept is from qt and gtk), they do not need all content in the editable element. one paragraph is enough. Although this function returns all content in the root editable element currently, but we may optimize it to return a text in reasonable size in future. Especially in Chrome OS, those data will be transferred between several processes (webkit, chrome ui, input daemon and input engine process) frequently. Too large is not efficient.

> 
> > 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.
I could put all in one line, but it will be very long.

-- 
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