diff options
author | Clark Gaebel <cgaebel@mozilla.com> | 2014-09-17 15:36:50 -0700 |
---|---|---|
committer | Clark Gaebel <cgaebel@mozilla.com> | 2014-09-18 09:20:23 -0700 |
commit | 670ca9894e1ea433d9d487e39005601f12f435aa (patch) | |
tree | bdd22f8ae268323a59cfa97377852cc538a6043e /components/layout/layout_task.rs | |
parent | 1b251db7323dce3b7838709c7d2dfb685d8b24a9 (diff) | |
download | servo-670ca9894e1ea433d9d487e39005601f12f435aa.tar.gz servo-670ca9894e1ea433d9d487e39005601f12f435aa.zip |
Fixed #3386.
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 |