On Sun, Jan 18, 2009 at 09:37:45AM +0100, Hofmann Johannes wrote:
On Sat, Jan 17, 2009 at 11:39:04PM +0000, corvid wrote:
Johannes wrote:
On Sat, Jan 17, 2009 at 10:42:36PM +0000, corvid wrote:
Johannes wrote:
On Sat, Jan 17, 2009 at 07:17:53PM +0000, corvid wrote:
Johannes wrote: > On Sat, Jan 17, 2009 at 04:29:37PM +0000, corvid wrote: > > I wonder whether there's a way to specify something like > > code, tt, pre, samp, kbd {font-family: mono !important} > > * {font-family: sans !important} > > but have sans only for elements not otherwise specified. > > > > According to http://www.w3.org/TR/CSS21/cascade.html#specificity > the first rule should overrule the second one if it matches. > So this should work. > Note, that the specificity stuff is not fully implemented yet, but > it should be sufficient for the example above.
Does it work for you?
Yes, I tried:
code, tt, pre, samp, kbd {color: green !important} * {color: red !important}
on http://www.dillo.org/CSS.html and it seemed to work ok.
All red for me.
I tried reverting to the official tip, even I don't have anything much except forms code in my tree right now. Still all red.
How strange that we would see different behaviour here... I guess I'll have to dive into the code myself...
Please check again with attached patch.
It's working! Thanks! Excellent customer service :)
It's not the proper solution though. Here's the plan to apply rules according to http://www.w3.org/TR/CSS21/cascade.html#specificity:
* For each CssRule compute the specificity according to http://www.w3.org/TR/CSS21/cascade.html#specificity
* Store the rules in RuleList sorted by this specificity.
* In CssStyleSheet::apply() merge-sort the 4 ruleLists with potentially matching rules and apply them in the order given by their specificity.
If anyone feels like implementing it - go ahead :)
Just implemented that. Please test. Cheers, Johannes