mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
09c36de8f1
commit
fafc357308
3 changed files with 19 additions and 5 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue