style: Avoid some cfg checks in context.rs

This commit is contained in:
Emilio Cobos Álvarez 2017-05-29 23:24:06 +02:00
parent 10bd5636dc
commit 0adc02a317
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 17 additions and 19 deletions

View file

@ -6,13 +6,13 @@
use context::LayoutContext;
use flow::{self, Flow};
use fnv::FnvHashMap;
use gfx::display_list::OpaqueNode;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::PipelineId;
use opaque_node::OpaqueNodeMethods;
use script_traits::{AnimationState, ConstellationControlMsg, LayoutMsg as ConstellationMsg};
use script_traits::UntrustedNodeAddress;
use std::collections::HashMap;
use std::sync::mpsc::Receiver;
use style::animation::{Animation, update_style_for_animation};
use style::font_metrics::ServoMetricsProvider;
@ -24,8 +24,8 @@ use style::timer::Timer;
/// `expired_animations`.
pub fn update_animation_state(constellation_chan: &IpcSender<ConstellationMsg>,
script_chan: &IpcSender<ConstellationControlMsg>,
running_animations: &mut HashMap<OpaqueNode, Vec<Animation>>,
expired_animations: &mut HashMap<OpaqueNode, Vec<Animation>>,
running_animations: &mut FnvHashMap<OpaqueNode, Vec<Animation>>,
expired_animations: &mut FnvHashMap<OpaqueNode, Vec<Animation>>,
mut newly_transitioning_nodes: Option<&mut Vec<UntrustedNodeAddress>>,
new_animations_receiver: &Receiver<Animation>,
pipeline_id: PipelineId,
@ -149,7 +149,7 @@ pub fn update_animation_state(constellation_chan: &IpcSender<ConstellationMsg>,
// this should be made generic.
pub fn recalc_style_for_animations(context: &LayoutContext,
flow: &mut Flow,
animations: &HashMap<OpaqueNode,
animations: &FnvHashMap<OpaqueNode,
Vec<Animation>>) {
let mut damage = RestyleDamage::empty();
flow.mutate_fragments(&mut |fragment| {