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. I am asking because I'd like to patch Dillo to add @import-ed stylesheets to the browser window popup menu, just as it already does for <link>-ed stylesheets. At the moment this causes all sorts of code branches (is the @import in a <link>-ed file or an embedded <style>, if the latter, is it in the <head> or not). It would be much simpler to just immediately load every style file at the same time as it is added to html->ccsUrls , but that would change the behaviour to load <link>-ed styles immediately instead of at the end of the <head> element. Would that break anything? Regards, Jeremy Henty
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.
I am asking because I'd like to patch Dillo to add @import-ed stylesheets to the browser window popup menu, just as it already does for <link>-ed stylesheets. At the moment this causes all sorts of code branches (is the @import in a <link>-ed file or an embedded <style>, if the latter, is it in the <head> or not). It would be much simpler to just immediately load every style file at the same time as it is added to html->ccsUrls , but that would change the behaviour to load <link>-ed styles immediately instead of at the end of the <head> element. Would that break anything?
It looks like it dates to http://lists.auriga.wearlab.de/pipermail/dillo-dev/2009-February/005870.html
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.) Regards, Jeremy Henty
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. Cheers, Johannes
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.)
On Sun, Nov 15, 2009 at 05:55:11PM +0000, corvid wrote:
Jeremy wrote:
On Sat, Nov 14, 2009 at 03:42:00PM +0000, corvid wrote:
Speaking of repush, I see that there's another bug about auth and segfaults in the bug tracker.
Which one?
928
Ouch! Unfortunately this report doesn't give us much to work on. I just reran all my auth tests and they still work. Without a specific page to debug there's not much I can do. Any ideas? Could the fact that the page uses frames have anything to do with the problem? Regards, Jeremy Henty
Jeremy wrote:
On Sun, Nov 15, 2009 at 05:55:11PM +0000, corvid wrote:
Jeremy wrote:
On Sat, Nov 14, 2009 at 03:42:00PM +0000, corvid wrote:
Speaking of repush, I see that there's another bug about auth and segfaults in the bug tracker.
Which one?
928
Ouch! Unfortunately this report doesn't give us much to work on. I just reran all my auth tests and they still work. Without a specific page to debug there's not much I can do. Any ideas? Could the fact that the page uses frames have anything to do with the problem?
It looks like a_Nav_cancel_expect() and a NULL bw is what caused the old crash, so maybe it's actually a similar problem of using stylesheets/images outside the auth domain. http://lists.auriga.wearlab.de/pipermail/dillo-dev/2009-April/006248.html
participants (3)
-
corvid@lavabit.com
-
Johannes.Hofmann@gmx.de
-
onepoint@starurchin.org