Undo #18497 in the MatchAndCascade case.

It's easy to construct examples where not inserting in those cases causes performance
to get worse (for example, any long list of siblings that match the same selectors
while having some non-effectual differences in LocalName/Class/Id/etc). And the LRU
nature of the cache already does the right thing of pruning non-useful entries.

Fixing this causes several hundred more sharing hits on wikipedia.

MozReview-Commit-ID: L7W8vcMnHaq
This commit is contained in:
Bobby Holley 2017-09-15 23:14:14 -07:00
parent fac923395e
commit 703a5c93d0
2 changed files with 23 additions and 11 deletions

View file

@ -554,11 +554,6 @@ impl<E: TElement> StyleSharingCache<E> {
validation_data_holder: Option<&mut StyleSharingTarget<E>>,
dom_depth: usize,
) {
if style.0.reused_via_rule_node {
debug!("Failing to insert into the cached: this was a cached style");
return;
}
let parent = match element.traversal_parent() {
Some(element) => element,
None => {