WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
168147
Add new WKWebKit Cocoa API for getContentsAsString
https://bugs.webkit.org/show_bug.cgi?id=168147
Summary
Add new WKWebKit Cocoa API for getContentsAsString
Jason Rinn
Reported
2017-02-10 14:45:27 PST
Add new WKWebKit Cocoa API for getContentsAsString
Attachments
Patch
(10.08 KB, patch)
2017-02-13 16:05 PST
,
Jason Rinn
no flags
Details
Formatted Diff
Diff
Patch
(9.83 KB, patch)
2017-02-13 18:39 PST
,
Jason Rinn
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Jason Rinn
Comment 1
2017-02-13 16:05:10 PST
Created
attachment 301407
[details]
Patch
Tim Horton
Comment 2
2017-02-13 16:14:02 PST
Comment on
attachment 301407
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=301407&action=review
> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:3807 > + auto handler = adoptNS([completionHandler copy]);
This should probably use BlockPtr these days.
> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:3813 > + RetainPtr<NSError> error = adoptNS([[NSError alloc] init]);
This actually logs an error, and the other uses (of [[NSError alloc] init]) are wrong. Should we fix it? Or just propagate the wrongness.
> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewGetContents.mm:42 > + NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; > + [webView loadRequest:request]; > + [webView _test_waitForDidFinishNavigation];
If you want, if you use the TestWKWebView subclass instead of WKWebView directly, it has synchronouslyLoadTestPageNamed, which will replace all of these lines.
Radar WebKit Bug Importer
Comment 3
2017-02-13 16:41:16 PST
<
rdar://problem/30502539
>
Tim Horton
Comment 4
2017-02-13 17:15:00 PST
Comment on
attachment 301407
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=301407&action=review
> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:229 > +- (void)_getContentsAsStringWithCompletionHandler:(void (^)(NSString *, NSError *))completionHandler;
Also, Dan points out that you've forgotten your API availability macros.
Tim Horton
Comment 5
2017-02-13 17:26:23 PST
(In reply to
comment #4
)
> Comment on
attachment 301407
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=301407&action=review
> > > Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h:229 > > +- (void)_getContentsAsStringWithCompletionHandler:(void (^)(NSString *, NSError *))completionHandler; > > Also, Dan points out that you've forgotten your API availability macros.
Like this: WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA))
Jason Rinn
Comment 6
2017-02-13 18:39:07 PST
Created
attachment 301434
[details]
Patch
WebKit Commit Bot
Comment 7
2017-02-14 16:13:15 PST
Comment on
attachment 301434
[details]
Patch Clearing flags on attachment: 301434 Committed
r212334
: <
http://trac.webkit.org/changeset/212334
>
WebKit Commit Bot
Comment 8
2017-02-14 16:13:20 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.
Top of Page
Format For Printing
XML
Clone This Bug