Gecko does this, and per last night's discussion Servo should too, instead of sorting declarations after matching.
I should note that there is a possible downside here: addition/removal of rules/sheets (or modification of selectors once we have it) will need to rebuild the whole rulehash. But maybe we're already doing that anyway... For removals, we'd likely need to rebuild no matter what, but for additions we could just add the new stuff if it doesn't have to be stored sorted. Not opposed to doing this, just figured I'd point out the tradeoff.
I think we're doing it anyway. We could hypothetically do an insertion sort when adding if it were a win, but I don't think we optimize that case right now in either Gecko or Servo.
status-firefox57=wontfix unless someone thinks this bug should block 57
status-firefox57: --- → wontfix
You need to log in before you can comment on or make changes to this bug.