stylo: Complex selectors with multiple class selectors end up doing multiple FFI calls to get the class attr

NEW
Unassigned

Status

()

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

People

(Reporter: bz, Unassigned)

Tracking

(Blocks: 2 bugs, {perf})

53 Branch
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox57 wontfix)

Details

The way things are set up right now, each class selector causes a has_class call, which will go looking for the "class" attribute.  It sure would be nice if we either cached the result somewhere or coalesced multiple class simple selectors or something...

Gecko doesn't have this problem, since it automatically coalesces class simple selectors into a single call to GetClasses followed by work with the resulting list-or-atom.
Keywords: perf
One idea to fix this is using an `ElementMatchingContext` or something like that, and pass it down to the loop where we go through the selector sequence. Shouldn't be too hard I think.
Yeah seems like we should just use an LRU cache for id and class, and stick that on the existing MatchingContext;

Updated

9 months ago
Blocks: 1289864
Priority: -- → P4
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.