diff options
author | Anthony Ramine <nox@nox.paris> | 2020-03-27 17:04:48 +0100 |
---|---|---|
committer | Anthony Ramine <nox@nox.paris> | 2020-03-28 15:37:56 +0100 |
commit | 60ca98b753570ce4ce56bc92ddbdd3c0c0e5800d (patch) | |
tree | 67b85630a50c9b5e6ef95234a18b968ee738409e /components/layout_thread/lib.rs | |
parent | 400c7012b1fe73a2cf23653e4813b0f80181d069 (diff) | |
download | servo-60ca98b753570ce4ce56bc92ddbdd3c0c0e5800d.tar.gz servo-60ca98b753570ce4ce56bc92ddbdd3c0c0e5800d.zip |
Pass pending restyles instead of draining them from layout
Diffstat (limited to 'components/layout_thread/lib.rs')
-rw-r--r-- | components/layout_thread/lib.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 8029e5ed751..54f1ec8d656 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -1450,17 +1450,19 @@ impl LayoutThread { guards.author.clone(), ); - let restyles = document.drain_pending_restyles(); + let restyles = std::mem::take(&mut data.pending_restyles); debug!("Draining restyles: {}", restyles.len()); let mut map = SnapshotMap::new(); let elements_with_snapshot: Vec<_> = restyles .iter() .filter(|r| r.1.snapshot.is_some()) - .map(|r| r.0) + .map(|r| unsafe { ServoLayoutNode::new(&r.0).as_element().unwrap() }) .collect(); for (el, restyle) in restyles { + let el = unsafe { ServoLayoutNode::new(&el).as_element().unwrap() }; + // Propagate the descendant bit up the ancestors. Do this before // the restyle calculation so that we can also do it for new // unstyled nodes, which the descendants bit helps us find. |