Johannes wrote:
On Sat, Nov 14, 2009 at 10:16:07AM +0000, Jeremy Henty wrote:
On Fri, Nov 13, 2009 at 08:05:05AM +0000, corvid wrote:
Jeremy wrote:
Why do we defer loading the CSS stylesheets named in <link> elements until the <head> element is closed? In html.cc, Html_tag_close_head() has the comment "charset is already set, load remote stylesheets now", but I don't understand the significance of the charset.
[...]
It looks like it dates to http://lists.auriga.wearlab.de/pipermail/dillo-dev/2009-February/005870.html
Yuk! So what should we do if the <head> includes a <style> element that @imports a style sheet? Defer loading that stylesheet until the end of the <head>? Maybe defer parsing the entire <style> element? Shouldn't we treat all the style information in the same way? It seems to me that currently we don't. (Mind you, I'm not familiar with these charset and reepush issues so I'm probably missing something.)
I don't remember all the details, but the basic idea is to defer the repush (not the loading), so we repush - and as a consequence redraw - the page just once. So in your example with an @import directive in the <style> element body, we would parse it if it is readily available in the cache. But if not, we continue rendering without it. Then, once <head> is closed and all requested style sheets are in cache, we repush the page and restart parsing from start. There is still a chance that during that repush we find a new style sheet to be loaded due to a @import in one of the style sheets we had not examined yet. That seems to be an inherent problem of the @import thing in general.
Speaking of repush, I see that there's another bug about auth and segfaults in the bug tracker. (At least the Tim crash had to do with repush, as I recall.)