[webkit-dev] Catching events in JavaScript and the onload event

Mihai Balan mibalan at adobe.com
Mon Oct 1 00:54:03 PDT 2012

Well, about your second question - onload does *NOT* guarantee that the document is done rendering. All it does say is that all the HTML code was loaded and the DOM tree corresponding to this "initial" snapshot has been created. It does not cover things like DOM altering via script, image loads, etc. And as far as I know, there's no way to tell with 100% certainty that your page has finished loading *everything* - especially if there's JavaScript involved.

Hope this helps,

Mihai Balan | Quality Engineer / WebKit team |  mibalan at adobe.com<mailto:mibalan at adobe.com> | +4-031.413.3653 / x83653 | Adobe Systems Romania

From: webkit-dev-bounces at lists.webkit.org [mailto:webkit-dev-bounces at lists.webkit.org] On Behalf Of Luka Napotnik
Sent: Thursday, September 27, 2012 2:55 PM
To: webkit-dev at lists.webkit.org
Subject: [webkit-dev] Catching events in JavaScript and the onload event


I'm trying to figure out how to give a WebKit program hints that JavaScript is going to change the DOM structure my manipulating it's tree (e.g. IMG 'src' attribute change). Can anyone give me some pointers where should I look at.

And another related question... The 'onload' event should be triggered only then when all resources are loaded and the DOM tree is constructed. In other words, the page is ready to be rendered to the user. But, as I use Gtk+ and the off-screen widget I can explicitly 'draw' the WebKit surface when I receive an 'onload' event from Webkit. But the problem is that the page is some times still half-rendered (missing images). Any ideas why is the event behaving this way?

Best regards,

Luka Napotnik,

www: http://napotnik.info
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20121001/6f571097/attachment.html>

More information about the webkit-dev mailing list