diff options
author | Ms2ger <Ms2ger@gmail.com> | 2015-12-30 14:59:11 +0100 |
---|---|---|
committer | Ms2ger <Ms2ger@gmail.com> | 2015-12-30 15:13:08 +0100 |
commit | 828392b41cc4cfc21ebc59702fad1778bede1fa9 (patch) | |
tree | 2a1ea316b7fdd2d7b5eb94bda717d51572037e75 /components/layout/layout_task.rs | |
parent | 3f407ea3d620e381b3adf6352cc09f9912db26b3 (diff) | |
download | servo-828392b41cc4cfc21ebc59702fad1778bede1fa9.tar.gz servo-828392b41cc4cfc21ebc59702fad1778bede1fa9.zip |
Don't copy the list of stylesheets in LayoutTask::handle_reflow.
It would be nice to avoid exposing the fact that these are stored in an Arc
to the selector matching code.
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r-- | components/layout/layout_task.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 87f34ce2a8c..da3b7518f3f 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -954,9 +954,6 @@ impl LayoutTask { node.dump(); } - let stylesheets: Vec<&Stylesheet> = data.document_stylesheets.iter().map(|entry| &**entry) - .collect(); - let stylesheets_changed = data.stylesheets_changed; let initial_viewport = data.window_size.initial_viewport; let old_viewport_size = self.viewport_size; let current_screen_size = Size2D::new(Au::from_f32_px(initial_viewport.width.get()), @@ -964,7 +961,7 @@ impl LayoutTask { // Calculate the actual viewport as per DEVICE-ADAPT § 6 let device = Device::new(MediaType::Screen, initial_viewport); - rw_data.stylist.set_device(device, &stylesheets); + rw_data.stylist.set_device(device, &data.document_stylesheets); let constraints = rw_data.stylist.viewport_constraints().clone(); self.viewport_size = match constraints { @@ -990,7 +987,8 @@ impl LayoutTask { } // If the entire flow tree is invalid, then it will be reflowed anyhow. - let needs_dirtying = rw_data.stylist.update(&stylesheets, stylesheets_changed); + let needs_dirtying = rw_data.stylist.update(&data.document_stylesheets, + data.stylesheets_changed); let needs_reflow = viewport_size_changed && !needs_dirtying; unsafe { if needs_dirtying { |