milkshakesoftware/PreMailer.Net — pull request #21 by robcthegeek (2013-11-07 00:05:55+00:00)
Title: Add CSS Specificity Calc + Honor Specificity When Inlining

Hey @martinnormark,

I had a look through the code/links that you provided for in #20, but had the following thoughts/conclusions:
- v2 WIP branch has a lot of sweeping changes a huge chunks of code commented out. Trying to lay something over the top would mean looking at more than "this problem".
- I think your [CSS Selector](https://github.com/milkshakesoftware/PreMailer.Net/blob/2.0.0-wip/PreMailer.Net/PreMailer.Net/Parsing/SelectorParser.cs) is looking more robust, but I didn't want to merge all this in and risk causing conflicts etc. later.
- There's only one point where the specificity calculator I added is called, so it should only mean changing this one line when you merge your stuff in when 2.0 comes :smile:

So, I decided to cobble together a simple specificity calculator, and then merge the styles up based on this. In-line styles always take precedence. I know there's some rather large blocks of code that could use refactoring, but wanted to get your thoughts on this as it stands right now.