Bug 174605 - [WK] Deprecate WKScriptMessage.webView
Summary: [WK] Deprecate WKScriptMessage.webView
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-07-17 20:18 PDT by Daniel Bates
Modified: 2017-07-17 22:32 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.75 KB, patch)
2017-07-17 20:21 PDT, Daniel Bates
mitz: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2017-07-17 20:18:58 PDT
Deprecate WKScriptMessage.webView as it is redundant now that WKFrameInfo has a webView property. The webView property was added to WKFrameInfo in r219013. Moving forward developers should use -[WKScriptMessage frameInfo].webView to get the WKWebView that sent the script message.
Comment 1 Radar WebKit Bug Importer 2017-07-17 20:19:38 PDT
<rdar://problem/33367745>
Comment 2 Daniel Bates 2017-07-17 20:21:30 PDT
Created attachment 315758 [details]
Patch
Comment 3 mitz 2017-07-17 20:21:43 PDT
(In reply to Daniel Bates from comment #0)
> Deprecate WKScriptMessage.webView as it is redundant now that WKFrameInfo
> has a webView property. The webView property was added to WKFrameInfo in
> r219013. Moving forward developers should use -[WKScriptMessage
> frameInfo].webView to get the WKWebView that sent the script message.

Why should developers take two steps to get to something that previously required only one?
Comment 4 mitz 2017-07-17 20:23:11 PDT
Comment on attachment 315758 [details]
Patch

It’s not clear what motivates this deprecation.
Comment 5 Daniel Bates 2017-07-17 21:52:12 PDT
(In reply to mitz from comment #3)
> (In reply to Daniel Bates from comment #0)
> > Deprecate WKScriptMessage.webView as it is redundant now that WKFrameInfo
> > has a webView property. The webView property was added to WKFrameInfo in
> > r219013. Moving forward developers should use -[WKScriptMessage
> > frameInfo].webView to get the WKWebView that sent the script message.
> 
> Why should developers take two steps to get to something that previously
> required only one?

It's duplicative to have two ways to get the same information. I do not feel strongly about this patch and hence I did not put it up for review. Geoff Garen suggested that I deprecate WKScriptMessage.webView when I spoke to him
last Friday (07/14). Maybe Geoff can provide more insight into his motivation?
Comment 6 mitz 2017-07-17 22:32:30 PDT
(In reply to Daniel Bates from comment #5)
> (In reply to mitz from comment #3)
> > (In reply to Daniel Bates from comment #0)
> > > Deprecate WKScriptMessage.webView as it is redundant now that WKFrameInfo
> > > has a webView property. The webView property was added to WKFrameInfo in
> > > r219013. Moving forward developers should use -[WKScriptMessage
> > > frameInfo].webView to get the WKWebView that sent the script message.
> > 
> > Why should developers take two steps to get to something that previously
> > required only one?
> 
> It's duplicative to have two ways to get the same information.

Convenience methods often duplicate something that can be done in another, less convenient way.

Deprecating API burdens everyone who is already using it. In this case, we are also creating undue burden for anyone who might have used it in the future, because they’d have to go through two accessors. But what is the upside? Even in the unimaginable future in which the property is removed entirely, I don’t see it.

> I do not feel
> strongly about this patch and hence I did not put it up for review. Geoff
> Garen suggested that I deprecate WKScriptMessage.webView when I spoke to him
> last Friday (07/14). Maybe Geoff can provide more insight into his
> motivation?