stylo: Sort entries in the rule hash by precedence and then do a merge during lookup

NEW
Unassigned

Status

()

Core
CSS Parsing and Computation
P4
normal
9 months ago
3 months ago

People

(Reporter: bholley, Unassigned)

Tracking

(Blocks: 1 bug)

unspecified
Points:
---

Firefox Tracking Flags

(firefox57 wontfix)

Details

(Reporter)

Description

9 months ago
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.
(Reporter)

Comment 2

9 months ago
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.