mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Avoid some cfg checks in context.rs
This commit is contained in:
parent
10bd5636dc
commit
0adc02a317
3 changed files with 17 additions and 19 deletions
|
@ -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| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue