On Fri, Nov 26 2010, Lars Magne Ingebrigtsen wrote: >>> So you'd inherit down into the DOM and pop when you exit. However, >>> would that be correct? Er, no, not really. So you'd basically have the >>> inline thing, plus the stylesheet, but not endlessly combining inline >>> things. >> >> I am missing the why. :) > > Well, in this case, the colour renderer is interested in seeing what > background is, so it's (sort of) inherited downwards, while a border > setting is not. > > Perhaps we should just special-case the colour settings. I don't like special-case. I don't see why inheriting would not work with what you did propose. if its shr-descend call adds style information to the dynamic variable shr-stylesheet (and merge them of course), we're just having correct inheritance. With:

foo

bar

You start with the first style, render foo with background and foreground. Then you got for bar via shr-descend, which changes color to green, but merge with the previous dynamically bound shr-stylesheet, so it still has background set to 'blue'. You render bar, exit 2 shr-descend calls, and continue to render what else is in the document. If only I had more time I would try to implement something. :) -- Julien Danjou // ᐰ http://julien.danjou.info