aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread/lib.rs
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-03-28 13:37:31 -0400
committerGitHub <noreply@github.com>2020-03-28 13:37:31 -0400
commit15d8c6058bb5fd21036cb35500a0c2f23a9ef7f7 (patch)
treefde1850c9fe7f9050d0342a7c01f76f39985040f /components/layout_thread/lib.rs
parente69de9bc9cf5cdd29d1c392c613bc1c1ad4815bf (diff)
parentdba6a635e5df980b2837495aae59711739c23716 (diff)
downloadservo-15d8c6058bb5fd21036cb35500a0c2f23a9ef7f7.tar.gz
servo-15d8c6058bb5fd21036cb35500a0c2f23a9ef7f7.zip
Auto merge of #26048 - nox:layout-2020-transparent-data, r=jdm
Give a lifetime parameter to LayoutDom
Diffstat (limited to 'components/layout_thread/lib.rs')
-rw-r--r--components/layout_thread/lib.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index 60710009ff5..54f1ec8d656 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -1039,7 +1039,7 @@ impl LayoutThread {
self.stylist.set_quirks_mode(quirks_mode);
}
- fn try_get_layout_root<N: LayoutNode>(&self, node: N) -> Option<FlowRef> {
+ fn try_get_layout_root<'dom>(&self, node: impl LayoutNode<'dom>) -> Option<FlowRef> {
let result = node.mutate_layout_data()?.flow_construction_result.get();
let mut flow = match result {
@@ -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.