diff options
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r-- | components/layout/layout_task.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index fa42cb04f59..d6811617c0a 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -88,6 +88,10 @@ pub struct LayoutTaskData { /// The dirty rect. Used during display list construction. pub dirty: Rect<Au>, + + /// Starts at zero, and increased by one every time a layout completes. + /// This can be used to easily check for invalid stale data. + pub generation: uint, } /// Information needed by the layout task. @@ -413,6 +417,7 @@ impl LayoutTask { stylist: box Stylist::new(), parallel_traversal: parallel_traversal, dirty: Rect::zero(), + generation: 0, })), } } @@ -443,6 +448,7 @@ impl LayoutTask { reflow_root: OpaqueNodeMethods::from_layout_node(reflow_root), opts: self.opts.clone(), dirty: Rect::zero(), + generation: rw_data.generation, } } @@ -925,6 +931,8 @@ impl LayoutTask { layout_debug::end_trace(); } + rw_data.generation += 1; + // Tell script that we're done. // // FIXME(pcwalton): This should probably be *one* channel, but we can't fix this without |