diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index aa93b38fd45..adf47842e82 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -451,7 +451,7 @@ impl<'le> TElement for ServoLayoutElement<'le> { self.element.has_selector_flags(flags) } - fn update_animations(&self, _pseudo: Option<&PseudoElement>) { + fn has_animations(&self, _pseudo: Option<&PseudoElement>) -> bool { panic!("this should be only called on gecko"); } diff --git a/components/style/build_gecko.rs b/components/style/build_gecko.rs index b485efa48ee..39a7afeb44e 100644 --- a/components/style/build_gecko.rs +++ b/components/style/build_gecko.rs @@ -282,7 +282,8 @@ mod bindings { .raw_line("use data::ElementData;") .hide_type("nsString") .bitfield_enum("nsChangeHint") - .bitfield_enum("nsRestyleHint"); + .bitfield_enum("nsRestyleHint") + .constified_enum("UpdateAnimationsTasks"); let whitelist_vars = [ "NS_THEME_.*", "NODE_.*", @@ -306,6 +307,7 @@ mod bindings { "mozilla::TraversalRootBehavior", "mozilla::StyleShapeRadius", "mozilla::StyleGrid.*", + "mozilla::UpdateAnimationsTasks", "mozilla::LookAndFeel", ".*ThreadSafe.*Holder", "AnonymousContent", @@ -667,6 +669,7 @@ mod bindings { "Loader", "ServoStyleSheet", "EffectCompositor_CascadeLevel", + "UpdateAnimationsTasks", ]; struct ArrayType { cpp_type: &'static str, diff --git a/components/style/context.rs b/components/style/context.rs index 27943243ddf..c0ded1483ce 100644 --- a/components/style/context.rs +++ b/components/style/context.rs @@ -12,9 +12,10 @@ use data::ElementData; use dom::{OpaqueNode, TNode, TElement, SendElement}; use error_reporting::ParseErrorReporter; use euclid::Size2D; +#[cfg(feature = "gecko")] use gecko_bindings::structs; use matching::StyleSharingCandidateCache; use parking_lot::RwLock; -use selector_parser::PseudoElement; +#[cfg(feature = "gecko")] use selector_parser::PseudoElement; use selectors::matching::ElementSelectorFlags; use servo_config::opts; use shared_lock::StylesheetGuards; @@ -194,6 +195,22 @@ impl TraversalStatistics { } } +#[cfg(feature = "gecko")] +bitflags! { + /// Represents which tasks are performed in a SequentialTask of UpdateAnimations. + pub flags UpdateAnimationsTasks: u8 { + /// Update CSS Animations. + const CSS_ANIMATIONS = structs::UpdateAnimationsTasks_CSSAnimations, + /// Update CSS Transitions. + const CSS_TRANSITIONS = structs::UpdateAnimationsTasks_CSSTransitions, + /// Update effect properties. + const EFFECT_PROPERTIES = structs::UpdateAnimationsTasks_EffectProperties, + /// Update animation cacade results for animations running on the compositor. + const CASCADE_RESULTS = structs::UpdateAnimationsTasks_CascadeResults, + } +} + + /// A task to be run in sequential mode on the parent (non-worker) thread. This /// is used by the style system to queue up work which is not safe to do during /// the parallel traversal. @@ -202,9 +219,10 @@ pub enum SequentialTask { /// element that we don't have exclusive access to (i.e. the parent). SetSelectorFlags(SendElement, ElementSelectorFlags), - /// Marks that we need to create/remove/update CSS animations after the - /// first traversal. - UpdateAnimations(SendElement, Option), + #[cfg(feature = "gecko")] + /// Marks that we need to update CSS animations, update effect properties of + /// any type of animations after the normal traversal. + UpdateAnimations(SendElement, Option, UpdateAnimationsTasks), } impl SequentialTask { @@ -216,8 +234,9 @@ impl SequentialTask { SetSelectorFlags(el, flags) => { unsafe { el.set_selector_flags(flags) }; } - UpdateAnimations(el, pseudo) => { - unsafe { el.update_animations(pseudo.as_ref()) }; + #[cfg(feature = "gecko")] + UpdateAnimations(el, pseudo, tasks) => { + unsafe { el.update_animations(pseudo.as_ref(), tasks) }; } } } @@ -228,10 +247,12 @@ impl SequentialTask { SetSelectorFlags(unsafe { SendElement::new(el) }, flags) } - /// Creates a task to update CSS Animations on a given (pseudo-)element. - pub fn update_animations(el: E, pseudo: Option) -> Self { + #[cfg(feature = "gecko")] + /// Creates a task to update various animation state on a given (pseudo-)element. + pub fn update_animations(el: E, pseudo: Option, + tasks: UpdateAnimationsTasks) -> Self { use self::SequentialTask::*; - UpdateAnimations(unsafe { SendElement::new(el) }, pseudo) + UpdateAnimations(unsafe { SendElement::new(el) }, pseudo, tasks) } } diff --git a/components/style/dom.rs b/components/style/dom.rs index cf64e2da6b8..9d25013b15e 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -9,6 +9,7 @@ use {Atom, Namespace, LocalName}; use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut}; +#[cfg(feature = "gecko")] use context::UpdateAnimationsTasks; use data::ElementData; use element_state::ElementState; use properties::{ComputedValues, PropertyDeclarationBlock}; @@ -366,9 +367,15 @@ pub trait TElement : PartialEq + Debug + Sized + Copy + Clone + ElementExt + Pre /// Returns true if the element has all the specified selector flags. fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool; - /// Creates a task to update CSS Animations on a given (pseudo-)element. - /// Note: Gecko only. - fn update_animations(&self, _pseudo: Option<&PseudoElement>); + /// Creates a task to update various animation state on a given (pseudo-)element. + #[cfg(feature = "gecko")] + fn update_animations(&self, _pseudo: Option<&PseudoElement>, + tasks: UpdateAnimationsTasks); + + /// Returns true if the element has relevant animations. Relevant + /// animations are those animations that are affecting the element's style + /// or are scheduled to do so in the future. + fn has_animations(&self, _pseudo: Option<&PseudoElement>) -> bool; /// Returns true if the element has a CSS animation. fn has_css_animations(&self, _pseudo: Option<&PseudoElement>) -> bool; diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 3b0c5bf6cdb..fe11fb7ff10 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -15,6 +15,7 @@ //! the separation between the style system implementation and everything else. use atomic_refcell::AtomicRefCell; +use context::UpdateAnimationsTasks; use data::ElementData; use dom::{AnimationRules, LayoutIterator, NodeInfo, TElement, TNode, UnsafeNode}; use dom::{OpaqueNode, PresentationalHintsSynthetizer}; @@ -30,6 +31,7 @@ use gecko_bindings::bindings::{Gecko_IsLink, Gecko_IsRootElement, Gecko_MatchesE use gecko_bindings::bindings::{Gecko_IsUnvisitedLink, Gecko_IsVisitedLink, Gecko_Namespace}; use gecko_bindings::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags}; use gecko_bindings::bindings::Gecko_ClassOrClassList; +use gecko_bindings::bindings::Gecko_ElementHasAnimations; use gecko_bindings::bindings::Gecko_ElementHasCSSAnimations; use gecko_bindings::bindings::Gecko_GetAnimationRule; use gecko_bindings::bindings::Gecko_GetHTMLPresentationAttrDeclarationBlock; @@ -554,7 +556,8 @@ impl<'le> TElement for GeckoElement<'le> { (self.flags() & node_flags) == node_flags } - fn update_animations(&self, pseudo: Option<&PseudoElement>) { + fn update_animations(&self, pseudo: Option<&PseudoElement>, + tasks: UpdateAnimationsTasks) { // We have to update animations even if the element has no computed style // since it means the element is in a display:none subtree, we should destroy // all CSS animations in display:none subtree. @@ -583,10 +586,16 @@ impl<'le> TElement for GeckoElement<'le> { unsafe { Gecko_UpdateAnimations(self.0, atom_ptr, computed_values_opt, - parent_values_opt); + parent_values_opt, + tasks.bits()); } } + fn has_animations(&self, pseudo: Option<&PseudoElement>) -> bool { + let atom_ptr = PseudoElement::ns_atom_or_null_from_opt(pseudo); + unsafe { Gecko_ElementHasAnimations(self.0, atom_ptr) } + } + fn has_css_animations(&self, pseudo: Option<&PseudoElement>) -> bool { let atom_ptr = PseudoElement::ns_atom_or_null_from_opt(pseudo); unsafe { Gecko_ElementHasCSSAnimations(self.0, atom_ptr) } diff --git a/components/style/gecko_bindings/bindings.rs b/components/style/gecko_bindings/bindings.rs index 75af7928a7f..dd5196defa6 100644 --- a/components/style/gecko_bindings/bindings.rs +++ b/components/style/gecko_bindings/bindings.rs @@ -176,6 +176,7 @@ use gecko_bindings::structs::nsresult; use gecko_bindings::structs::Loader; use gecko_bindings::structs::ServoStyleSheet; use gecko_bindings::structs::EffectCompositor_CascadeLevel; +use gecko_bindings::structs::UpdateAnimationsTasks; pub type nsTArrayBorrowed_uintptr_t<'a> = &'a mut ::gecko_bindings::structs::nsTArray; pub type ServoCssRulesStrong = ::gecko_bindings::sugar::ownership::Strong; pub type ServoCssRulesBorrowed<'a> = &'a ServoCssRules; @@ -610,7 +611,12 @@ extern "C" { aComputedValues: ServoComputedValuesBorrowedOrNull, aParentComputedValues: - ServoComputedValuesBorrowedOrNull); + ServoComputedValuesBorrowedOrNull, + aTaskBits: UpdateAnimationsTasks); +} +extern "C" { + pub fn Gecko_ElementHasAnimations(aElement: RawGeckoElementBorrowed, + aPseudoTagOrNull: *mut nsIAtom) -> bool; } extern "C" { pub fn Gecko_ElementHasCSSAnimations(aElement: RawGeckoElementBorrowed, diff --git a/components/style/gecko_bindings/structs_debug.rs b/components/style/gecko_bindings/structs_debug.rs index 99a64649299..8e9f8e850f1 100644 --- a/components/style/gecko_bindings/structs_debug.rs +++ b/components/style/gecko_bindings/structs_debug.rs @@ -6151,6 +6151,19 @@ pub mod root { Normal = 0, UnstyledChildrenOnly = 1, } + pub const UpdateAnimationsTasks_CSSAnimations: + root::mozilla::UpdateAnimationsTasks = + 1; + pub const UpdateAnimationsTasks_CSSTransitions: + root::mozilla::UpdateAnimationsTasks = + 2; + pub const UpdateAnimationsTasks_EffectProperties: + root::mozilla::UpdateAnimationsTasks = + 4; + pub const UpdateAnimationsTasks_CascadeResults: + root::mozilla::UpdateAnimationsTasks = + 8; + pub type UpdateAnimationsTasks = u8; pub type CSSPseudoElementTypeBase = u8; pub const CSSPseudoElementType_InheritingAnonBox: root::mozilla::CSSPseudoElementType = @@ -12679,7 +12692,9 @@ pub mod root { pub mInflationDisabledForShrinkWrap: bool, pub mContainer: u64, pub mBaseMinFontSize: i32, + pub mSystemFontScale: f32, pub mTextZoom: f32, + pub mEffectiveTextZoom: f32, pub mFullZoom: f32, pub mOverrideDPPX: f32, pub mLastFontInflationScreenSize: root::gfxSize, @@ -12856,7 +12871,7 @@ pub mod root { } #[test] fn bindgen_test_layout_nsPresContext() { - assert_eq!(::std::mem::size_of::() , 1312usize , concat + assert_eq!(::std::mem::size_of::() , 1320usize , concat ! ( "Size of: " , stringify ! ( nsPresContext ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsPresContext ) )); @@ -12963,280 +12978,291 @@ pub mod root { as * const _ as usize } , 168usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mBaseMinFontSize ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsPresContext ) ) . mSystemFontScale + as * const _ as usize } , 172usize , concat ! ( + "Alignment of field: " , stringify ! ( nsPresContext ) , + "::" , stringify ! ( mSystemFontScale ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mTextZoom as * - const _ as usize } , 172usize , concat ! ( + const _ as usize } , 176usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTextZoom ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsPresContext ) ) . + mEffectiveTextZoom as * const _ as usize } , 180usize , + concat ! ( + "Alignment of field: " , stringify ! ( nsPresContext ) , + "::" , stringify ! ( mEffectiveTextZoom ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFullZoom as * - const _ as usize } , 176usize , concat ! ( + const _ as usize } , 184usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFullZoom ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mOverrideDPPX as - * const _ as usize } , 180usize , concat ! ( + * const _ as usize } , 188usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mOverrideDPPX ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLastFontInflationScreenSize as * const _ as usize } , - 184usize , concat ! ( + 192usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLastFontInflationScreenSize ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mCurAppUnitsPerDevPixel as * const _ as usize } , 200usize + mCurAppUnitsPerDevPixel as * const _ as usize } , 208usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mCurAppUnitsPerDevPixel ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mAutoQualityMinFontSizePixelsPref as * const _ as usize } - , 204usize , concat ! ( + , 212usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mAutoQualityMinFontSizePixelsPref ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mTheme as * const - _ as usize } , 208usize , concat ! ( + _ as usize } , 216usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTheme ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLangService as * - const _ as usize } , 216usize , concat ! ( + const _ as usize } , 224usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLangService ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPrintSettings as - * const _ as usize } , 224usize , concat ! ( + * const _ as usize } , 232usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPrintSettings ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPrefChangedTimer - as * const _ as usize } , 232usize , concat ! ( + as * const _ as usize } , 240usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPrefChangedTimer ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPropertyTable as - * const _ as usize } , 240usize , concat ! ( + * const _ as usize } , 248usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPropertyTable ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mTransactions as - * const _ as usize } , 304usize , concat ! ( + * const _ as usize } , 312usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTransactions ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mTextPerf as * - const _ as usize } , 384usize , concat ! ( + const _ as usize } , 392usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTextPerf ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mMissingFonts as - * const _ as usize } , 392usize , concat ! ( + * const _ as usize } , 400usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mMissingFonts ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mVisibleArea as * - const _ as usize } , 400usize , concat ! ( + const _ as usize } , 408usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mVisibleArea ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPageSize as * - const _ as usize } , 416usize , concat ! ( + const _ as usize } , 424usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPageSize ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPageScale as * - const _ as usize } , 424usize , concat ! ( + const _ as usize } , 432usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPageScale ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPPScale as * - const _ as usize } , 428usize , concat ! ( + const _ as usize } , 436usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPPScale ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mDefaultColor as - * const _ as usize } , 432usize , concat ! ( + * const _ as usize } , 440usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mDefaultColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mBackgroundColor - as * const _ as usize } , 436usize , concat ! ( + as * const _ as usize } , 444usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mBackgroundColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLinkColor as * - const _ as usize } , 440usize , concat ! ( + const _ as usize } , 448usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLinkColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mActiveLinkColor - as * const _ as usize } , 444usize , concat ! ( + as * const _ as usize } , 452usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mActiveLinkColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mVisitedLinkColor - as * const _ as usize } , 448usize , concat ! ( + as * const _ as usize } , 456usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mVisitedLinkColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mFocusBackgroundColor as * const _ as usize } , 452usize , + mFocusBackgroundColor as * const _ as usize } , 460usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFocusBackgroundColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFocusTextColor - as * const _ as usize } , 456usize , concat ! ( + as * const _ as usize } , 464usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFocusTextColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mBodyTextColor as - * const _ as usize } , 460usize , concat ! ( + * const _ as usize } , 468usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mBodyTextColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mViewportStyleScrollbar as * const _ as usize } , 464usize + mViewportStyleScrollbar as * const _ as usize } , 472usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mViewportStyleScrollbar ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFocusRingWidth - as * const _ as usize } , 528usize , concat ! ( + as * const _ as usize } , 536usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFocusRingWidth ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mExistThrottledUpdates as * const _ as usize } , 529usize + mExistThrottledUpdates as * const _ as usize } , 537usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mExistThrottledUpdates ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mImageAnimationMode as * const _ as usize } , 530usize , + mImageAnimationMode as * const _ as usize } , 538usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mImageAnimationMode ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mImageAnimationModePref as * const _ as usize } , 532usize + mImageAnimationModePref as * const _ as usize } , 540usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mImageAnimationModePref ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mLangGroupFontPrefs as * const _ as usize } , 536usize , + mLangGroupFontPrefs as * const _ as usize } , 544usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLangGroupFontPrefs ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mBorderWidthTable - as * const _ as usize } , 1176usize , concat ! ( + as * const _ as usize } , 1184usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mBorderWidthTable ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mInterruptChecksToSkip as * const _ as usize } , 1188usize + mInterruptChecksToSkip as * const _ as usize } , 1196usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mInterruptChecksToSkip ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mElementsRestyled - as * const _ as usize } , 1192usize , concat ! ( + as * const _ as usize } , 1200usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mElementsRestyled ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mFramesConstructed as * const _ as usize } , 1200usize , + mFramesConstructed as * const _ as usize } , 1208usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFramesConstructed ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFramesReflowed - as * const _ as usize } , 1208usize , concat ! ( + as * const _ as usize } , 1216usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFramesReflowed ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mReflowStartTime - as * const _ as usize } , 1216usize , concat ! ( + as * const _ as usize } , 1224usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mReflowStartTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstNonBlankPaintTime as * const _ as usize } , - 1224usize , concat ! ( + 1232usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstNonBlankPaintTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstClickTime - as * const _ as usize } , 1232usize , concat ! ( + as * const _ as usize } , 1240usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstClickTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstKeyTime as - * const _ as usize } , 1240usize , concat ! ( + * const _ as usize } , 1248usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstKeyTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mFirstMouseMoveTime as * const _ as usize } , 1248usize , + mFirstMouseMoveTime as * const _ as usize } , 1256usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstMouseMoveTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstScrollTime - as * const _ as usize } , 1256usize , concat ! ( + as * const _ as usize } , 1264usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstScrollTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mInteractionTimeEnabled as * const _ as usize } , - 1264usize , concat ! ( + 1272usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mInteractionTimeEnabled ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLastStyleUpdateForAllAnimations as * const _ as usize } , - 1272usize , concat ! ( + 1280usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLastStyleUpdateForAllAnimations ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollLastY as * const _ as usize } , 1280usize + mTelemetryScrollLastY as * const _ as usize } , 1288usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollLastY ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollMaxY as * const _ as usize } , 1284usize , + mTelemetryScrollMaxY as * const _ as usize } , 1292usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollMaxY ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollTotalY as * const _ as usize } , 1288usize + mTelemetryScrollTotalY as * const _ as usize } , 1296usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollTotalY ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mRestyleLoggingEnabled as * const _ as usize } , 1298usize + mRestyleLoggingEnabled as * const _ as usize } , 1306usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mRestyleLoggingEnabled ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mInitialized as * - const _ as usize } , 1299usize , concat ! ( + const _ as usize } , 1307usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mInitialized ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLayoutPhaseCount - as * const _ as usize } , 1300usize , concat ! ( + as * const _ as usize } , 1308usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLayoutPhaseCount ) )); } @@ -15054,8 +15080,8 @@ pub mod root { pub mFontSizeInflationForceEnabled: bool, pub mFontSizeInflationDisabledInMasterProcess: bool, pub mFontSizeInflationEnabled: bool, - pub mPaintingIsFrozen: bool, pub mFontSizeInflationEnabledIsDirty: bool, + pub mPaintingIsFrozen: bool, pub mIsNeverPainting: bool, pub mInFlush: bool, } @@ -15538,18 +15564,18 @@ pub mod root { 430usize , concat ! ( "Alignment of field: " , stringify ! ( nsIPresShell ) , "::" , stringify ! ( mFontSizeInflationEnabled ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mPaintingIsFrozen - as * const _ as usize } , 431usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mPaintingIsFrozen ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsIPresShell ) ) . mFontSizeInflationEnabledIsDirty as * const _ as usize } , - 432usize , concat ! ( + 431usize , concat ! ( "Alignment of field: " , stringify ! ( nsIPresShell ) , "::" , stringify ! ( mFontSizeInflationEnabledIsDirty ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mPaintingIsFrozen + as * const _ as usize } , 432usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mPaintingIsFrozen ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsIPresShell ) ) . mIsNeverPainting as * const _ as usize } , 433usize , concat ! ( @@ -22314,7 +22340,7 @@ pub mod root { } #[test] fn bindgen_test_layout_nsRootPresContext() { - assert_eq!(::std::mem::size_of::() , 1472usize , + assert_eq!(::std::mem::size_of::() , 1480usize , concat ! ( "Size of: " , stringify ! ( nsRootPresContext ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -22322,37 +22348,37 @@ pub mod root { "Alignment of " , stringify ! ( nsRootPresContext ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mNotifyDidPaintTimers as * const _ as usize } , 1312usize + mNotifyDidPaintTimers as * const _ as usize } , 1320usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mNotifyDidPaintTimers ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . mApplyPluginGeometryTimer as * const _ as usize } , - 1392usize , concat ! ( + 1400usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mApplyPluginGeometryTimer ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mRegisteredPlugins as * const _ as usize } , 1400usize , + mRegisteredPlugins as * const _ as usize } , 1408usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mRegisteredPlugins ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mWillPaintObservers as * const _ as usize } , 1448usize , + mWillPaintObservers as * const _ as usize } , 1456usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mWillPaintObservers ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . mWillPaintFallbackEvent as * const _ as usize } , - 1456usize , concat ! ( + 1464usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mWillPaintFallbackEvent ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mDOMGeneration as * const _ as usize } , 1464usize , + mDOMGeneration as * const _ as usize } , 1472usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mDOMGeneration ) )); diff --git a/components/style/gecko_bindings/structs_release.rs b/components/style/gecko_bindings/structs_release.rs index 9ae2d19da52..4d1e510b6f7 100644 --- a/components/style/gecko_bindings/structs_release.rs +++ b/components/style/gecko_bindings/structs_release.rs @@ -6066,6 +6066,19 @@ pub mod root { Normal = 0, UnstyledChildrenOnly = 1, } + pub const UpdateAnimationsTasks_CSSAnimations: + root::mozilla::UpdateAnimationsTasks = + 1; + pub const UpdateAnimationsTasks_CSSTransitions: + root::mozilla::UpdateAnimationsTasks = + 2; + pub const UpdateAnimationsTasks_EffectProperties: + root::mozilla::UpdateAnimationsTasks = + 4; + pub const UpdateAnimationsTasks_CascadeResults: + root::mozilla::UpdateAnimationsTasks = + 8; + pub type UpdateAnimationsTasks = u8; pub type CSSPseudoElementTypeBase = u8; pub const CSSPseudoElementType_InheritingAnonBox: root::mozilla::CSSPseudoElementType = @@ -12214,7 +12227,9 @@ pub mod root { pub mInflationDisabledForShrinkWrap: bool, pub mContainer: u64, pub mBaseMinFontSize: i32, + pub mSystemFontScale: f32, pub mTextZoom: f32, + pub mEffectiveTextZoom: f32, pub mFullZoom: f32, pub mOverrideDPPX: f32, pub mLastFontInflationScreenSize: root::gfxSize, @@ -12389,7 +12404,7 @@ pub mod root { } #[test] fn bindgen_test_layout_nsPresContext() { - assert_eq!(::std::mem::size_of::() , 1288usize , concat + assert_eq!(::std::mem::size_of::() , 1296usize , concat ! ( "Size of: " , stringify ! ( nsPresContext ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsPresContext ) )); @@ -12491,263 +12506,274 @@ pub mod root { as * const _ as usize } , 160usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mBaseMinFontSize ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsPresContext ) ) . mSystemFontScale + as * const _ as usize } , 164usize , concat ! ( + "Alignment of field: " , stringify ! ( nsPresContext ) , + "::" , stringify ! ( mSystemFontScale ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mTextZoom as * - const _ as usize } , 164usize , concat ! ( + const _ as usize } , 168usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTextZoom ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsPresContext ) ) . + mEffectiveTextZoom as * const _ as usize } , 172usize , + concat ! ( + "Alignment of field: " , stringify ! ( nsPresContext ) , + "::" , stringify ! ( mEffectiveTextZoom ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFullZoom as * - const _ as usize } , 168usize , concat ! ( + const _ as usize } , 176usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFullZoom ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mOverrideDPPX as - * const _ as usize } , 172usize , concat ! ( + * const _ as usize } , 180usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mOverrideDPPX ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLastFontInflationScreenSize as * const _ as usize } , - 176usize , concat ! ( + 184usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLastFontInflationScreenSize ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mCurAppUnitsPerDevPixel as * const _ as usize } , 192usize + mCurAppUnitsPerDevPixel as * const _ as usize } , 200usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mCurAppUnitsPerDevPixel ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mAutoQualityMinFontSizePixelsPref as * const _ as usize } - , 196usize , concat ! ( + , 204usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mAutoQualityMinFontSizePixelsPref ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mTheme as * const - _ as usize } , 200usize , concat ! ( + _ as usize } , 208usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTheme ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLangService as * - const _ as usize } , 208usize , concat ! ( + const _ as usize } , 216usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLangService ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPrintSettings as - * const _ as usize } , 216usize , concat ! ( + * const _ as usize } , 224usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPrintSettings ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPrefChangedTimer - as * const _ as usize } , 224usize , concat ! ( + as * const _ as usize } , 232usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPrefChangedTimer ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPropertyTable as - * const _ as usize } , 232usize , concat ! ( + * const _ as usize } , 240usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPropertyTable ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mTransactions as - * const _ as usize } , 288usize , concat ! ( + * const _ as usize } , 296usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTransactions ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mTextPerf as * - const _ as usize } , 368usize , concat ! ( + const _ as usize } , 376usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTextPerf ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mMissingFonts as - * const _ as usize } , 376usize , concat ! ( + * const _ as usize } , 384usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mMissingFonts ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mVisibleArea as * - const _ as usize } , 384usize , concat ! ( + const _ as usize } , 392usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mVisibleArea ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPageSize as * - const _ as usize } , 400usize , concat ! ( + const _ as usize } , 408usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPageSize ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPageScale as * - const _ as usize } , 408usize , concat ! ( + const _ as usize } , 416usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPageScale ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mPPScale as * - const _ as usize } , 412usize , concat ! ( + const _ as usize } , 420usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mPPScale ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mDefaultColor as - * const _ as usize } , 416usize , concat ! ( + * const _ as usize } , 424usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mDefaultColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mBackgroundColor - as * const _ as usize } , 420usize , concat ! ( + as * const _ as usize } , 428usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mBackgroundColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLinkColor as * - const _ as usize } , 424usize , concat ! ( + const _ as usize } , 432usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLinkColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mActiveLinkColor - as * const _ as usize } , 428usize , concat ! ( + as * const _ as usize } , 436usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mActiveLinkColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mVisitedLinkColor - as * const _ as usize } , 432usize , concat ! ( + as * const _ as usize } , 440usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mVisitedLinkColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mFocusBackgroundColor as * const _ as usize } , 436usize , + mFocusBackgroundColor as * const _ as usize } , 444usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFocusBackgroundColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFocusTextColor - as * const _ as usize } , 440usize , concat ! ( + as * const _ as usize } , 448usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFocusTextColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mBodyTextColor as - * const _ as usize } , 444usize , concat ! ( + * const _ as usize } , 452usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mBodyTextColor ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mViewportStyleScrollbar as * const _ as usize } , 448usize + mViewportStyleScrollbar as * const _ as usize } , 456usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mViewportStyleScrollbar ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFocusRingWidth - as * const _ as usize } , 512usize , concat ! ( + as * const _ as usize } , 520usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFocusRingWidth ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mExistThrottledUpdates as * const _ as usize } , 513usize + mExistThrottledUpdates as * const _ as usize } , 521usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mExistThrottledUpdates ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mImageAnimationMode as * const _ as usize } , 514usize , + mImageAnimationMode as * const _ as usize } , 522usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mImageAnimationMode ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mImageAnimationModePref as * const _ as usize } , 516usize + mImageAnimationModePref as * const _ as usize } , 524usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mImageAnimationModePref ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mLangGroupFontPrefs as * const _ as usize } , 520usize , + mLangGroupFontPrefs as * const _ as usize } , 528usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLangGroupFontPrefs ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mBorderWidthTable - as * const _ as usize } , 1160usize , concat ! ( + as * const _ as usize } , 1168usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mBorderWidthTable ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mInterruptChecksToSkip as * const _ as usize } , 1172usize + mInterruptChecksToSkip as * const _ as usize } , 1180usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mInterruptChecksToSkip ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mElementsRestyled - as * const _ as usize } , 1176usize , concat ! ( + as * const _ as usize } , 1184usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mElementsRestyled ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mFramesConstructed as * const _ as usize } , 1184usize , + mFramesConstructed as * const _ as usize } , 1192usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFramesConstructed ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFramesReflowed - as * const _ as usize } , 1192usize , concat ! ( + as * const _ as usize } , 1200usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFramesReflowed ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mReflowStartTime - as * const _ as usize } , 1200usize , concat ! ( + as * const _ as usize } , 1208usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mReflowStartTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstNonBlankPaintTime as * const _ as usize } , - 1208usize , concat ! ( + 1216usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstNonBlankPaintTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstClickTime - as * const _ as usize } , 1216usize , concat ! ( + as * const _ as usize } , 1224usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstClickTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstKeyTime as - * const _ as usize } , 1224usize , concat ! ( + * const _ as usize } , 1232usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstKeyTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mFirstMouseMoveTime as * const _ as usize } , 1232usize , + mFirstMouseMoveTime as * const _ as usize } , 1240usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstMouseMoveTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mFirstScrollTime - as * const _ as usize } , 1240usize , concat ! ( + as * const _ as usize } , 1248usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mFirstScrollTime ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mInteractionTimeEnabled as * const _ as usize } , - 1248usize , concat ! ( + 1256usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mInteractionTimeEnabled ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . mLastStyleUpdateForAllAnimations as * const _ as usize } , - 1256usize , concat ! ( + 1264usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mLastStyleUpdateForAllAnimations ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollLastY as * const _ as usize } , 1264usize + mTelemetryScrollLastY as * const _ as usize } , 1272usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollLastY ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollMaxY as * const _ as usize } , 1268usize , + mTelemetryScrollMaxY as * const _ as usize } , 1276usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollMaxY ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsPresContext ) ) . - mTelemetryScrollTotalY as * const _ as usize } , 1272usize + mTelemetryScrollTotalY as * const _ as usize } , 1280usize , concat ! ( "Alignment of field: " , stringify ! ( nsPresContext ) , "::" , stringify ! ( mTelemetryScrollTotalY ) )); @@ -14520,8 +14546,8 @@ pub mod root { pub mFontSizeInflationForceEnabled: bool, pub mFontSizeInflationDisabledInMasterProcess: bool, pub mFontSizeInflationEnabled: bool, - pub mPaintingIsFrozen: bool, pub mFontSizeInflationEnabledIsDirty: bool, + pub mPaintingIsFrozen: bool, pub mIsNeverPainting: bool, pub mInFlush: bool, } @@ -14993,18 +15019,18 @@ pub mod root { 350usize , concat ! ( "Alignment of field: " , stringify ! ( nsIPresShell ) , "::" , stringify ! ( mFontSizeInflationEnabled ) )); - assert_eq! (unsafe { - & ( * ( 0 as * const nsIPresShell ) ) . mPaintingIsFrozen - as * const _ as usize } , 351usize , concat ! ( - "Alignment of field: " , stringify ! ( nsIPresShell ) , - "::" , stringify ! ( mPaintingIsFrozen ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsIPresShell ) ) . mFontSizeInflationEnabledIsDirty as * const _ as usize } , - 352usize , concat ! ( + 351usize , concat ! ( "Alignment of field: " , stringify ! ( nsIPresShell ) , "::" , stringify ! ( mFontSizeInflationEnabledIsDirty ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const nsIPresShell ) ) . mPaintingIsFrozen + as * const _ as usize } , 352usize , concat ! ( + "Alignment of field: " , stringify ! ( nsIPresShell ) , + "::" , stringify ! ( mPaintingIsFrozen ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsIPresShell ) ) . mIsNeverPainting as * const _ as usize } , 353usize , concat ! ( @@ -21688,7 +21714,7 @@ pub mod root { } #[test] fn bindgen_test_layout_nsRootPresContext() { - assert_eq!(::std::mem::size_of::() , 1440usize , + assert_eq!(::std::mem::size_of::() , 1448usize , concat ! ( "Size of: " , stringify ! ( nsRootPresContext ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -21696,37 +21722,37 @@ pub mod root { "Alignment of " , stringify ! ( nsRootPresContext ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mNotifyDidPaintTimers as * const _ as usize } , 1288usize + mNotifyDidPaintTimers as * const _ as usize } , 1296usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mNotifyDidPaintTimers ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . mApplyPluginGeometryTimer as * const _ as usize } , - 1368usize , concat ! ( + 1376usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mApplyPluginGeometryTimer ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mRegisteredPlugins as * const _ as usize } , 1376usize , + mRegisteredPlugins as * const _ as usize } , 1384usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mRegisteredPlugins ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mWillPaintObservers as * const _ as usize } , 1416usize , + mWillPaintObservers as * const _ as usize } , 1424usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mWillPaintObservers ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . mWillPaintFallbackEvent as * const _ as usize } , - 1424usize , concat ! ( + 1432usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mWillPaintFallbackEvent ) )); assert_eq! (unsafe { & ( * ( 0 as * const nsRootPresContext ) ) . - mDOMGeneration as * const _ as usize } , 1432usize , + mDOMGeneration as * const _ as usize } , 1440usize , concat ! ( "Alignment of field: " , stringify ! ( nsRootPresContext ) , "::" , stringify ! ( mDOMGeneration ) )); diff --git a/components/style/matching.rs b/components/style/matching.rs index c0eb82d9086..323561abca9 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -638,11 +638,15 @@ trait PrivateMatchMethods: TElement { new_values: &mut Arc, pseudo: Option<&PseudoElement>, _possibly_expired_animations: &mut Vec) { + use context::{CSS_ANIMATIONS, EFFECT_PROPERTIES}; + use context::UpdateAnimationsTasks; + let ref new_box_style = new_values.get_box(); let has_new_animation_style = new_box_style.animation_name_count() >= 1 && new_box_style.animation_name_at(0).0.len() != 0; let has_animations = self.has_css_animations(pseudo); + let mut tasks = UpdateAnimationsTasks::empty(); let needs_update_animations = old_values.as_ref().map_or(has_new_animation_style, |ref old| { let ref old_box_style = old.get_box(); @@ -658,8 +662,15 @@ trait PrivateMatchMethods: TElement { has_animations) }); if needs_update_animations { + tasks.insert(CSS_ANIMATIONS); + } + if self.has_animations(pseudo) { + tasks.insert(EFFECT_PROPERTIES); + } + if !tasks.is_empty() { let task = SequentialTask::update_animations(self.as_node().as_element().unwrap(), - pseudo.cloned()); + pseudo.cloned(), + tasks); context.thread_local.tasks.push(task); } }