[Webkit-unassigned] [Bug 66681] Need API for getting surrounding text from webkit in chromium
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Aug 23 09:24:59 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=66681
--- Comment #5 from Peng Huang <penghuang at chromium.org> 2011-08-23 09:24:59 PST ---
(From update of attachment 104692)
View in context: https://bugs.webkit.org/attachment.cgi?id=104692&action=review
>>> Source/WebKit/chromium/public/WebWidget.h:154
>>> + virtual bool surrounding(WebString& text, size_t& cursor, size_t& anchor) { return false; }
>>
>> You can return WebSize. See (Source/WebKit/public/WebSize.h)
>
> The standard term used is focus and anchor. "cursor" usually refers to mouse cursor, and it's confusing. Alos, Why isn't this function const? Also the last time I checked, Chromium's coding style guide forbid mutable reference and instead forces pass by pointer.
struct WebSize {
int width;
int height;
...}
cursor, and anchor are indexes in plain text. I think it is different with WebSize.
I will change the names.
For coding style, I think the code is in webkit, probably it is better to follow webkit coding guideline? And I also find some functions use mutable reference in this header file. I am confused.
>> Source/WebKit/chromium/src/WebViewImpl.cpp:1512
>> +bool WebViewImpl::surrounding(WebString& text, size_t& cursor, size_t& anchor)
>
> It's sad to have this logic in WebKit layer.
> If we have this in WebCore and make it available from LayoutTestcontroller or window.internals, It can be testable
> and also would be helpful for other ports.
Could you give more detail information? So I could look into it.
>> Source/WebKit/chromium/src/WebViewImpl.cpp:1530
>
> Wait a minute, if rootEditableElement can be null, then element->innerText() would have blown up by null-pointer access, no? r- because of this.
>
> Also, this line appears to be much longer than 80 characters, yet chromium coding guideline mandates the column length to be at most 80 characters.
I will fixed rootEditableElement issue.
Probably those code is in webkit repo. It should follow webkit coding guideline. For example indent is 2 spaces in chrome, but here is 4 spaces.
--
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