RESOLVED FIXED Bug 131000
Need an Objective-C API or SPI for Find in Page
https://bugs.webkit.org/show_bug.cgi?id=131000
Summary Need an Objective-C API or SPI for Find in Page
Alice Liu
Reported 2014-03-31 18:28:41 PDT
WebKit2 has a C API for finding in page, but no Cocoa one.
Attachments
patch (33.01 KB, patch)
2014-03-31 18:35 PDT, Alice Liu
no flags
Patch (32.95 KB, patch)
2014-03-31 18:55 PDT, Alice Liu
no flags
Patch (32.96 KB, patch)
2014-03-31 19:03 PDT, Alice Liu
mitz: review+
Alice Liu
Comment 1 2014-03-31 18:35:38 PDT
Created attachment 228229 [details] patch patch for build bot test, first.
Alice Liu
Comment 2 2014-03-31 18:55:53 PDT
Alice Liu
Comment 3 2014-03-31 19:03:06 PDT
WebKit Commit Bot
Comment 4 2014-03-31 19:04:32 PDT
Attachment 228231 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:43: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:134: Missing spaces around = [whitespace/operators] [4] Total errors found: 2 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alice Liu
Comment 5 2014-03-31 19:16:05 PDT
(In reply to comment #4) > ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:43: Place brace on its own line for function definitions. [whitespace/braces] [4] This isn't incorrect style for a NS_OPTIONS typedef. Style for functions is being applied in the wrong context. > ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:134: Missing spaces around = [whitespace/operators] [4] This isn't incorrect style for property declarations. This matches the style of the line directly above it. Style for assignment operator is being applied in the wrong context. > If any of these errors are false positives, please file a bug against check-webkit-style. How to do this? I did not find a component by the name of "check-webkit-style" when selecting the component for a new bug.
Alice Liu
Comment 6 2014-03-31 19:21:47 PDT
The gtk-wk2 build failure is irrelevant. It was caused by http://trac.webkit.org/changeset/166553.
mitz
Comment 7 2014-04-01 20:38:52 PDT
Comment on attachment 228231 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=228231&action=review Looks great! I can imagine a version of this API where there is no delegate, and the “find” and “count” methods take completion handler blocks, but as SPI this is a great start. > Source/WebKit2/UIProcess/API/APIFindClient.h:43 > + virtual void didCountStringMatches(WebKit::WebPageProxy*, const WTF::String&, uint32_t matchCount) { } > + virtual void didFindString(WebKit::WebPageProxy*, const WTF::String&, uint32_t matchCount) { } > + virtual void didFailToFindString(WebKit::WebPageProxy*, const WTF::String&) { } No need to qualify String with WTF:: since WTFString.h, which you’re including, says “using WTF::String”. > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1227 > +- (UIView *)_hostForFindUI Why not call this _viewForFindUI? “Host” has other meanings, and isn’t a term we normally use to describe the role of a view. > Source/WebKit2/UIProcess/Cocoa/FindClient.h:45 > + RetainPtr<id <_WKFindDelegate> > delegate(); No need for the space between the > >. > Source/WebKit2/UIProcess/Cocoa/FindClient.h:55 > + WeakObjCPtr<id <_WKFindDelegate> > m_delegate; Ditto. > Source/WebKit2/UIProcess/Cocoa/FindClient.mm:40 > +RetainPtr<id <_WKFindDelegate> > FindClient::delegate() Ditto. > Source/WebKit2/UIProcess/Cocoa/FindClient.mm:45 > +void FindClient::setDelegate(id <_WKFindDelegate> delegate) Ditto.
Alice Liu
Comment 8 2014-04-02 12:43:28 PDT
(In reply to comment #7) > > Source/WebKit2/UIProcess/API/APIFindClient.h:43 > > + virtual void didCountStringMatches(WebKit::WebPageProxy*, const WTF::String&, uint32_t matchCount) { } > > + virtual void didFindString(WebKit::WebPageProxy*, const WTF::String&, uint32_t matchCount) { } > > + virtual void didFailToFindString(WebKit::WebPageProxy*, const WTF::String&) { } > > No need to qualify String with WTF:: since WTFString.h, which you’re including, says “using WTF::String”. I tried removing WTF:: and it resulted in a compile time error in WebPageProxy. I think the compiler is assuming API::String if the WTF:: is not present to clarify which String class. thanks for reviewing.
Anders Carlsson
Comment 9 2014-04-02 12:44:53 PDT
(In reply to comment #8) > (In reply to comment #7) > > No need to qualify String with WTF:: since WTFString.h, which you’re including, says “using WTF::String”. > > I tried removing WTF:: and it resulted in a compile time error in WebPageProxy. I think the compiler is assuming API::String if the WTF:: is not present to clarify which String class. > Yeah it is needed to resolve the API::String vs WTF::String ambiguity.
Alice Liu
Comment 10 2014-04-02 12:52:15 PDT
Note You need to log in before you can comment on or make changes to this bug.