Alexander Mitin wrote:
> The onload event gives you the moment when the page loaded but not
> *rendered*.
That depends on what you mean by "rendered".
In Gecko 1.9, the following are guaranteed to have happened by the time onload
fires:
1) The DOM has been parsed.
2) All network requests that started during the parsing process have completed.
3) Initial style resolution has happened for all nodes, and all CSS-linked
resources that were needed as a result have finished loading.
4) All outstanding style changes (as a result of scripts running during
pageload) have been processed. CSS-linked resources that were needed as a
result of this may not have finished loading yet. This may need fixing,
now that I think on it.
5) A layout pass was performed after all of the above.
There has been no painting yet, but that shouldn't affect drawWindow(), which
does its own painting.
Note that in Gecko 1.8 the situation is different wrt CSS-linked resources, so
you need to be very careful when talking about what has or hasn't happened when
onload fires: you have to specify the Gecko version.
> Ex., if some CSS contains the "url('image.png')"
> statement, you'll possibly end up with screenshot without 'image.png'
> displayed.
If the CSS rule in question matches independently of script-triggered
modifications to the document, this will never happen in Gecko 1.9. If the
rule
is dynamically applied, then it could indeed happen. As I said above, that
might need fixing.
If the CSS rule doesn't match anything, then the image will not be loaded, of
course.
-Boris
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding