Reap layout data whenever a node is removed from the tree.

Also introduce a clear() function to layout data which will be used to clear items such as compositor layouts.

Clear the layout data when a node becomes display:none.
This commit is contained in:
Glenn Watson 2015-02-27 16:29:02 +10:00
parent 8ad3c5aeb6
commit 611fd7a846
5 changed files with 35 additions and 40 deletions

View file

@ -1326,6 +1326,13 @@ impl<'ln> NodeUtils for ThreadSafeLayoutNode<'ln> {
let mut layout_data_ref = self.mutate_layout_data();
let layout_data = layout_data_ref.as_mut().expect("no layout data");
match result {
ConstructionResult::None => {
layout_data.clear();
}
_ => {}
}
let dst = self.get_construction_result(layout_data);
*dst = result;