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

@ -6,7 +6,7 @@
//! interface helps reduce coupling between these two components, and enables
//! the DOM to be placed in a separate crate from layout.
use dom::node::LayoutDataRef;
use dom::node::LayoutData;
use geom::point::Point2D;
use geom::rect::Rect;
@ -41,7 +41,7 @@ pub enum Msg {
/// Destroys layout data associated with a DOM node.
///
/// TODO(pcwalton): Maybe think about batching to avoid message traffic.
ReapLayoutData(LayoutDataRef),
ReapLayoutData(LayoutData),
/// Requests that the layout task enter a quiescent state in which no more messages are
/// accepted except `ExitMsg`. A response message will be sent on the supplied channel when