mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #17063 - emilio:pres-hints-sharing, r=bholley
style: Allow sharing styles across elements with presentational hints. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17063) <!-- Reviewable:end -->
This commit is contained in:
commit
38a6a3bff6
9 changed files with 318 additions and 182 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