mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Animation: Aggregate Animated Image Info to Document (#36141)
Signed-off-by: rayguo17 <rayguo17@gmail.com>
This commit is contained in:
parent
53f7c7b1de
commit
ed3dd8fbe0
10 changed files with 145 additions and 9 deletions
|
@ -199,6 +199,7 @@ use crate::dom::xpathevaluator::XPathEvaluator;
|
|||
use crate::drag_data_store::{DragDataStore, Kind, Mode};
|
||||
use crate::fetch::FetchCanceller;
|
||||
use crate::iframe_collection::IFrameCollection;
|
||||
use crate::image_animation::ImageAnimationManager;
|
||||
use crate::messaging::{CommonScriptMsg, MainThreadScriptMsg};
|
||||
use crate::network_listener::{NetworkListener, PreInvoke};
|
||||
use crate::realms::{AlreadyInRealm, InRealm, enter_realm};
|
||||
|
@ -484,6 +485,8 @@ pub(crate) struct Document {
|
|||
animation_timeline: DomRefCell<AnimationTimeline>,
|
||||
/// Animations for this Document
|
||||
animations: DomRefCell<Animations>,
|
||||
/// Image Animation Manager for this Document
|
||||
image_animation_manager: DomRefCell<ImageAnimationManager>,
|
||||
/// The nearest inclusive ancestors to all the nodes that require a restyle.
|
||||
dirty_root: MutNullableDom<Element>,
|
||||
/// <https://html.spec.whatwg.org/multipage/#will-declaratively-refresh>
|
||||
|
@ -3877,6 +3880,7 @@ impl Document {
|
|||
DomRefCell::new(AnimationTimeline::new())
|
||||
},
|
||||
animations: DomRefCell::new(Animations::new()),
|
||||
image_animation_manager: DomRefCell::new(ImageAnimationManager::new()),
|
||||
dirty_root: Default::default(),
|
||||
declarative_refresh: Default::default(),
|
||||
pending_animation_ticks: Default::default(),
|
||||
|
@ -4715,6 +4719,13 @@ impl Document {
|
|||
self.animations().send_pending_events(self.window(), can_gc);
|
||||
}
|
||||
|
||||
pub(crate) fn image_animation_manager(&self) -> Ref<ImageAnimationManager> {
|
||||
self.image_animation_manager.borrow()
|
||||
}
|
||||
pub(crate) fn image_animation_manager_mut(&self) -> RefMut<ImageAnimationManager> {
|
||||
self.image_animation_manager.borrow_mut()
|
||||
}
|
||||
|
||||
pub(crate) fn will_declaratively_refresh(&self) -> bool {
|
||||
self.declarative_refresh.borrow().is_some()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue