Hi Gopal,

On Dec 5, 2011, at 9:27 PM, Raghavan Gopal.1 (Nokia-MP/Boston) wrote:

> This is regarding loadHtml API for QQuickWebView that was implemented as 
> r100923.
> Can't we just use load(url) api with data scheme, like 
> webview.load("data:text/html, <body>hello world</body>");
> 
> This will eliminate the need for two api's:
> function load(url) {}
> function loadHtml(html, baseUrl) {}

I think this is a case where avoiding an overload results in more readable 
code. Compare these snippets:

var emailBody = getTheBodyOfAnEmailAsHTMLFromSomewhere();
var dataURL = "data:text/html," + emailBody;
webView.load(dataURL);

versus

var emailBody = getTheBody();
webView.loadHtml(emailBody);


I think the second variant is easier to read. What do you think?


Simon

P.S.: I _think_ loadHtml can also be implemented more efficiently.

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of ext Jocelyn Turcotte
> Sent: Monday, December 05, 2011 11:49 AM
> To: Hausmann Simon (Nokia-MP-Qt/Oslo)
> Cc: [email protected]
> Subject: Re: [webkit-qt] Road towards initial WebKit2 API for Qt 5.0
> 
> On Mon, 5 Dec 2011 16:30:55 +0100
> ext Simon Hausmann <[email protected]> wrote:
> 
>>    property Item page;
> 
> Should we also keep the page in the experimental closet until we have a 
> complete Item embedding API to offer?
> _______________________________________________
> webkit-qt mailing list
> [email protected]
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-qt

_______________________________________________
webkit-qt mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-qt

Reply via email to