From eb635113047aa1122dbc73622c5cd8665c71d5ac Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Mon, 10 Jul 2017 17:17:50 +0900 Subject: [PATCH 1/3] Do not fill computed values in missing keyframes for CSS animations during generating Keyframes --- ports/geckolib/glue.rs | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 50da9bd43ac..09199f6d93f 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -98,7 +98,7 @@ use style::properties::parse_one_declaration_into; use style::rule_tree::StyleSource; use style::selector_parser::PseudoElementCascadeType; use style::sequential; -use style::shared_lock::{SharedRwLock, SharedRwLockReadGuard, StylesheetGuards, ToCssWithGuard, Locked}; +use style::shared_lock::{SharedRwLockReadGuard, StylesheetGuards, ToCssWithGuard, Locked}; use style::string_cache::Atom; use style::style_adjuster::StyleAdjuster; use style::stylearc::Arc; @@ -2978,18 +2978,12 @@ pub extern "C" fn Servo_AssertTreeIsClean(root: RawGeckoElementBorrowed) { } fn append_computed_property_value(keyframe: *mut structs::Keyframe, - style: &ComputedValues, - property: &AnimatableLonghand, - shared_lock: &SharedRwLock) { - let block = style.to_declaration_block(property.clone().into()); + property: &AnimatableLonghand) { unsafe { let index = (*keyframe).mPropertyValues.len(); (*keyframe).mPropertyValues.set_len((index + 1) as u32); (*keyframe).mPropertyValues[index].mProperty = property.into(); - // FIXME. Bug 1360398: Do not set computed values once we handles - // missing keyframes with additive composition. - (*keyframe).mPropertyValues[index].mServoDeclarationBlock.set_arc_leaky( - Arc::new(shared_lock.wrap(block))); + (*keyframe).mPropertyValues[index].mServoDeclarationBlock.mRawPtr = ptr::null_mut(); } } @@ -3000,11 +2994,9 @@ enum Offset { fn fill_in_missing_keyframe_values(all_properties: &[AnimatableLonghand], timing_function: nsTimingFunctionBorrowed, - style: &ComputedValues, properties_set_at_offset: &LonghandIdSet, offset: Offset, - keyframes: RawGeckoKeyframeListBorrowedMut, - shared_lock: &SharedRwLock) { + keyframes: RawGeckoKeyframeListBorrowedMut) { let needs_filling = all_properties.iter().any(|ref property| { !properties_set_at_offset.has_animatable_longhand_bit(property) }); @@ -3026,10 +3018,7 @@ fn fill_in_missing_keyframe_values(all_properties: &[AnimatableLonghand], // Append properties that have not been set at this offset. for ref property in all_properties.iter() { if !properties_set_at_offset.has_animatable_longhand_bit(property) { - append_computed_property_value(keyframe, - style, - property, - shared_lock); + append_computed_property_value(keyframe, property); } } } @@ -3038,7 +3027,6 @@ fn fill_in_missing_keyframe_values(all_properties: &[AnimatableLonghand], pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetBorrowed, name: *const nsACString, inherited_timing_function: nsTimingFunctionBorrowed, - style: ServoComputedValuesBorrowed, keyframes: RawGeckoKeyframeListBorrowedMut) -> bool { debug_assert!(keyframes.len() == 0, "keyframes should be initially empty"); @@ -3051,7 +3039,6 @@ pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetB None => return false, }; - let style = ComputedValues::as_arc(&style); let global_style_data = &*GLOBAL_STYLE_DATA; let guard = global_style_data.shared_lock.read(); @@ -3094,10 +3081,7 @@ pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetB // animation should be set to the underlying computed value for // that keyframe. for property in animation.properties_changed.iter() { - append_computed_property_value(keyframe, - style, - property, - &global_style_data.shared_lock); + append_computed_property_value(keyframe, property); } if current_offset == 0.0 { has_complete_initial_keyframe = true; @@ -3150,20 +3134,16 @@ pub extern "C" fn Servo_StyleSet_GetKeyframesForName(raw_data: RawServoStyleSetB if !has_complete_initial_keyframe { fill_in_missing_keyframe_values(&animation.properties_changed, inherited_timing_function, - style, &properties_set_at_start, Offset::Zero, - keyframes, - &global_style_data.shared_lock); + keyframes); } if !has_complete_final_keyframe { fill_in_missing_keyframe_values(&animation.properties_changed, inherited_timing_function, - style, &properties_set_at_end, Offset::One, - keyframes, - &global_style_data.shared_lock); + keyframes); } true } From 4834162e4a2656ab0bc5fec2c4b1829c48e30943 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Mon, 10 Jul 2017 17:18:24 +0900 Subject: [PATCH 2/3] Pass null servo's computed values into ComputedKeyframeValues With this patch series, test_cssanimation_missing_keyframes.html can pass now. --- ports/geckolib/glue.rs | 54 ++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 09199f6d93f..fc4110626aa 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -2863,32 +2863,56 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeLis let mut seen = LonghandIdSet::new(); - // mServoDeclarationBlock is null in the case where we have an invalid css property. - let iter = keyframe.mPropertyValues.iter() - .filter(|&property| !property.mServoDeclarationBlock.mRawPtr.is_null()); + let iter = keyframe.mPropertyValues.iter(); let mut property_index = 0; for property in iter { if simulate_compute_values_failure(property) { continue; } + let mut maybe_append_animation_value = |property: AnimatableLonghand, + value: Option| { + if seen.has_animatable_longhand_bit(&property) { + return; + } + seen.set_animatable_longhand_bit(&property); + + // This is safe since we immediately write to the uninitialized values. + unsafe { animation_values.set_len((property_index + 1) as u32) }; + animation_values[property_index].mProperty = (&property).into(); + // We only make sure we have enough space for this variable, + // but didn't construct a default value for StyleAnimationValue, + // so we should zero it to avoid getting undefined behaviors. + animation_values[property_index].mValue.mGecko = unsafe { mem::zeroed() }; + match value { + Some(v) => { + animation_values[property_index].mValue.mServo.set_arc_leaky(Arc::new(v)); + }, + None => { + animation_values[property_index].mValue.mServo.mRawPtr = ptr::null_mut(); + }, + } + property_index += 1; + }; + + if property.mServoDeclarationBlock.mRawPtr.is_null() { + let animatable_longhand = + AnimatableLonghand::from_nscsspropertyid(property.mProperty); + // |keyframes.mPropertyValues| should only contain animatable + // properties, but we check the result from_nscsspropertyid + // just in case. + if let Some(property) = animatable_longhand { + maybe_append_animation_value(property, None); + } + continue; + } + let declarations = unsafe { &*property.mServoDeclarationBlock.mRawPtr.clone() }; let declarations = Locked::::as_arc(&declarations); let guard = declarations.read_with(&guard); for anim in guard.to_animation_value_iter(&mut context, &default_values) { - if !seen.has_animatable_longhand_bit(&anim.0) { - // This is safe since we immediately write to the uninitialized values. - unsafe { animation_values.set_len((property_index + 1) as u32) }; - seen.set_animatable_longhand_bit(&anim.0); - animation_values[property_index].mProperty = (&anim.0).into(); - // We only make sure we have enough space for this variable, - // but didn't construct a default value for StyleAnimationValue, - // so we should zero it to avoid getting undefined behaviors. - animation_values[property_index].mValue.mGecko = unsafe { mem::zeroed() }; - animation_values[property_index].mValue.mServo.set_arc_leaky(Arc::new(anim.1)); - property_index += 1; - } + maybe_append_animation_value(anim.0, Some(anim.1)); } } } From 1a5e1c625571070bfaa2c8bda639f14f71c10b93 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Mon, 10 Jul 2017 18:27:19 +0900 Subject: [PATCH 3/3] Update bindings. --- .../style/gecko/generated/atom_macro.rs | 8 ++ components/style/gecko/generated/bindings.rs | 12 ++- .../style/gecko/generated/structs_debug.rs | 95 +++++++++++-------- .../style/gecko/generated/structs_release.rs | 93 ++++++++++-------- 4 files changed, 131 insertions(+), 77 deletions(-) diff --git a/components/style/gecko/generated/atom_macro.rs b/components/style/gecko/generated/atom_macro.rs index e07376ccc74..03614e69502 100644 --- a/components/style/gecko/generated/atom_macro.rs +++ b/components/style/gecko/generated/atom_macro.rs @@ -184,6 +184,8 @@ cfg_if! { pub static nsGkAtoms_aria_checked: *mut nsIAtom; #[link_name = "_ZN9nsGkAtoms13aria_controlsE"] pub static nsGkAtoms_aria_controls: *mut nsIAtom; + #[link_name = "_ZN9nsGkAtoms12aria_currentE"] + pub static nsGkAtoms_aria_current: *mut nsIAtom; #[link_name = "_ZN9nsGkAtoms16aria_describedbyE"] pub static nsGkAtoms_aria_describedby: *mut nsIAtom; #[link_name = "_ZN9nsGkAtoms13aria_disabledE"] @@ -5309,6 +5311,8 @@ cfg_if! { pub static nsGkAtoms_aria_checked: *mut nsIAtom; #[link_name = "?aria_controls@nsGkAtoms@@2PEAVnsIAtom@@EA"] pub static nsGkAtoms_aria_controls: *mut nsIAtom; + #[link_name = "?aria_current@nsGkAtoms@@2PEAVnsIAtom@@EA"] + pub static nsGkAtoms_aria_current: *mut nsIAtom; #[link_name = "?aria_describedby@nsGkAtoms@@2PEAVnsIAtom@@EA"] pub static nsGkAtoms_aria_describedby: *mut nsIAtom; #[link_name = "?aria_disabled@nsGkAtoms@@2PEAVnsIAtom@@EA"] @@ -10434,6 +10438,8 @@ cfg_if! { pub static nsGkAtoms_aria_checked: *mut nsIAtom; #[link_name = "\x01?aria_controls@nsGkAtoms@@2PAVnsIAtom@@A"] pub static nsGkAtoms_aria_controls: *mut nsIAtom; + #[link_name = "\x01?aria_current@nsGkAtoms@@2PAVnsIAtom@@A"] + pub static nsGkAtoms_aria_current: *mut nsIAtom; #[link_name = "\x01?aria_describedby@nsGkAtoms@@2PAVnsIAtom@@A"] pub static nsGkAtoms_aria_describedby: *mut nsIAtom; #[link_name = "\x01?aria_disabled@nsGkAtoms@@2PAVnsIAtom@@A"] @@ -15562,6 +15568,8 @@ macro_rules! atom { { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_aria_checked as *mut _) } }; ("aria-controls") => { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_aria_controls as *mut _) } }; +("aria-current") => + { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_aria_current as *mut _) } }; ("aria-describedby") => { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_aria_describedby as *mut _) } }; ("aria-disabled") => diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index 3c01e452564..4d8a4767766 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -1934,8 +1934,6 @@ extern "C" { property: *const nsACString, timing_function: nsTimingFunctionBorrowed, - computed_values: - ServoComputedValuesBorrowed, keyframe_list: RawGeckoKeyframeListBorrowedMut) -> bool; @@ -2161,6 +2159,16 @@ extern "C" { pub fn Servo_StyleRule_GetSelectorCount(rule: RawServoStyleRuleBorrowed, count: *mut u32); } +extern "C" { + pub fn Servo_StyleRule_SelectorMatchesElement(arg1: + RawServoStyleRuleBorrowed, + arg2: + RawGeckoElementBorrowed, + index: u32, + pseudo_type: + CSSPseudoElementType) + -> bool; +} extern "C" { pub fn Servo_ImportRule_GetHref(rule: RawServoImportRuleBorrowed, result: *mut nsAString); diff --git a/components/style/gecko/generated/structs_debug.rs b/components/style/gecko/generated/structs_debug.rs index 0976ccd33d6..a8cbd1d1149 100644 --- a/components/style/gecko/generated/structs_debug.rs +++ b/components/style/gecko/generated/structs_debug.rs @@ -1500,7 +1500,7 @@ pub mod root { pub mod css { #[allow(unused_imports)] use self::super::super::super::root; - #[repr(u32)] + #[repr(u8)] /** * Enum defining the mode in which a sheet is to be parsed. This is * usually, but not always, the same as the cascade level at which the @@ -2408,7 +2408,6 @@ pub mod root { impl Clone for FontVariation { fn clone(&self) -> Self { *self } } - pub type Matrix4x4 = [u32; 16usize]; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ScaleFactor { @@ -2417,6 +2416,7 @@ pub mod root { #[derive(Debug, Copy, Clone)] pub struct ScaleFactors2D { } + pub type Matrix4x4 = [u32; 16usize]; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct SourceSurface { @@ -2476,7 +2476,6 @@ pub mod root { ePending = 2, eUserAction = 3, eRestore = 4, - eSentinel = 5, } extern "C" { #[link_name = @@ -2487,6 +2486,13 @@ pub mod root { pub const FrameMetrics_START_SCROLL_ID: root::mozilla::layers::FrameMetrics_ViewID = 2; + pub const FrameMetrics_sScrollOffsetUpdateTypeCount: usize = 5; + extern "C" { + #[link_name = + "_ZN7mozilla6layers12FrameMetrics30sHighestScrollOffsetUpdateTypeE"] + pub static FrameMetrics_sHighestScrollOffsetUpdateType: + root::mozilla::layers::FrameMetrics_ScrollOffsetUpdateType; + } #[test] fn bindgen_test_layout_FrameMetrics() { assert_eq!(::std::mem::size_of::() , 184usize , @@ -3317,7 +3323,6 @@ pub mod root { eNone = 0, eRefLayer = 1, eScrollLayer = 2, - eSentinel = 3, } #[repr(C)] #[derive(Debug, Copy)] @@ -3354,6 +3359,13 @@ pub mod root { impl Clone for FocusTarget_FocusTargetData { fn clone(&self) -> Self { *self } } + pub const FocusTarget_sFocusTargetTypeCount: usize = 3; + extern "C" { + #[link_name = + "_ZN7mozilla6layers11FocusTarget23sHighestFocusTargetTypeE"] + pub static FocusTarget_sHighestFocusTargetType: + root::mozilla::layers::FocusTarget_FocusTargetType; + } #[test] fn bindgen_test_layout_FocusTarget() { assert_eq!(::std::mem::size_of::() , 32usize , @@ -7130,10 +7142,11 @@ pub mod root { Content = 1, ContentAndNotify = 2, Style = 3, - InterruptibleLayout = 4, - Layout = 5, - Display = 6, - Count = 7, + EnsurePresShellInitAndFrames = 4, + InterruptibleLayout = 5, + Layout = 6, + Display = 7, + Count = 8, } #[repr(C)] #[derive(Debug, Copy)] @@ -7610,9 +7623,9 @@ pub mod root { pub mParsingMode: root::mozilla::css::SheetParsingMode, pub mType: root::mozilla::StyleBackendType, pub mDisabled: bool, + pub mDirty: bool, pub mDocumentAssociationMode: root::mozilla::StyleSheet_DocumentAssociationMode, pub mInner: *mut root::mozilla::StyleSheetInfo, - pub mDirty: bool, pub mStyleSets: root::nsTArray, } pub type StyleSheet_HasThreadSafeRefCnt = root::mozilla::FalseType; @@ -7651,7 +7664,7 @@ pub mod root { RuleRemoved = 4, RuleChanged = 5, } - #[repr(u32)] + #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleSheet_DocumentAssociationMode { OwnedByDocument = 0, @@ -7699,7 +7712,7 @@ pub mod root { } #[test] fn bindgen_test_layout_StyleSheet() { - assert_eq!(::std::mem::size_of::() , 160usize , concat + assert_eq!(::std::mem::size_of::() , 144usize , concat ! ( "Size of: " , stringify ! ( StyleSheet ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( StyleSheet ) )); @@ -7802,7 +7815,7 @@ pub mod root { } #[test] fn bindgen_test_layout_ServoStyleSheet() { - assert_eq!(::std::mem::size_of::() , 168usize , + assert_eq!(::std::mem::size_of::() , 152usize , concat ! ( "Size of: " , stringify ! ( ServoStyleSheet ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -7810,7 +7823,7 @@ pub mod root { "Alignment of " , stringify ! ( ServoStyleSheet ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoStyleSheet ) ) . mRuleList - as * const _ as usize } , 160usize , concat ! ( + as * const _ as usize } , 144usize , concat ! ( "Alignment of field: " , stringify ! ( ServoStyleSheet ) , "::" , stringify ! ( mRuleList ) )); } @@ -7882,13 +7895,14 @@ pub mod root { pub mComplete: bool, pub mFirstChild: root::RefPtr, pub mSheets: [u64; 10usize], + pub mSourceMapURL: ::nsstring::nsStringRepr, pub mPrincipalSet: bool, } pub use self::super::super::root::mozilla::net::ReferrerPolicy as StyleSheetInfo_ReferrerPolicy; #[test] fn bindgen_test_layout_StyleSheetInfo() { - assert_eq!(::std::mem::size_of::() , 200usize , + assert_eq!(::std::mem::size_of::() , 216usize , concat ! ( "Size of: " , stringify ! ( StyleSheetInfo ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -7948,7 +7962,13 @@ pub mod root { ) , "::" , stringify ! ( mSheets ) )); assert_eq! (unsafe { & ( * ( 0 as * const StyleSheetInfo ) ) . - mPrincipalSet as * const _ as usize } , 192usize , + mSourceMapURL as * const _ as usize } , 192usize , + concat ! ( + "Alignment of field: " , stringify ! ( StyleSheetInfo + ) , "::" , stringify ! ( mSourceMapURL ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const StyleSheetInfo ) ) . + mPrincipalSet as * const _ as usize } , 208usize , concat ! ( "Alignment of field: " , stringify ! ( StyleSheetInfo ) , "::" , stringify ! ( mPrincipalSet ) )); @@ -8878,12 +8898,12 @@ pub mod root { pub mBlobSerial: [u64; 2usize], pub mOriginAttributes: root::mozilla::OriginAttributes, pub mControlledDocument: *mut ::std::os::raw::c_void, - pub mHash: u32, + pub mHash: root::PLDHashNumber, pub mIsChrome: bool, } #[test] fn bindgen_test_layout_ImageCacheKey() { - assert_eq!(::std::mem::size_of::() , 80usize , + assert_eq!(::std::mem::size_of::() , 88usize , concat ! ( "Size of: " , stringify ! ( ImageCacheKey ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -8923,7 +8943,7 @@ pub mod root { ImageCacheKey ) , "::" , stringify ! ( mHash ) )); assert_eq! (unsafe { & ( * ( 0 as * const ImageCacheKey ) ) . mIsChrome - as * const _ as usize } , 76usize , concat ! ( + as * const _ as usize } , 80usize , concat ! ( "Alignment of field: " , stringify ! ( ImageCacheKey ) , "::" , stringify ! ( mIsChrome ) )); @@ -10585,7 +10605,7 @@ pub mod root { #[test] fn bindgen_test_layout_ServoStyleSheetInner() { assert_eq!(::std::mem::size_of::() , - 216usize , concat ! ( + 232usize , concat ! ( "Size of: " , stringify ! ( ServoStyleSheetInner ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( @@ -10593,14 +10613,14 @@ pub mod root { )); assert_eq! (unsafe { & ( * ( 0 as * const ServoStyleSheetInner ) ) . - mContents as * const _ as usize } , 200usize , concat + mContents as * const _ as usize } , 216usize , concat ! ( "Alignment of field: " , stringify ! ( ServoStyleSheetInner ) , "::" , stringify ! ( mContents ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoStyleSheetInner ) ) . - mURLData as * const _ as usize } , 208usize , concat ! + mURLData as * const _ as usize } , 224usize , concat ! ( "Alignment of field: " , stringify ! ( ServoStyleSheetInner ) , "::" , stringify ! ( mURLData @@ -11958,7 +11978,6 @@ pub mod root { NS_ERROR_PLUGIN_BLOCKLISTED = 2152465386, NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED = 2152465387, NS_ERROR_PLUGIN_CLICKTOPLAY = 2152465388, - NS_PLUGIN_INIT_PENDING = 4981741, NS_TABLELAYOUT_CELL_NOT_FOUND = 5046272, NS_POSITION_BEFORE_TABLE = 5046275, NS_STATE_PROPERTY_NOT_THERE = 5046277, @@ -14702,7 +14721,7 @@ pub mod root { pub struct nsAutoPtr_Proxy { } pub type nsAutoPtr_Proxy_member_function = u8; - pub type PLDHashNumber = u32; + pub type PLDHashNumber = usize; #[repr(C)] pub struct PLDHashTable { pub mOps: *const root::PLDHashTableOps, @@ -14812,8 +14831,8 @@ pub mod root { pub const PLDHashTable_kMinCapacity: u32 = 8; pub const PLDHashTable_kMaxInitialLength: u32 = 33554432; pub const PLDHashTable_kDefaultInitialLength: u32 = 4; - pub const PLDHashTable_kHashBits: u32 = 32; - pub const PLDHashTable_kGoldenRatio: u32 = 2654435769; + pub const PLDHashTable_kHashBits: u32 = 64; + pub const PLDHashTable_kGoldenRatio: u64 = 2135587859; pub const PLDHashTable_kCollisionFlag: root::PLDHashNumber = 1; #[test] fn bindgen_test_layout_PLDHashTable() { @@ -14909,9 +14928,9 @@ pub mod root { } #[test] fn bindgen_test_layout_PLDHashEntryHdr() { - assert_eq!(::std::mem::size_of::() , 4usize , concat + assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of: " , stringify ! ( PLDHashEntryHdr ) )); - assert_eq! (::std::mem::align_of::() , 4usize , + assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( PLDHashEntryHdr ) )); assert_eq! (unsafe { @@ -15875,13 +15894,6 @@ pub mod root { pub enum nsStyleAutoArray_WithSingleInitialElement { WITH_SINGLE_INITIAL_ELEMENT = 0, } - /** - * Currently needs to be 'double' for Cairo compatibility. Could - * become 'float', perhaps, in some configurations. - */ - pub type gfxFloat = f64; - pub type gfxSize = [u64; 2usize]; - pub type nsIntRect = root::mozilla::gfx::IntRect; pub const nsStyleUnit_eStyleUnit_MAX: root::nsStyleUnit = nsStyleUnit::eStyleUnit_Calc; #[repr(u8)] @@ -16353,6 +16365,8 @@ pub mod root { nsEventStatus_eConsumeDoDefault = 2, nsEventStatus_eSentinel = 3, } + pub type gfxSize = [u64; 2usize]; + pub type nsIntRect = root::mozilla::gfx::IntRect; #[repr(C)] #[derive(Debug, Copy)] pub struct pixman_region32_data { @@ -27441,7 +27455,7 @@ pub mod root { * smooth msd, or normal scrolling. * * SMOOTH scrolls have a symmetrical acceleration and deceleration curve - * modeled with a set of splines that guarantee that the destination will be + * modeled with a set of splines that guarantee that the destination will be * reached over a fixed time interval. SMOOTH will only be smooth if smooth * scrolling is actually enabled. This behavior is utilized by keyboard and * mouse wheel scrolling events. @@ -27824,6 +27838,11 @@ pub mod root { nsLanguageAtomService ) , "::" , stringify ! ( mLocaleLanguage ) )); } + /** + * Currently needs to be 'double' for Cairo compatibility. Could + * become 'float', perhaps, in some configurations. + */ + pub type gfxFloat = f64; #[repr(C)] #[derive(Debug, Copy)] pub struct nsINamed { @@ -32956,7 +32975,7 @@ pub mod root { pub type imgRequest_HasThreadSafeRefCnt = root::mozilla::TrueType; #[test] fn bindgen_test_layout_imgRequest() { - assert_eq!(::std::mem::size_of::() , 416usize , concat ! ( + assert_eq!(::std::mem::size_of::() , 424usize , concat ! ( "Size of: " , stringify ! ( imgRequest ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( imgRequest ) )); @@ -38425,7 +38444,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_214925_instantiation_100() { + fn __bindgen_test_layout__bindgen_ty_id_214707_instantiation_100() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -38434,7 +38453,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_214961_instantiation_101() { + fn __bindgen_test_layout__bindgen_ty_id_214743_instantiation_101() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); diff --git a/components/style/gecko/generated/structs_release.rs b/components/style/gecko/generated/structs_release.rs index 3d39ad6a1c8..404ca250ed1 100644 --- a/components/style/gecko/generated/structs_release.rs +++ b/components/style/gecko/generated/structs_release.rs @@ -1424,7 +1424,7 @@ pub mod root { pub mod css { #[allow(unused_imports)] use self::super::super::super::root; - #[repr(u32)] + #[repr(u8)] /** * Enum defining the mode in which a sheet is to be parsed. This is * usually, but not always, the same as the cascade level at which the @@ -2302,7 +2302,6 @@ pub mod root { impl Clone for FontVariation { fn clone(&self) -> Self { *self } } - pub type Matrix4x4 = [u32; 16usize]; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ScaleFactor { @@ -2311,6 +2310,7 @@ pub mod root { #[derive(Debug, Copy, Clone)] pub struct ScaleFactors2D { } + pub type Matrix4x4 = [u32; 16usize]; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct SourceSurface { @@ -2370,7 +2370,6 @@ pub mod root { ePending = 2, eUserAction = 3, eRestore = 4, - eSentinel = 5, } extern "C" { #[link_name = @@ -2381,6 +2380,13 @@ pub mod root { pub const FrameMetrics_START_SCROLL_ID: root::mozilla::layers::FrameMetrics_ViewID = 2; + pub const FrameMetrics_sScrollOffsetUpdateTypeCount: usize = 5; + extern "C" { + #[link_name = + "_ZN7mozilla6layers12FrameMetrics30sHighestScrollOffsetUpdateTypeE"] + pub static FrameMetrics_sHighestScrollOffsetUpdateType: + root::mozilla::layers::FrameMetrics_ScrollOffsetUpdateType; + } #[test] fn bindgen_test_layout_FrameMetrics() { assert_eq!(::std::mem::size_of::() , 184usize , @@ -3211,7 +3217,6 @@ pub mod root { eNone = 0, eRefLayer = 1, eScrollLayer = 2, - eSentinel = 3, } #[repr(C)] #[derive(Debug, Copy)] @@ -3248,6 +3253,13 @@ pub mod root { impl Clone for FocusTarget_FocusTargetData { fn clone(&self) -> Self { *self } } + pub const FocusTarget_sFocusTargetTypeCount: usize = 3; + extern "C" { + #[link_name = + "_ZN7mozilla6layers11FocusTarget23sHighestFocusTargetTypeE"] + pub static FocusTarget_sHighestFocusTargetType: + root::mozilla::layers::FocusTarget_FocusTargetType; + } #[test] fn bindgen_test_layout_FocusTarget() { assert_eq!(::std::mem::size_of::() , 32usize , @@ -6978,10 +6990,11 @@ pub mod root { Content = 1, ContentAndNotify = 2, Style = 3, - InterruptibleLayout = 4, - Layout = 5, - Display = 6, - Count = 7, + EnsurePresShellInitAndFrames = 4, + InterruptibleLayout = 5, + Layout = 6, + Display = 7, + Count = 8, } #[repr(C)] #[derive(Debug, Copy)] @@ -7460,9 +7473,9 @@ pub mod root { pub mParsingMode: root::mozilla::css::SheetParsingMode, pub mType: root::mozilla::StyleBackendType, pub mDisabled: bool, + pub mDirty: bool, pub mDocumentAssociationMode: root::mozilla::StyleSheet_DocumentAssociationMode, pub mInner: *mut root::mozilla::StyleSheetInfo, - pub mDirty: bool, pub mStyleSets: root::nsTArray, } pub type StyleSheet_HasThreadSafeRefCnt = root::mozilla::FalseType; @@ -7501,7 +7514,7 @@ pub mod root { RuleRemoved = 4, RuleChanged = 5, } - #[repr(u32)] + #[repr(u8)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum StyleSheet_DocumentAssociationMode { OwnedByDocument = 0, @@ -7549,7 +7562,7 @@ pub mod root { } #[test] fn bindgen_test_layout_StyleSheet() { - assert_eq!(::std::mem::size_of::() , 152usize , concat + assert_eq!(::std::mem::size_of::() , 136usize , concat ! ( "Size of: " , stringify ! ( StyleSheet ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( StyleSheet ) )); @@ -7652,7 +7665,7 @@ pub mod root { } #[test] fn bindgen_test_layout_ServoStyleSheet() { - assert_eq!(::std::mem::size_of::() , 160usize , + assert_eq!(::std::mem::size_of::() , 144usize , concat ! ( "Size of: " , stringify ! ( ServoStyleSheet ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -7660,7 +7673,7 @@ pub mod root { "Alignment of " , stringify ! ( ServoStyleSheet ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoStyleSheet ) ) . mRuleList - as * const _ as usize } , 152usize , concat ! ( + as * const _ as usize } , 136usize , concat ! ( "Alignment of field: " , stringify ! ( ServoStyleSheet ) , "::" , stringify ! ( mRuleList ) )); } @@ -7732,12 +7745,13 @@ pub mod root { pub mComplete: bool, pub mFirstChild: root::RefPtr, pub mSheets: [u64; 10usize], + pub mSourceMapURL: ::nsstring::nsStringRepr, } pub use self::super::super::root::mozilla::net::ReferrerPolicy as StyleSheetInfo_ReferrerPolicy; #[test] fn bindgen_test_layout_StyleSheetInfo() { - assert_eq!(::std::mem::size_of::() , 192usize , + assert_eq!(::std::mem::size_of::() , 208usize , concat ! ( "Size of: " , stringify ! ( StyleSheetInfo ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -7795,6 +7809,12 @@ pub mod root { const _ as usize } , 112usize , concat ! ( "Alignment of field: " , stringify ! ( StyleSheetInfo ) , "::" , stringify ! ( mSheets ) )); + assert_eq! (unsafe { + & ( * ( 0 as * const StyleSheetInfo ) ) . + mSourceMapURL as * const _ as usize } , 192usize , + concat ! ( + "Alignment of field: " , stringify ! ( StyleSheetInfo + ) , "::" , stringify ! ( mSourceMapURL ) )); } #[repr(i32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] @@ -8611,12 +8631,12 @@ pub mod root { pub mBlobSerial: [u64; 2usize], pub mOriginAttributes: root::mozilla::OriginAttributes, pub mControlledDocument: *mut ::std::os::raw::c_void, - pub mHash: u32, + pub mHash: root::PLDHashNumber, pub mIsChrome: bool, } #[test] fn bindgen_test_layout_ImageCacheKey() { - assert_eq!(::std::mem::size_of::() , 80usize , + assert_eq!(::std::mem::size_of::() , 88usize , concat ! ( "Size of: " , stringify ! ( ImageCacheKey ) )); assert_eq! (::std::mem::align_of::() , 8usize , @@ -8656,7 +8676,7 @@ pub mod root { ImageCacheKey ) , "::" , stringify ! ( mHash ) )); assert_eq! (unsafe { & ( * ( 0 as * const ImageCacheKey ) ) . mIsChrome - as * const _ as usize } , 76usize , concat ! ( + as * const _ as usize } , 80usize , concat ! ( "Alignment of field: " , stringify ! ( ImageCacheKey ) , "::" , stringify ! ( mIsChrome ) )); @@ -10318,7 +10338,7 @@ pub mod root { #[test] fn bindgen_test_layout_ServoStyleSheetInner() { assert_eq!(::std::mem::size_of::() , - 208usize , concat ! ( + 224usize , concat ! ( "Size of: " , stringify ! ( ServoStyleSheetInner ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( @@ -10326,14 +10346,14 @@ pub mod root { )); assert_eq! (unsafe { & ( * ( 0 as * const ServoStyleSheetInner ) ) . - mContents as * const _ as usize } , 192usize , concat + mContents as * const _ as usize } , 208usize , concat ! ( "Alignment of field: " , stringify ! ( ServoStyleSheetInner ) , "::" , stringify ! ( mContents ) )); assert_eq! (unsafe { & ( * ( 0 as * const ServoStyleSheetInner ) ) . - mURLData as * const _ as usize } , 200usize , concat ! + mURLData as * const _ as usize } , 216usize , concat ! ( "Alignment of field: " , stringify ! ( ServoStyleSheetInner ) , "::" , stringify ! ( mURLData @@ -11494,7 +11514,6 @@ pub mod root { NS_ERROR_PLUGIN_BLOCKLISTED = 2152465386, NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED = 2152465387, NS_ERROR_PLUGIN_CLICKTOPLAY = 2152465388, - NS_PLUGIN_INIT_PENDING = 4981741, NS_TABLELAYOUT_CELL_NOT_FOUND = 5046272, NS_POSITION_BEFORE_TABLE = 5046275, NS_STATE_PROPERTY_NOT_THERE = 5046277, @@ -14374,7 +14393,7 @@ pub mod root { pub struct nsAutoPtr_Proxy { } pub type nsAutoPtr_Proxy_member_function = u8; - pub type PLDHashNumber = u32; + pub type PLDHashNumber = usize; #[repr(C)] #[derive(Debug)] pub struct PLDHashTable { @@ -14484,8 +14503,8 @@ pub mod root { pub const PLDHashTable_kMinCapacity: u32 = 8; pub const PLDHashTable_kMaxInitialLength: u32 = 33554432; pub const PLDHashTable_kDefaultInitialLength: u32 = 4; - pub const PLDHashTable_kHashBits: u32 = 32; - pub const PLDHashTable_kGoldenRatio: u32 = 2654435769; + pub const PLDHashTable_kHashBits: u32 = 64; + pub const PLDHashTable_kGoldenRatio: u64 = 2135587859; pub const PLDHashTable_kCollisionFlag: root::PLDHashNumber = 1; #[test] fn bindgen_test_layout_PLDHashTable() { @@ -14576,9 +14595,9 @@ pub mod root { } #[test] fn bindgen_test_layout_PLDHashEntryHdr() { - assert_eq!(::std::mem::size_of::() , 4usize , concat + assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of: " , stringify ! ( PLDHashEntryHdr ) )); - assert_eq! (::std::mem::align_of::() , 4usize , + assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( PLDHashEntryHdr ) )); assert_eq! (unsafe { @@ -15504,13 +15523,6 @@ pub mod root { pub enum nsStyleAutoArray_WithSingleInitialElement { WITH_SINGLE_INITIAL_ELEMENT = 0, } - /** - * Currently needs to be 'double' for Cairo compatibility. Could - * become 'float', perhaps, in some configurations. - */ - pub type gfxFloat = f64; - pub type gfxSize = [u64; 2usize]; - pub type nsIntRect = root::mozilla::gfx::IntRect; pub const nsStyleUnit_eStyleUnit_MAX: root::nsStyleUnit = nsStyleUnit::eStyleUnit_Calc; #[repr(u8)] @@ -15982,6 +15994,8 @@ pub mod root { nsEventStatus_eConsumeDoDefault = 2, nsEventStatus_eSentinel = 3, } + pub type gfxSize = [u64; 2usize]; + pub type nsIntRect = root::mozilla::gfx::IntRect; #[repr(C)] #[derive(Debug, Copy)] pub struct pixman_region32_data { @@ -26859,7 +26873,7 @@ pub mod root { * smooth msd, or normal scrolling. * * SMOOTH scrolls have a symmetrical acceleration and deceleration curve - * modeled with a set of splines that guarantee that the destination will be + * modeled with a set of splines that guarantee that the destination will be * reached over a fixed time interval. SMOOTH will only be smooth if smooth * scrolling is actually enabled. This behavior is utilized by keyboard and * mouse wheel scrolling events. @@ -27242,6 +27256,11 @@ pub mod root { nsLanguageAtomService ) , "::" , stringify ! ( mLocaleLanguage ) )); } + /** + * Currently needs to be 'double' for Cairo compatibility. Could + * become 'float', perhaps, in some configurations. + */ + pub type gfxFloat = f64; #[repr(C)] #[derive(Debug, Copy)] pub struct nsINamed { @@ -32281,7 +32300,7 @@ pub mod root { pub type imgRequest_HasThreadSafeRefCnt = root::mozilla::TrueType; #[test] fn bindgen_test_layout_imgRequest() { - assert_eq!(::std::mem::size_of::() , 376usize , concat ! ( + assert_eq!(::std::mem::size_of::() , 384usize , concat ! ( "Size of: " , stringify ! ( imgRequest ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( imgRequest ) )); @@ -37750,7 +37769,7 @@ pub mod root { root::nsCharTraits ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_211187_instantiation_98() { + fn __bindgen_test_layout__bindgen_ty_id_210969_instantiation_98() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) )); @@ -37759,7 +37778,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout__bindgen_ty_id_211223_instantiation_99() { + fn __bindgen_test_layout__bindgen_ty_id_211005_instantiation_99() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( u8 ) ));