Fix broken viewport percentage length units after a viewport resize.

When a viewport is resized, the computed values for a style containing viewport percentage length units become stale. However, there's no way for those styles to be invalidated after a resize. As a solution, this commit invalidates the computed values cache after a resize has occurred, which is probably over-kill.

A better solution would probably be to track under what conditions computed values remain valid, and invalidate them as indicated.
This commit is contained in:
James Gilbertson 2015-03-07 23:16:30 -07:00
parent 09c36de8f1
commit fafc357308
3 changed files with 19 additions and 5 deletions

View file

@ -153,6 +153,10 @@ impl ApplicableDeclarationsCache {
fn insert(&mut self, declarations: Vec<DeclarationBlock>, style: Arc<ComputedValues>) {
self.cache.insert(ApplicableDeclarationsCacheEntry::new(declarations), style)
}
pub fn evict_all(&mut self) {
self.cache.evict_all();
}
}
/// An LRU cache of the last few nodes seen, so that we can aggressively try to reuse their styles.