Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed sortOnSpecifity sort order. #37

Merged
merged 1 commit into from
Apr 30, 2014

Conversation

lifo101
Copy link
Contributor

@lifo101 lifo101 commented Sep 11, 2013

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.

tijsverkoyen added a commit that referenced this pull request Apr 30, 2014
Fixed sortOnSpecifity sort order.
@tijsverkoyen tijsverkoyen merged commit 26534cb into tijsverkoyen:master Apr 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants