radkovo/jStyleParser — pull request #9 by hrj (2014-12-11 19:04:49+00:00)
Title: Priority and Counter less. Fix for issue #60

Note, this PR sits on top of PR #8

We were encountering issue #60 whenever the CSS parsing order was different from the document order. jStyleParser was assigning priority during parsing to all rule-sets, in ascending order of parsing. This has multiple problems:

1. The parser was stateful.
2. The assumption of parsing order being same as document order is not always true.
3. Performance loss due to sorting of candidate rules-sets.

This PR is my attempt to fix the above three issues. I have completely removed the concept of priority and verified that all tests pass. The concept of priority based sorting is replaced by a single important change. Instead of using a regular `HashSet` to store candidates, I am using `LinkedHashSet`, which guarantees that candidates are unique, and also guarantees that their order of insertion is preserved.