Bug 138929 - Add -[WKWebView loadData:MIMEType:textEncodingName:baseURL:]
Summary: Add -[WKWebView loadData:MIMEType:textEncodingName:baseURL:]
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-20 10:20 PST by Anders Carlsson
Modified: 2014-11-20 12:01 PST (History)
1 user (show)

See Also:


Attachments
Patch (5.94 KB, patch)
2014-11-20 10:22 PST, Anders Carlsson
no flags Details | Formatted Diff | Diff
Patch (6.00 KB, patch)
2014-11-20 11:58 PST, Anders Carlsson
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2014-11-20 10:20:40 PST
Add -[WKWebView loadData:MIMEType:textEncodingName:baseURL:]
Comment 1 Anders Carlsson 2014-11-20 10:22:39 PST
Created attachment 241957 [details]
Patch
Comment 2 mitz 2014-11-20 10:31:02 PST
Comment on attachment 241957 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=241957&action=review

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:111
> + @param encodingName The encoding of the data.

I think this should say “text encoding of the data”, but also, since this is an NSString, perhaps it should say that it should be an IANA name, or whatever is applicable here.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:112
> + @param baseURL A URL that is used to resolve relative URLs within the document.

Will anything work if this is a file URL (i.e. will a there be read access to the URL)? If not, this is worth mentioning in the @discussion. Besides being used to resolve relative URLs, does this URL also control access to cookies and other things?
Comment 3 Anders Carlsson 2014-11-20 10:33:27 PST
(In reply to comment #2)
> Comment on attachment 241957 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=241957&action=review
> 
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:111
> > + @param encodingName The encoding of the data.
> 
> I think this should say “text encoding of the data”, but also, since this is
> an NSString, perhaps it should say that it should be an IANA name, or
> whatever is applicable here.

How about "The IANA registered text encoding of the data"?

> 
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:112
> > + @param baseURL A URL that is used to resolve relative URLs within the document.
> 
> Will anything work if this is a file URL (i.e. will a there be read access
> to the URL)? If not, this is worth mentioning in the @discussion. Besides
> being used to resolve relative URLs, does this URL also control access to
> cookies and other things?

Not yet, that's tracked by another bug (including modifying the header documentation to clarify this).
Comment 4 mitz 2014-11-20 10:46:39 PST
(In reply to comment #3)
> (In reply to comment #2)
> > Comment on attachment 241957 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=241957&action=review
> > 
> > > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:111
> > > + @param encodingName The encoding of the data.
> > 
> > I think this should say “text encoding of the data”, but also, since this is
> > an NSString, perhaps it should say that it should be an IANA name, or
> > whatever is applicable here.
> 
> How about "The IANA registered text encoding of the data"?

Looking at the HTML spec, this is usually called “character encoding” and the names come from <https://encoding.spec.whatwg.org>, where they are referred to as “names” and “labels”, so an IANA reference may be outdated. Perhaps the selector should be -loadData:MIMEType:characterEncoding:baseURL:. The comment could say “The data's character encoding name”.
Comment 5 Anders Carlsson 2014-11-20 11:58:36 PST
Created attachment 241968 [details]
Patch
Comment 6 Anders Carlsson 2014-11-20 12:01:28 PST
Committed r176408: <http://trac.webkit.org/changeset/176408>