alfa
alfa copied to clipboard
Investigate possibility of implementing style sharing
Servo has a pretty neat implementation of style sharing that we may, or may not, benefit from borrowing. See: https://github.com/servo/servo/wiki/styling-overview
Matching complex selector is bruteforce, creating needless work. For example, when matching a b c, we check for every b ancestor if an a ancestor exists, but if the closest b ancestor has none, then no other b ancestor can have an a ancestor… So we could bail out quicker.
Servo has this set of match failure that indicate where to restart the match. Relevant file, check notably this comment and the (likely) relevant code.