[webkit-qt] start render page after loading all page elements
jocelyn.turcotte at nokia.com
jocelyn.turcotte at nokia.com
Tue Jun 19 07:55:08 PDT 2012
Hi,
loadFinished only means that all resources are finished downloading from the network (excluding XMLHttpRequests).
So for a page like gmail.com that continues downloading a big part of its UI over scripted requests afterward, it won't work well.
There is also the QWebFrame::initialLayoutCompleted that could help you, but this one might also come too early in some cases.
You could try a mixture of looking at whichever comes last between loadFinished and initialLayoutCompleted. If that still doesn't work well enough for most pages you could use a timer to wait an additional 1-5 seconds (if that fits your use case).
There is no reliable way that I know of for the web page to signal the browser that the document is complete and ready for use.
regards,
Jocelyn
________________________________
From: webkit-qt-bounces at lists.webkit.org [webkit-qt-bounces at lists.webkit.org] on behalf of ext andy wang [wandy817 at gmail.com]
Sent: Tuesday, June 19, 2012 4:40 PM
To: webkit-qt at lists.webkit.org
Subject: [webkit-qt] start render page after loading all page elements
Hi,
I want to render one page after loading its all elements. Now, the qtwebkit download
the elements while rendering, I want to change this behavior. In my application,
I have qt4.8+directfb, and all data include webpage will be rendered by directfb plugin of
qt to directfb. And I tried to receive the loadStarted and loadFinished signal of mainframe,
and disable flip window surface to screen when receive loadStarted signal, and enable flip
window surface to screen when receive loadFinished. The detail as follows:
connect(mainframe, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted()));
connect(mainframe, SIGNAL(loadFinished()), this, SLOT(slotLoadFinished()));
void slotLoadStarted()
{
//disable rendering in qtdirectfb level
disableDfbRender();
}
void slotLoadFinished()
{
// enable rendering in qtdirectfb level
// and refresh whole window surface
enableDfbRender();
refreshDfbWindow();
}
But this solution is not successful, because the loadFinished signal is not means all elements
have been drawed to the window surface, so refresh window surface to primary surface only push
part data to screen.
So how can I render whole webpage after loading all its elements. Does qtwebkit provide the API or
signal? Or how can I modified the source code of qtwebkit to reach this goal?
I don't know if it's proper to ask question here. But I read the qtwebkit code and at last I don't find how to
achieve this goal.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20120619/fc5aea90/attachment.html>
More information about the webkit-qt
mailing list