mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Look at the snapshots when invalidating due to stylesheet changes.
Otherwise removal of stylesheets may get out of sync with other DOM changes, and we may fail to invalidate the style of the affected elements. Bug: 1432850 Reviewed-by: bz MozReview-Commit-ID: DrMTgLzQcnk
This commit is contained in:
parent
c2dfece49f
commit
657d8b8e31
8 changed files with 95 additions and 37 deletions
|
@ -15,6 +15,7 @@ use invalidation::media_queries::{MediaListKey, ToMediaListKey};
|
|||
use malloc_size_of::MallocSizeOfOps;
|
||||
use media_queries::{Device, MediaList};
|
||||
use properties::ComputedValues;
|
||||
use selector_parser::SnapshotMap;
|
||||
use servo_arc::Arc;
|
||||
use shared_lock::{Locked, StylesheetGuards, SharedRwLockReadGuard};
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
@ -202,6 +203,7 @@ impl PerDocumentStyleDataImpl {
|
|||
&mut self,
|
||||
guard: &SharedRwLockReadGuard,
|
||||
document_element: Option<E>,
|
||||
snapshots: Option<&SnapshotMap>,
|
||||
) -> bool
|
||||
where
|
||||
E: TElement,
|
||||
|
@ -209,6 +211,7 @@ impl PerDocumentStyleDataImpl {
|
|||
self.stylist.flush(
|
||||
&StylesheetGuards::same(guard),
|
||||
document_element,
|
||||
snapshots,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -193,7 +193,8 @@ impl ElementSnapshot for GeckoElementSnapshot {
|
|||
|
||||
#[inline]
|
||||
fn each_class<F>(&self, callback: F)
|
||||
where F: FnMut(&Atom)
|
||||
where
|
||||
F: FnMut(&Atom)
|
||||
{
|
||||
if !self.has_any(Flags::MaybeClass) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue