style: Make sure to consume the flusher when we hit the cascade data cache

So that sheets are properly marked as committed. The issue is that we
have this "committed" optimization, to avoid doing work if somebody adds
and removes an stylesheet without us flushing in the meantime:

  https://searchfox.org/mozilla-central/rev/f018480dfed4fc583703a5770a6db9ab9dc0fb99/servo/components/style/stylesheet_set.rs#308-319

The "committed" bit is set when we consume the flusher (in each(..)).

However when we hit the cache, before this patch, we wouldn't consume
it, which means that we may fail to do some full rebuilds even though we
need them.

Fix it by making sure we call each() in that case.

We add a test (the test would show a red square before this patch, and a
lime square with the fix).

Differential Revision: https://phabricator.services.mozilla.com/D113206
This commit is contained in:
Oriol Brufau 2023-05-17 00:36:44 +02:00
parent 90781493fc
commit fb9d8ddc73

View file

@ -138,6 +138,9 @@ where
debug!(" > {:?}", sheet);
}
}
// The line below ensures the "committed" bit is updated properly
// below.
collection.each(|_, _| true);
return Ok(Some(entry.clone()));
}