On Sat, Apr 04, 2009 at 03:19:06PM +0000, corvid wrote:
Johannes wrote:
for quite some while I've been trying to add support for the @import directive in CSS. The problem is that it creates a cyclic dependency between CssParser and DilloHtml: CssParser now calls a_Html_load_stylesheet().
This is extremely ugly and needs to be decoupled somehow.
Anyway, attached is what I currently have - cleanup ideas welcome.
Note, that we also need to use the URL of the current stylesheet to resolve relative URLs in @import. This is not implemented yet.
Good!
- Is strcat safe here?
Argh, no of course not. And I was wondering why dillo was crashing all the time :-)
- strcasecmp -> dStrcasecmp
Yes.
- needs a check for prefs.load_stylesheets
That should probabely go into a_Html_load_stylesheet().
- Can we get into loops if an imported stylesheet imports itself (directly or indirectly)
Yes, we need to detect such loops. Should be not too hard. But first I'd like to fix the cyclic dependency. Maybe we can move a_Html_load_stylesheet() from html.cc to some other place? Thanks for having a look! Johannes