Hi Jeremy, On Sun, Sep 05, 2010 at 12:52:02PM +0100, Jeremy Henty wrote:
The problem is that Html_tag_open_pre() does not call html->styleEngine->inheritBackgroundColor() before calling HT2TB(html)->addParbreak(). But several other Html_tag_open_*() functions have the same problem, eg. Html_tag_open_{dt,dl}(). Should we fix them one by one or is there a better way?
Correct. All Html_tag_open_*() functions that don't add a widget (e.g. a textblock or an image) must call html->styleEngine->inheritBackgroundColor() to make background-color work. Unfortunately this is just a hack that doesn't solve all problems. E.g. <pre style="border: 1px solid black">foo</pre> will still not work. For now, I would just add inheritBackgroundColor() where necessary.
Also, I wonder if more of the Html_tag_open_*() functions should call html->styleEngine->setNonCssHints(), but I don't understand the CSS engine well enough to be sure.
setNonCssHints() in contrast is not a hack :-) It is used to pass style information from (deprecated) non-CSS HTML attributes like bgColor, align and so on to StyleEngine. This style information from HTML attributes has to be handled specially as described in http://www.w3.org/TR/CSS2/cascade.html#preshint So for all HTML-attributes that we want to support and that change the style there should be a corresponding setNonCssHints() call. Regards, Johannes