Commit graph

10 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
1cea4e7942
style: Use a SmallVec for common ancestors in the bloom filter. 2017-05-21 00:08:00 +02:00
Emilio Cobos Álvarez
4824f74a3f
style: Move some bloom filter code outside of matching.rs
Also simplify it, while we're at it.
2017-05-20 03:16:34 +02:00
Bobby Holley
3f52052cf9 Do the sequential traversal breadth-first.
While we're at it, we also eliminate the 'unknown' dom depth for the
bloom filter. Computing depth has negligible cost relative to the
amount of work we do setting up the bloom filter at a given depth.
Doing it once per traversal should be totally fine.

I originally separated the elimination of unknown dom depth from the
traversal changes, but I got bloom filter crashes on the intermediate
patch, presumably because I didn't properly fix the sequential traversal
for this case. Given that the final state is green, I just decided to
squash and move on.
2017-04-09 14:52:49 +08:00
Bobby Holley
e7a8f5ec30 Bug 1336646 - Use the bloom filter for manual style resolves and pass a mutable StyleContext into match_element. r=emilio
We need to do something here to avoid a double-borrow when passing a mutable
StyleContext to match_element. After some discussion on IRC, we decided that
building the bloom filter for this case is probably worthwhile.
2017-02-08 17:09:35 -08:00
Emilio Cobos Álvarez
30d010342a
style: Document the bloom filter. 2016-12-31 23:24:18 +01:00
Bobby Holley
b3cb786c81 Stop using UnsafeNode in the bloom filter. 2016-12-22 10:42:53 -08:00
Bobby Holley
b6e948dc5d Hoist bloom filter into scoped TLS and simplify code. 2016-12-22 10:42:53 -08:00
Cameron McCormack
68af62f15f Allow the style bloom filter to recover from switch to a node with no common ancestor with the old node. 2016-12-04 23:35:03 -10:00
Emilio Cobos Álvarez
e3a9637107
style: Don't pop too much in the bloom filter.
This is not a problem for Servo, because we recovered it without much problem a
few lines below, and we never reached the pathological case where the filter has
one element (the root), and we restyled another element with depth 1.

Fixes bug 1321725.
2016-12-02 12:29:25 +01:00
Emilio Cobos Álvarez
84a50ed5cb
style: Introduce StyleBloom
The idea is this will fix the bad behavior of the bloom filter in parallel
traversal.
2016-11-27 15:55:10 +01:00