premailer/css_parser

Specificity question

Closed this issue · 1 comments

Since

h1 { font-size: 5px; }
h2 { font-size: 5px; }

Is equivalent to

h1,h2 { font-size: 5px; }

Shouldn't the specificity be calculated per selector for the rule set rather than just set to 0 when given a compound selector?

I've implemented the change here, but one of the existing tests fail and I'd like your thoughts on this https://github.com/morten/css_parser/commit/cf8d82db6f94a873a7ec141071480bc875d43b4f

Defaulting to zero made sense to me at the time, but seeing your patch made me reconsider. I think what you've put together is a much more sane behaviour.