tijsverkoyen/CssToInlineStyles — pull request #37 by lifo101 (2013-09-11 11:51:50+00:00)
Title: Fixed sortOnSpecifity sort order.

sortOnSpecifity is not actually sorting correctly. Your current sort routine produces something like this:

```
102: #pre-header > tr > td
100: #pre-header
101: #pre-header a
102: #header > tr > td
100: #content
100: #header
100: #main
13: table.box-contents tr > td
23: table.box-contents tr > td:nth-child(odd)
23: table.box-contents tr > td:nth-child(even)
100: #backgroundTable
112: #content div a:link
112: #content div a:visited
1: body
112: #footer td a .yshortcuts
10: .ReadMsgBody
10: .ExternalClass
```

The updated routine produces the correct result:
```
112: #content div a .yshortcuts
112: #content div a:link
112: #footer td a:link
112: #content div a:visited
112: #footer td a .yshortcuts
112: #footer td a:visited
102: #pre-header > tr > td
102: #header > tr > td
101: #footer td
101: #pre-header a
101: #content img
100: #header
100: #main
100: #pre-header
100: #content
100: #footer
100: #backgroundTable
```

Also note, there's no reason to have the validation check in your sort routine. It just slows it down. So I comment that out.