[webkit-qt] Road towards initial WebKit2 API for Qt 5.0
simon.hausmann at nokia.com
simon.hausmann at nokia.com
Wed Dec 7 11:34:58 PST 2011
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: webkit-qt-bounces at lists.webkit.org [mailto:webkit-qt-bounces at lists.webkit.org] On Behalf Of ext Jocelyn Turcotte
> Sent: Monday, December 05, 2011 11:49 AM
> To: Hausmann Simon (Nokia-MP-Qt/Oslo)
> Cc: webkit-qt at lists.webkit.org
> 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 <simon.hausmann at nokia.com> 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
> webkit-qt at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-qt
More information about the webkit-qt
mailing list