Debugging mid-page relayout issues
I have encountered a bug that occurs on a certain page only sometimes and only when it's loaded via HTTP (i.e. not when opened as a webarchive). It looks like the bug occurs only when relayouting occurs when the HTML is not fully loaded (or perhaps when images are loaded after the page HTML has been loaded). I'm afraid I don't know much more than that about the exact conditions. Do you know of any techniques that will allow me to reproduce those conditions without relying on that specific page and on the server it's coming from? Thanks, -- Mitz Pettel
On Jun 21, 2005, at 12:41 PM, Mitz Pettel wrote:
I have encountered a bug that occurs on a certain page only sometimes and only when it's loaded via HTTP (i.e. not when opened as a webarchive). It looks like the bug occurs only when relayouting occurs when the HTML is not fully loaded (or perhaps when images are loaded after the page HTML has been loaded). I'm afraid I don't know much more than that about the exact conditions.
Do you know of any techniques that will allow me to reproduce those conditions without relying on that specific page and on the server it's coming from?
If you insert the following in the middle of a document, it will force a layout at that exact point: <script> document.offsetTop; </script> This gets a property that requires a layout, and therefore always will cause a layout at that point in parsing a document. Regards, Maciej
document.body.offsetTop. dave On Jun 21, 2005, at 2:47 PM, Maciej Stachowiak wrote:
On Jun 21, 2005, at 12:41 PM, Mitz Pettel wrote:
I have encountered a bug that occurs on a certain page only sometimes and only when it's loaded via HTTP (i.e. not when opened as a webarchive). It looks like the bug occurs only when relayouting occurs when the HTML is not fully loaded (or perhaps when images are loaded after the page HTML has been loaded). I'm afraid I don't know much more than that about the exact conditions.
Do you know of any techniques that will allow me to reproduce those conditions without relying on that specific page and on the server it's coming from?
If you insert the following in the middle of a document, it will force a layout at that exact point:
<script> document.offsetTop; </script>
This gets a property that requires a layout, and therefore always will cause a layout at that point in parsing a document.
Regards, Maciej
_______________________________________________ webkit-dev mailing list webkit-dev@opendarwin.org http://www.opendarwin.org/mailman/listinfo/webkit-dev
On Jun 21, 2005, at 3:01 PM, David Hyatt wrote:
document.body.offsetTop.
You sure? offsetTop appears to be defined on all nodes, not just elements, and kjs_dom.cpp line 408 looks like it will force the layout in any case for all nodes, even if there is no renderer. Although I guess the body version is cleaner. - Maciej
I've thought about this before, especially in regards to Bug 3416 (Scroll bars are sometimes not updated properly). http://bugzilla.opendarwin.org/show_bug.cgi?id=3416 Could you add A LOT spaces or NULL characters (ctrl-@, I think) to the body of the document to "simulate" a timeout when the browser is loading the page from the filesystem? You might have to put an awful lot of them in to simulate a timeout, but at least the HTML document would compress well. (The difference, though, would be that the browser was continually getting input even though it had nothing to render, versus a network timeout where nothing is coming in.) Otherwise, a small HTTP server (Jetty anyone?) would have to be added to the test suite to provide a "realistic" server response, in which case you could create an artificial "timeout" as needed). Jetty is licensed under the Apache License Version 2.0, so I don't think it'd be a big issue.) http://jetty.mortbay.org/ Dave On Tue, Jun 21, 2005 at 10:41:45PM +0300, Mitz Pettel wrote:
I have encountered a bug that occurs on a certain page only sometimes and only when it's loaded via HTTP (i.e. not when opened as a webarchive). It looks like the bug occurs only when relayouting occurs when the HTML is not fully loaded (or perhaps when images are loaded after the page HTML has been loaded). I'm afraid I don't know much more than that about the exact conditions.
Do you know of any techniques that will allow me to reproduce those conditions without relying on that specific page and on the server it's coming from?
Thanks, -- Mitz Pettel
participants (4)
-
David Hyatt
-
ddkilzer@kilzer.net
-
Maciej Stachowiak
-
Mitz Pettel