servo: Merge #19973 - style: Rework how media feature changes are handled for XBL (from emilio:media-feature-change); r=xidorn
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 07 Feb 2018 08:02:34 -0500
changeset 402787 9d743d66fd5c025d2549b405eb09acc48b757a00
parent 402786 3304400da8cbe3689967b6a8e4fc69d973a48618
child 402788 a18cd8419b3f3a131a8536798f2472a78bd1f728
push id99659
push useraciure@mozilla.com
push dateWed, 07 Feb 2018 22:33:57 +0000
treeherdermozilla-inbound@5ceb1098fef3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #19973 - style: Rework how media feature changes are handled for XBL (from emilio:media-feature-change); r=xidorn Bug: 1435939 Reviewed-by: xidorn Source-Repo: https://github.com/servo/servo Source-Revision: e57319a7345eded057555f55f801e5f2c413f5b9
servo/components/style/gecko/generated/bindings.rs
servo/components/style/gecko/generated/structs.rs
servo/components/style/stylist.rs
servo/ports/geckolib/glue.rs
--- a/servo/components/style/gecko/generated/bindings.rs
+++ b/servo/components/style/gecko/generated/bindings.rs
@@ -13,23 +13,25 @@ use gecko_bindings::structs::mozilla::cs
 use gecko_bindings::structs::mozilla::css::ErrorReporter;
 use gecko_bindings::structs::mozilla::css::ImageValue;
 use gecko_bindings::structs::mozilla::css::URLValue;
 use gecko_bindings::structs::mozilla::css::URLValueData;
 use gecko_bindings::structs::mozilla::dom::CallerType;
 use gecko_bindings::structs::mozilla::AnonymousCounterStyle;
 use gecko_bindings::structs::mozilla::AtomArray;
 use gecko_bindings::structs::mozilla::MallocSizeOf;
+use gecko_bindings::structs::mozilla::ServoStyleSet;
 use gecko_bindings::structs::mozilla::OriginFlags;
 use gecko_bindings::structs::mozilla::UniquePtr;
 use gecko_bindings::structs::ServoRawOffsetArc;
 use gecko_bindings::structs::nsIContent;
 use gecko_bindings::structs::nsIDocument;
 use gecko_bindings::structs::nsIDocument_DocumentTheme;
 use gecko_bindings::structs::nsSimpleContentList;
+use gecko_bindings::structs::MediumFeaturesChangedResult;
 use gecko_bindings::structs::RawGeckoAnimationPropertySegment;
 use gecko_bindings::structs::RawGeckoComputedTiming;
 use gecko_bindings::structs::RawGeckoCSSPropertyIDList;
 use gecko_bindings::structs::RawGeckoDocument;
 use gecko_bindings::structs::RawGeckoElement;
 use gecko_bindings::structs::Element;
 use gecko_bindings::structs::RawGeckoKeyframeList;
 use gecko_bindings::structs::RawGeckoPropertyValuePairList;
@@ -2092,25 +2094,20 @@ extern "C" {
 extern "C" {
     pub fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextOwned) -> *mut RawServoStyleSet;
 }
 extern "C" {
     pub fn Servo_StyleSet_RebuildCachedData(set: RawServoStyleSetBorrowed);
 }
 extern "C" {
     pub fn Servo_StyleSet_MediumFeaturesChanged(
-        set: RawServoStyleSetBorrowed,
-        viewport_units_used: *mut bool,
-    ) -> u8;
-}
-extern "C" {
-    pub fn Servo_StyleSet_SetDevice(
-        set: RawServoStyleSetBorrowed,
-        pres_context: RawGeckoPresContextOwned,
-    ) -> u8;
+        document_set: RawServoStyleSetBorrowed,
+        non_document_sets: *const nsTArray<*mut ServoStyleSet>,
+        may_affect_default_style: bool,
+    ) -> MediumFeaturesChangedResult;
 }
 extern "C" {
     pub fn Servo_StyleSet_CompatModeChanged(raw_data: RawServoStyleSetBorrowed);
 }
 extern "C" {
     pub fn Servo_StyleSet_AppendStyleSheet(
         set: RawServoStyleSetBorrowed,
         gecko_sheet: *const ServoStyleSheet,
--- a/servo/components/style/gecko/generated/structs.rs
+++ b/servo/components/style/gecko/generated/structs.rs
@@ -2961,28 +2961,16 @@ pub mod root {
             pub const LargeAllocStatus_NONE: root::mozilla::dom::LargeAllocStatus = 0;
             pub const LargeAllocStatus_SUCCESS: root::mozilla::dom::LargeAllocStatus = 1;
             pub const LargeAllocStatus_NON_GET: root::mozilla::dom::LargeAllocStatus = 2;
             pub const LargeAllocStatus_NON_E10S: root::mozilla::dom::LargeAllocStatus = 3;
             pub const LargeAllocStatus_NOT_ONLY_TOPLEVEL_IN_TABGROUP:
                 root::mozilla::dom::LargeAllocStatus = 4;
             pub const LargeAllocStatus_NON_WIN32: root::mozilla::dom::LargeAllocStatus = 5;
             pub type LargeAllocStatus = u8;
-            pub mod prototypes {
-                #[allow(unused_imports)]
-                use self::super::super::super::super::root;
-            }
-            pub mod constructors {
-                #[allow(unused_imports)]
-                use self::super::super::super::super::root;
-            }
-            pub mod namedpropertiesobjects {
-                #[allow(unused_imports)]
-                use self::super::super::super::super::root;
-            }
             #[repr(C)]
             #[derive(Debug, Copy, Clone)]
             pub struct StyleSheetList {
                 _unused: [u8; 0],
             }
             /// A class meant to be shared by ShadowRoot and Document, that holds a list of
             /// stylesheets.
             ///
@@ -3108,16 +3096,28 @@ pub mod root {
             pub struct MediaQueryList {
                 _unused: [u8; 0],
             }
             #[repr(C)]
             #[derive(Debug, Copy, Clone)]
             pub struct XPathEvaluator {
                 _unused: [u8; 0],
             }
+            pub mod prototypes {
+                #[allow(unused_imports)]
+                use self::super::super::super::super::root;
+            }
+            pub mod constructors {
+                #[allow(unused_imports)]
+                use self::super::super::super::super::root;
+            }
+            pub mod namedpropertiesobjects {
+                #[allow(unused_imports)]
+                use self::super::super::super::super::root;
+            }
             #[repr(C)]
             #[derive(Debug, Copy)]
             pub struct FrameRequestCallback {
                 pub _bindgen_opaque_blob: [u64; 6usize],
             }
             #[test]
             fn bindgen_test_layout_FrameRequestCallback() {
                 assert_eq!(
@@ -5078,16 +5078,95 @@ pub mod root {
         }
         #[repr(u8)]
         #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
         pub enum StyleOverscrollBehavior {
             Auto = 0,
             Contain = 1,
             None = 2,
         }
+        pub const MediaFeatureChangeReason_ViewportChange: root::mozilla::MediaFeatureChangeReason =
+            1;
+        pub const MediaFeatureChangeReason_ZoomChange: root::mozilla::MediaFeatureChangeReason = 2;
+        pub const MediaFeatureChangeReason_MinFontSizeChange:
+            root::mozilla::MediaFeatureChangeReason = 4;
+        pub const MediaFeatureChangeReason_ResolutionChange:
+            root::mozilla::MediaFeatureChangeReason = 8;
+        pub const MediaFeatureChangeReason_MediumChange: root::mozilla::MediaFeatureChangeReason =
+            16;
+        pub const MediaFeatureChangeReason_SizeModeChange: root::mozilla::MediaFeatureChangeReason =
+            32;
+        pub const MediaFeatureChangeReason_SystemMetricsChange:
+            root::mozilla::MediaFeatureChangeReason = 64;
+        pub const MediaFeatureChangeReason_DeviceSizeIsPageSizeChange:
+            root::mozilla::MediaFeatureChangeReason = 128;
+        pub const MediaFeatureChangeReason_DisplayModeChange:
+            root::mozilla::MediaFeatureChangeReason = 256;
+        pub type MediaFeatureChangeReason = i32;
+        #[repr(C)]
+        #[derive(Debug, Copy)]
+        pub struct MediaFeatureChange {
+            pub mRestyleHint: root::nsRestyleHint,
+            pub mChangeHint: root::nsChangeHint,
+            pub mReason: root::mozilla::MediaFeatureChangeReason,
+        }
+        #[test]
+        fn bindgen_test_layout_MediaFeatureChange() {
+            assert_eq!(
+                ::std::mem::size_of::<MediaFeatureChange>(),
+                12usize,
+                concat!("Size of: ", stringify!(MediaFeatureChange))
+            );
+            assert_eq!(
+                ::std::mem::align_of::<MediaFeatureChange>(),
+                4usize,
+                concat!("Alignment of ", stringify!(MediaFeatureChange))
+            );
+            assert_eq!(
+                unsafe {
+                    &(*(::std::ptr::null::<MediaFeatureChange>())).mRestyleHint as *const _ as usize
+                },
+                0usize,
+                concat!(
+                    "Offset of field: ",
+                    stringify!(MediaFeatureChange),
+                    "::",
+                    stringify!(mRestyleHint)
+                )
+            );
+            assert_eq!(
+                unsafe {
+                    &(*(::std::ptr::null::<MediaFeatureChange>())).mChangeHint as *const _ as usize
+                },
+                4usize,
+                concat!(
+                    "Offset of field: ",
+                    stringify!(MediaFeatureChange),
+                    "::",
+                    stringify!(mChangeHint)
+                )
+            );
+            assert_eq!(
+                unsafe {
+                    &(*(::std::ptr::null::<MediaFeatureChange>())).mReason as *const _ as usize
+                },
+                8usize,
+                concat!(
+                    "Offset of field: ",
+                    stringify!(MediaFeatureChange),
+                    "::",
+                    stringify!(mReason)
+                )
+            );
+        }
+        impl Clone for MediaFeatureChange {
+            fn clone(&self) -> Self {
+                *self
+            }
+        }
         #[repr(C)]
         #[derive(Debug, Copy, Clone)]
         pub struct SupportsWeakPtr {
             pub _address: u8,
         }
         #[repr(C)]
         #[derive(Debug, Copy, Clone)]
         pub struct WeakPtr {
@@ -6223,52 +6302,16 @@ pub mod root {
                 _unused: [u8; 0],
             }
         }
         #[repr(C)]
         #[derive(Debug, Copy, Clone)]
         pub struct Encoding {
             _unused: [u8; 0],
         }
-        #[repr(C)]
-        #[derive(Debug)]
-        pub struct Runnable {
-            pub _base: root::nsIRunnable,
-            pub _base_1: root::nsINamed,
-            pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt,
-            pub mName: *const ::std::os::raw::c_char,
-        }
-        pub type Runnable_HasThreadSafeRefCnt = root::mozilla::TrueType;
-        #[test]
-        fn bindgen_test_layout_Runnable() {
-            assert_eq!(
-                ::std::mem::size_of::<Runnable>(),
-                32usize,
-                concat!("Size of: ", stringify!(Runnable))
-            );
-            assert_eq!(
-                ::std::mem::align_of::<Runnable>(),
-                8usize,
-                concat!("Alignment of ", stringify!(Runnable))
-            );
-        }
-        #[repr(C)]
-        #[derive(Debug, Copy, Clone)]
-        pub struct SegmentedVector_SegmentImpl_Storage {
-            pub mBuf: root::__BindgenUnionField<*mut ::std::os::raw::c_char>,
-            pub mAlign: root::__BindgenUnionField<u8>,
-            pub bindgen_union_field: u64,
-        }
-        pub type SegmentedVector_Segment = u8;
-        #[repr(C)]
-        #[derive(Debug, Copy, Clone)]
-        pub struct SegmentedVector_IterImpl {
-            pub mSegment: *mut root::mozilla::SegmentedVector_Segment,
-            pub mIndex: usize,
-        }
         pub const UseCounter_eUseCounter_UNKNOWN: root::mozilla::UseCounter = -1;
         pub const UseCounter_eUseCounter_SVGSVGElement_getElementById: root::mozilla::UseCounter =
             0;
         pub const UseCounter_eUseCounter_SVGSVGElement_currentScale_getter:
             root::mozilla::UseCounter = 1;
         pub const UseCounter_eUseCounter_SVGSVGElement_currentScale_setter:
             root::mozilla::UseCounter = 2;
         pub const UseCounter_eUseCounter_property_Fill: root::mozilla::UseCounter = 3;
@@ -6486,16 +6529,52 @@ pub mod root {
                 )
             );
         }
         impl Clone for LazyLogModule {
             fn clone(&self) -> Self {
                 *self
             }
         }
+        #[repr(C)]
+        #[derive(Debug)]
+        pub struct Runnable {
+            pub _base: root::nsIRunnable,
+            pub _base_1: root::nsINamed,
+            pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt,
+            pub mName: *const ::std::os::raw::c_char,
+        }
+        pub type Runnable_HasThreadSafeRefCnt = root::mozilla::TrueType;
+        #[test]
+        fn bindgen_test_layout_Runnable() {
+            assert_eq!(
+                ::std::mem::size_of::<Runnable>(),
+                32usize,
+                concat!("Size of: ", stringify!(Runnable))
+            );
+            assert_eq!(
+                ::std::mem::align_of::<Runnable>(),
+                8usize,
+                concat!("Alignment of ", stringify!(Runnable))
+            );
+        }
+        #[repr(C)]
+        #[derive(Debug, Copy, Clone)]
+        pub struct SegmentedVector_SegmentImpl_Storage {
+            pub mBuf: root::__BindgenUnionField<*mut ::std::os::raw::c_char>,
+            pub mAlign: root::__BindgenUnionField<u8>,
+            pub bindgen_union_field: u64,
+        }
+        pub type SegmentedVector_Segment = u8;
+        #[repr(C)]
+        #[derive(Debug, Copy, Clone)]
+        pub struct SegmentedVector_IterImpl {
+            pub mSegment: *mut root::mozilla::SegmentedVector_Segment,
+            pub mIndex: usize,
+        }
         pub type ComputedKeyframeValues =
             root::nsTArray<root::mozilla::PropertyStyleAnimationValuePair>;
         #[test]
         fn __bindgen_test_layout_DefaultDelete_open0_RawServoStyleSet_close0_instantiation() {
             assert_eq!(
                 ::std::mem::size_of::<root::mozilla::DefaultDelete>(),
                 1usize,
                 concat!(
@@ -11351,17 +11430,16 @@ pub mod root {
         pub struct OriginFlags(pub u8);
         /// The set of style sheets that apply to a document, backed by a Servo
         /// Stylist.  A ServoStyleSet contains ServoStyleSheets.
         #[repr(C)]
         #[derive(Debug)]
         pub struct ServoStyleSet {
             pub mKind: root::mozilla::ServoStyleSet_Kind,
             pub mDocument: *mut root::nsIDocument,
-            pub mLastPresContextUsesXBLStyleSet: *mut ::std::os::raw::c_void,
             pub mRawSet: root::mozilla::UniquePtr<root::RawServoStyleSet>,
             pub mSheets: [u64; 9usize],
             pub mAuthorStyleDisabled: bool,
             pub mStylistState: root::mozilla::StylistState,
             pub mUserFontSetUpdateGeneration: u64,
             pub mUserFontCacheUpdateGeneration: u32,
             pub mNeedsRestyleAfterEnsureUniqueInner: bool,
             pub mNonInheritingStyleContexts: [u64; 7usize],
@@ -11371,17 +11449,17 @@ pub mod root {
         pub type ServoStyleSet_SnapshotTable = root::mozilla::ServoElementSnapshotTable;
         pub const ServoStyleSet_Kind_Master: root::mozilla::ServoStyleSet_Kind = 0;
         pub const ServoStyleSet_Kind_ForXBL: root::mozilla::ServoStyleSet_Kind = 1;
         pub type ServoStyleSet_Kind = u8;
         #[test]
         fn bindgen_test_layout_ServoStyleSet() {
             assert_eq!(
                 ::std::mem::size_of::<ServoStyleSet>(),
-                200usize,
+                192usize,
                 concat!("Size of: ", stringify!(ServoStyleSet))
             );
             assert_eq!(
                 ::std::mem::align_of::<ServoStyleSet>(),
                 8usize,
                 concat!("Alignment of ", stringify!(ServoStyleSet))
             );
             assert_eq!(
@@ -11400,143 +11478,130 @@ pub mod root {
                 concat!(
                     "Offset of field: ",
                     stringify!(ServoStyleSet),
                     "::",
                     stringify!(mDocument)
                 )
             );
             assert_eq!(
-                unsafe {
-                    &(*(::std::ptr::null::<ServoStyleSet>())).mLastPresContextUsesXBLStyleSet
-                        as *const _ as usize
-                },
+                unsafe { &(*(::std::ptr::null::<ServoStyleSet>())).mRawSet as *const _ as usize },
                 16usize,
                 concat!(
                     "Offset of field: ",
                     stringify!(ServoStyleSet),
                     "::",
-                    stringify!(mLastPresContextUsesXBLStyleSet)
-                )
-            );
-            assert_eq!(
-                unsafe { &(*(::std::ptr::null::<ServoStyleSet>())).mRawSet as *const _ as usize },
-                24usize,
-                concat!(
-                    "Offset of field: ",
-                    stringify!(ServoStyleSet),
-                    "::",
                     stringify!(mRawSet)
                 )
             );
             assert_eq!(
                 unsafe { &(*(::std::ptr::null::<ServoStyleSet>())).mSheets as *const _ as usize },
-                32usize,
+                24usize,
                 concat!(
                     "Offset of field: ",
                     stringify!(ServoStyleSet),
                     "::",
                     stringify!(mSheets)
                 )
             );
             assert_eq!(
                 unsafe {
                     &(*(::std::ptr::null::<ServoStyleSet>())).mAuthorStyleDisabled as *const _
                         as usize
                 },
-                104usize,
+                96usize,
                 concat!(
                     "Offset of field: ",
                     stringify!(ServoStyleSet),
                     "::",
                     stringify!(mAuthorStyleDisabled)
                 )
             );
             assert_eq!(
                 unsafe {
                     &(*(::std::ptr::null::<ServoStyleSet>())).mStylistState as *const _ as usize
                 },
-                105usize,
+                97usize,
                 concat!(
                     "Offset of field: ",
                     stringify!(ServoStyleSet),
                     "::",
                     stringify!(mStylistState)
                 )
             );
             assert_eq!(
                 unsafe {
                     &(*(::std::ptr::null::<ServoStyleSet>())).mUserFontSetUpdateGeneration
                         as *const _ as usize
                 },
-                112usize,
+                104usize,
                 concat!(
                     "Offset of field: ",
                     stringify!(ServoStyleSet),
                     "::",
                     stringify!(mUserFontSetUpdateGeneration)
                 )
             );
             assert_eq!(
                 unsafe {
                     &(*(::std::ptr::null::<ServoStyleSet>())).mUserFontCacheUpdateGeneration
                         as *const _ as usize
                 },
-                120usize,
+                112usize,
                 concat!(
                     "Offset of field: ",
                     stringify!(ServoStyleSet),
                     "::",
                     stringify!(mUserFontCacheUpdateGeneration)
                 )
             );
             assert_eq!(
                 unsafe {
                     &(*(::std::ptr::null::<ServoStyleSet>())).mNeedsRestyleAfterEnsureUniqueInner
                         as *const _ as usize
                 },
-                124usize,
+                116usize,
                 concat!(
                     "Offset of field: ",
                     stringify!(ServoStyleSet),
                     "::",
                     stringify!(mNeedsRestyleAfterEnsureUniqueInner)
                 )
             );
             assert_eq!(
                 unsafe {
                     &(*(::std::ptr::null::<ServoStyleSet>())).mNonInheritingStyleContexts
                         as *const _ as usize
                 },
-                128usize,
+                120usize,
                 concat!(
                     "Offset of field: ",
                     stringify!(ServoStyleSet),
                     "::",
                     stringify!(mNonInheritingStyleContexts)
                 )
             );
             assert_eq!(
                 unsafe {
                     &(*(::std::ptr::null::<ServoStyleSet>())).mPostTraversalTasks as *const _
                         as usize
                 },
-                184usize,
+                176usize,
                 concat!(
                     "Offset of field: ",
                     stringify!(ServoStyleSet),
                     "::",
                     stringify!(mPostTraversalTasks)
                 )
             );
             assert_eq!(
                 unsafe {
                     &(*(::std::ptr::null::<ServoStyleSet>())).mStyleRuleMap as *const _ as usize
                 },
-                192usize,
+                184usize,
                 concat!(
                     "Offset of field: ",
                     stringify!(ServoStyleSet),
                     "::",
                     stringify!(mStyleRuleMap)
                 )
             );
         }
@@ -19525,212 +19590,168 @@ pub mod root {
             __bindgen_bitfield_unit.set(16usize, 1u8, {
                 let mNeedThrottledAnimationFlush: u8 =
                     unsafe { ::std::mem::transmute(mNeedThrottledAnimationFlush) };
                 mNeedThrottledAnimationFlush as u64
             });
             __bindgen_bitfield_unit
         }
     }
-    /// The signature of the timer callback function passed to initWithFuncCallback.
-    /// This is the function that will get called when the timer expires if the
-    /// timer is initialized via initWithFuncCallback.
-    ///
-    /// @param aTimer the timer which has expired
-    /// @param aClosure opaque parameter passed to initWithFuncCallback
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsITimer {
-        pub _base: root::nsISupports,
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsITimer_COMTypeInfo {
-        pub _address: u8,
-    }
-    pub const nsITimer_TYPE_ONE_SHOT: root::nsITimer__bindgen_ty_1 = 0;
-    pub const nsITimer_TYPE_REPEATING_SLACK: root::nsITimer__bindgen_ty_1 = 1;
-    pub const nsITimer_TYPE_REPEATING_PRECISE: root::nsITimer__bindgen_ty_1 = 2;
-    pub const nsITimer_TYPE_REPEATING_PRECISE_CAN_SKIP: root::nsITimer__bindgen_ty_1 = 3;
-    pub const nsITimer_TYPE_REPEATING_SLACK_LOW_PRIORITY: root::nsITimer__bindgen_ty_1 = 4;
-    pub const nsITimer_TYPE_ONE_SHOT_LOW_PRIORITY: root::nsITimer__bindgen_ty_1 = 5;
-    pub type nsITimer__bindgen_ty_1 = u32;
-    #[test]
-    fn bindgen_test_layout_nsITimer() {
-        assert_eq!(
-            ::std::mem::size_of::<nsITimer>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsITimer))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsITimer>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsITimer))
-        );
-    }
-    impl Clone for nsITimer {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    #[repr(C)]
-    #[derive(Debug)]
-    pub struct nsLanguageAtomService {
-        pub mLangToGroup: [u64; 4usize],
-        pub mLocaleLanguage: root::RefPtr<root::nsAtom>,
-    }
-    pub type nsLanguageAtomService_Encoding = root::mozilla::Encoding;
-    pub type nsLanguageAtomService_NotNull<T> = root::mozilla::NotNull<T>;
-    #[test]
-    fn bindgen_test_layout_nsLanguageAtomService() {
-        assert_eq!(
-            ::std::mem::size_of::<nsLanguageAtomService>(),
-            40usize,
-            concat!("Size of: ", stringify!(nsLanguageAtomService))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsLanguageAtomService>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsLanguageAtomService))
-        );
-        assert_eq!(
-            unsafe {
-                &(*(::std::ptr::null::<nsLanguageAtomService>())).mLangToGroup as *const _ as usize
-            },
-            0usize,
-            concat!(
-                "Offset of field: ",
-                stringify!(nsLanguageAtomService),
-                "::",
-                stringify!(mLangToGroup)
-            )
-        );
-        assert_eq!(
-            unsafe {
-                &(*(::std::ptr::null::<nsLanguageAtomService>())).mLocaleLanguage as *const _
-                    as usize
-            },
-            32usize,
-            concat!(
-                "Offset of field: ",
-                stringify!(nsLanguageAtomService),
-                "::",
-                stringify!(mLocaleLanguage)
-            )
-        );
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsINamed {
+    #[repr(u32)]
+    #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+    pub enum nsCompatibility {
+        eCompatibility_FullStandards = 1,
+        eCompatibility_AlmostStandards = 2,
+        eCompatibility_NavQuirks = 3,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsILoadGroup {
+        pub _base: root::nsIRequest,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsILoadGroup_COMTypeInfo {
+        pub _address: u8,
+    }
+    #[test]
+    fn bindgen_test_layout_nsILoadGroup() {
+        assert_eq!(
+            ::std::mem::size_of::<nsILoadGroup>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsILoadGroup))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsILoadGroup>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsILoadGroup))
+        );
+    }
+    impl Clone for nsILoadGroup {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsIRequestObserver {
         pub _base: root::nsISupports,
     }
     #[repr(C)]
     #[derive(Debug, Copy, Clone)]
-    pub struct nsINamed_COMTypeInfo {
-        pub _address: u8,
-    }
-    #[test]
-    fn bindgen_test_layout_nsINamed() {
-        assert_eq!(
-            ::std::mem::size_of::<nsINamed>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsINamed))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsINamed>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsINamed))
-        );
-    }
-    impl Clone for nsINamed {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsIRunnable {
+    pub struct nsIRequestObserver_COMTypeInfo {
+        pub _address: u8,
+    }
+    #[test]
+    fn bindgen_test_layout_nsIRequestObserver() {
+        assert_eq!(
+            ::std::mem::size_of::<nsIRequestObserver>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsIRequestObserver))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsIRequestObserver>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsIRequestObserver))
+        );
+    }
+    impl Clone for nsIRequestObserver {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsIStreamListener {
+        pub _base: root::nsIRequestObserver,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsIStreamListener_COMTypeInfo {
+        pub _address: u8,
+    }
+    #[test]
+    fn bindgen_test_layout_nsIStreamListener() {
+        assert_eq!(
+            ::std::mem::size_of::<nsIStreamListener>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsIStreamListener))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsIStreamListener>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsIStreamListener))
+        );
+    }
+    impl Clone for nsIStreamListener {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsParserBase {
         pub _base: root::nsISupports,
     }
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsIRunnable_COMTypeInfo {
-        pub _address: u8,
-    }
-    #[test]
-    fn bindgen_test_layout_nsIRunnable() {
-        assert_eq!(
-            ::std::mem::size_of::<nsIRunnable>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsIRunnable))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsIRunnable>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsIRunnable))
-        );
-    }
-    impl Clone for nsIRunnable {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsIEventTarget {
-        pub _base: root::nsISupports,
-        pub mVirtualThread: *mut root::PRThread,
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsIEventTarget_COMTypeInfo {
-        pub _address: u8,
-    }
-    pub const nsIEventTarget_DISPATCH_NORMAL: root::nsIEventTarget__bindgen_ty_1 = 0;
-    pub const nsIEventTarget_DISPATCH_SYNC: root::nsIEventTarget__bindgen_ty_1 = 1;
-    pub const nsIEventTarget_DISPATCH_AT_END: root::nsIEventTarget__bindgen_ty_1 = 2;
-    pub type nsIEventTarget__bindgen_ty_1 = u32;
-    #[test]
-    fn bindgen_test_layout_nsIEventTarget() {
-        assert_eq!(
-            ::std::mem::size_of::<nsIEventTarget>(),
-            16usize,
-            concat!("Size of: ", stringify!(nsIEventTarget))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsIEventTarget>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsIEventTarget))
-        );
-        assert_eq!(
-            unsafe {
-                &(*(::std::ptr::null::<nsIEventTarget>())).mVirtualThread as *const _ as usize
-            },
-            8usize,
-            concat!(
-                "Offset of field: ",
-                stringify!(nsIEventTarget),
-                "::",
-                stringify!(mVirtualThread)
-            )
-        );
-    }
-    impl Clone for nsIEventTarget {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    pub type nsRunnableMethod_BaseType = u8;
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsRunnableMethod_ReturnTypeEnforcer {
-        pub _address: u8,
-    }
-    pub type nsRunnableMethod_ReturnTypeEnforcer_ReturnTypeIsSafe = ::std::os::raw::c_int;
-    pub type nsRunnableMethod_check = root::nsRunnableMethod_ReturnTypeEnforcer;
+    #[test]
+    fn bindgen_test_layout_nsParserBase() {
+        assert_eq!(
+            ::std::mem::size_of::<nsParserBase>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsParserBase))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsParserBase>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsParserBase))
+        );
+    }
+    impl Clone for nsParserBase {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    /// This GECKO-INTERNAL interface is on track to being REMOVED (or refactored
+    /// to the point of being near-unrecognizable).
+    ///
+    /// Please DO NOT #include this file in comm-central code, in your XULRunner
+    /// app or binary extensions.
+    ///
+    /// Please DO NOT #include this into new files even inside Gecko. It is more
+    /// likely than not that #including this header is the wrong thing to do.
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsIParser {
+        pub _base: root::nsParserBase,
+    }
+    pub type nsIParser_Encoding = root::mozilla::Encoding;
+    pub type nsIParser_NotNull<T> = root::mozilla::NotNull<T>;
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsIParser_COMTypeInfo {
+        pub _address: u8,
+    }
+    #[test]
+    fn bindgen_test_layout_nsIParser() {
+        assert_eq!(
+            ::std::mem::size_of::<nsIParser>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsIParser))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsIParser>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsIParser))
+        );
+    }
+    impl Clone for nsIParser {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
     #[repr(C)]
     #[derive(Debug)]
     pub struct nsIGlobalObject {
         pub _base: root::nsISupports,
         pub _base_1: root::mozilla::dom::DispatcherTrait,
         pub mHostObjectURIs: root::nsTArray<root::nsCString>,
         pub mIsDying: bool,
     }
@@ -19776,128 +19797,16 @@ pub mod root {
         assert_eq!(
             ::std::mem::align_of::<nsIScriptGlobalObject>(),
             8usize,
             concat!("Alignment of ", stringify!(nsIScriptGlobalObject))
         );
     }
     #[repr(C)]
     #[derive(Debug, Copy)]
-    pub struct nsIObserver {
-        pub _base: root::nsISupports,
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsIObserver_COMTypeInfo {
-        pub _address: u8,
-    }
-    #[test]
-    fn bindgen_test_layout_nsIObserver() {
-        assert_eq!(
-            ::std::mem::size_of::<nsIObserver>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsIObserver))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsIObserver>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsIObserver))
-        );
-    }
-    impl Clone for nsIObserver {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsIXPConnectJSObjectHolder {
-        pub _base: root::nsISupports,
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsIXPConnectJSObjectHolder_COMTypeInfo {
-        pub _address: u8,
-    }
-    #[test]
-    fn bindgen_test_layout_nsIXPConnectJSObjectHolder() {
-        assert_eq!(
-            ::std::mem::size_of::<nsIXPConnectJSObjectHolder>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsIXPConnectJSObjectHolder))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsIXPConnectJSObjectHolder>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsIXPConnectJSObjectHolder))
-        );
-    }
-    impl Clone for nsIXPConnectJSObjectHolder {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsIXPConnectWrappedJS {
-        pub _base: root::nsIXPConnectJSObjectHolder,
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsIXPConnectWrappedJS_COMTypeInfo {
-        pub _address: u8,
-    }
-    #[test]
-    fn bindgen_test_layout_nsIXPConnectWrappedJS() {
-        assert_eq!(
-            ::std::mem::size_of::<nsIXPConnectWrappedJS>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsIXPConnectWrappedJS))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsIXPConnectWrappedJS>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsIXPConnectWrappedJS))
-        );
-    }
-    impl Clone for nsIXPConnectWrappedJS {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsIXPConnect {
-        pub _base: root::nsISupports,
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsIXPConnect_COMTypeInfo {
-        pub _address: u8,
-    }
-    #[test]
-    fn bindgen_test_layout_nsIXPConnect() {
-        assert_eq!(
-            ::std::mem::size_of::<nsIXPConnect>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsIXPConnect))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsIXPConnect>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsIXPConnect))
-        );
-    }
-    impl Clone for nsIXPConnect {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
     pub struct nsIURI {
         pub _base: root::nsISupports,
     }
     #[repr(C)]
     #[derive(Debug, Copy, Clone)]
     pub struct nsIURI_COMTypeInfo {
         pub _address: u8,
     }
@@ -19915,16 +19824,44 @@ pub mod root {
         );
     }
     impl Clone for nsIURI {
         fn clone(&self) -> Self {
             *self
         }
     }
     #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsIUUIDGenerator {
+        pub _base: root::nsISupports,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsIUUIDGenerator_COMTypeInfo {
+        pub _address: u8,
+    }
+    #[test]
+    fn bindgen_test_layout_nsIUUIDGenerator() {
+        assert_eq!(
+            ::std::mem::size_of::<nsIUUIDGenerator>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsIUUIDGenerator))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsIUUIDGenerator>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsIUUIDGenerator))
+        );
+    }
+    impl Clone for nsIUUIDGenerator {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    #[repr(C)]
     #[derive(Debug, Copy, Clone)]
     pub struct nsIControllers {
         _unused: [u8; 0],
     }
     #[repr(C)]
     #[derive(Debug, Copy)]
     pub struct mozIDOMWindow {
         pub _base: root::nsISupports,
@@ -20745,205 +20682,199 @@ pub mod root {
             concat!(
                 "Offset of field: ",
                 stringify!(nsPIDOMWindowOuter),
                 "::",
                 stringify!(mOpenerForInitialContentBrowser)
             )
         );
     }
-    pub mod xpc {
-        #[allow(unused_imports)]
-        use self::super::super::root;
-    }
-    #[repr(u32)]
-    #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
-    pub enum nsCompatibility {
-        eCompatibility_FullStandards = 1,
-        eCompatibility_AlmostStandards = 2,
-        eCompatibility_NavQuirks = 3,
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsILoadGroup {
-        pub _base: root::nsIRequest,
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsILoadGroup_COMTypeInfo {
-        pub _address: u8,
-    }
-    #[test]
-    fn bindgen_test_layout_nsILoadGroup() {
-        assert_eq!(
-            ::std::mem::size_of::<nsILoadGroup>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsILoadGroup))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsILoadGroup>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsILoadGroup))
-        );
-    }
-    impl Clone for nsILoadGroup {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsIRequestObserver {
-        pub _base: root::nsISupports,
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsIRequestObserver_COMTypeInfo {
-        pub _address: u8,
-    }
-    #[test]
-    fn bindgen_test_layout_nsIRequestObserver() {
-        assert_eq!(
-            ::std::mem::size_of::<nsIRequestObserver>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsIRequestObserver))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsIRequestObserver>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsIRequestObserver))
-        );
-    }
-    impl Clone for nsIRequestObserver {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsIStreamListener {
-        pub _base: root::nsIRequestObserver,
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsIStreamListener_COMTypeInfo {
-        pub _address: u8,
-    }
-    #[test]
-    fn bindgen_test_layout_nsIStreamListener() {
-        assert_eq!(
-            ::std::mem::size_of::<nsIStreamListener>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsIStreamListener))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsIStreamListener>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsIStreamListener))
-        );
-    }
-    impl Clone for nsIStreamListener {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsParserBase {
-        pub _base: root::nsISupports,
-    }
-    #[test]
-    fn bindgen_test_layout_nsParserBase() {
-        assert_eq!(
-            ::std::mem::size_of::<nsParserBase>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsParserBase))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsParserBase>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsParserBase))
-        );
-    }
-    impl Clone for nsParserBase {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    /// This GECKO-INTERNAL interface is on track to being REMOVED (or refactored
-    /// to the point of being near-unrecognizable).
-    ///
-    /// Please DO NOT #include this file in comm-central code, in your XULRunner
-    /// app or binary extensions.
-    ///
-    /// Please DO NOT #include this into new files even inside Gecko. It is more
-    /// likely than not that #including this header is the wrong thing to do.
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsIParser {
-        pub _base: root::nsParserBase,
-    }
-    pub type nsIParser_Encoding = root::mozilla::Encoding;
-    pub type nsIParser_NotNull<T> = root::mozilla::NotNull<T>;
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsIParser_COMTypeInfo {
-        pub _address: u8,
-    }
-    #[test]
-    fn bindgen_test_layout_nsIParser() {
-        assert_eq!(
-            ::std::mem::size_of::<nsIParser>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsIParser))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsIParser>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsIParser))
-        );
-    }
-    impl Clone for nsIParser {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy)]
-    pub struct nsIUUIDGenerator {
-        pub _base: root::nsISupports,
-    }
-    #[repr(C)]
-    #[derive(Debug, Copy, Clone)]
-    pub struct nsIUUIDGenerator_COMTypeInfo {
-        pub _address: u8,
-    }
-    #[test]
-    fn bindgen_test_layout_nsIUUIDGenerator() {
-        assert_eq!(
-            ::std::mem::size_of::<nsIUUIDGenerator>(),
-            8usize,
-            concat!("Size of: ", stringify!(nsIUUIDGenerator))
-        );
-        assert_eq!(
-            ::std::mem::align_of::<nsIUUIDGenerator>(),
-            8usize,
-            concat!("Alignment of ", stringify!(nsIUUIDGenerator))
-        );
-    }
-    impl Clone for nsIUUIDGenerator {
-        fn clone(&self) -> Self {
-            *self
-        }
-    }
     #[repr(C)]
     #[derive(Debug, Copy, Clone)]
     pub struct nsContentList {
         _unused: [u8; 0],
     }
+    /// The signature of the timer callback function passed to initWithFuncCallback.
+    /// This is the function that will get called when the timer expires if the
+    /// timer is initialized via initWithFuncCallback.
+    ///
+    /// @param aTimer the timer which has expired
+    /// @param aClosure opaque parameter passed to initWithFuncCallback
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsITimer {
+        pub _base: root::nsISupports,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsITimer_COMTypeInfo {
+        pub _address: u8,
+    }
+    pub const nsITimer_TYPE_ONE_SHOT: root::nsITimer__bindgen_ty_1 = 0;
+    pub const nsITimer_TYPE_REPEATING_SLACK: root::nsITimer__bindgen_ty_1 = 1;
+    pub const nsITimer_TYPE_REPEATING_PRECISE: root::nsITimer__bindgen_ty_1 = 2;
+    pub const nsITimer_TYPE_REPEATING_PRECISE_CAN_SKIP: root::nsITimer__bindgen_ty_1 = 3;
+    pub const nsITimer_TYPE_REPEATING_SLACK_LOW_PRIORITY: root::nsITimer__bindgen_ty_1 = 4;
+    pub const nsITimer_TYPE_ONE_SHOT_LOW_PRIORITY: root::nsITimer__bindgen_ty_1 = 5;
+    pub type nsITimer__bindgen_ty_1 = u32;
+    #[test]
+    fn bindgen_test_layout_nsITimer() {
+        assert_eq!(
+            ::std::mem::size_of::<nsITimer>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsITimer))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsITimer>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsITimer))
+        );
+    }
+    impl Clone for nsITimer {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsIRunnable {
+        pub _base: root::nsISupports,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsIRunnable_COMTypeInfo {
+        pub _address: u8,
+    }
+    #[test]
+    fn bindgen_test_layout_nsIRunnable() {
+        assert_eq!(
+            ::std::mem::size_of::<nsIRunnable>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsIRunnable))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsIRunnable>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsIRunnable))
+        );
+    }
+    impl Clone for nsIRunnable {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsIEventTarget {
+        pub _base: root::nsISupports,
+        pub mVirtualThread: *mut root::PRThread,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsIEventTarget_COMTypeInfo {
+        pub _address: u8,
+    }
+    pub const nsIEventTarget_DISPATCH_NORMAL: root::nsIEventTarget__bindgen_ty_1 = 0;
+    pub const nsIEventTarget_DISPATCH_SYNC: root::nsIEventTarget__bindgen_ty_1 = 1;
+    pub const nsIEventTarget_DISPATCH_AT_END: root::nsIEventTarget__bindgen_ty_1 = 2;
+    pub type nsIEventTarget__bindgen_ty_1 = u32;
+    #[test]
+    fn bindgen_test_layout_nsIEventTarget() {
+        assert_eq!(
+            ::std::mem::size_of::<nsIEventTarget>(),
+            16usize,
+            concat!("Size of: ", stringify!(nsIEventTarget))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsIEventTarget>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsIEventTarget))
+        );
+        assert_eq!(
+            unsafe {
+                &(*(::std::ptr::null::<nsIEventTarget>())).mVirtualThread as *const _ as usize
+            },
+            8usize,
+            concat!(
+                "Offset of field: ",
+                stringify!(nsIEventTarget),
+                "::",
+                stringify!(mVirtualThread)
+            )
+        );
+    }
+    impl Clone for nsIEventTarget {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsIObserver {
+        pub _base: root::nsISupports,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsIObserver_COMTypeInfo {
+        pub _address: u8,
+    }
+    #[test]
+    fn bindgen_test_layout_nsIObserver() {
+        assert_eq!(
+            ::std::mem::size_of::<nsIObserver>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsIObserver))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsIObserver>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsIObserver))
+        );
+    }
+    impl Clone for nsIObserver {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsINamed {
+        pub _base: root::nsISupports,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsINamed_COMTypeInfo {
+        pub _address: u8,
+    }
+    #[test]
+    fn bindgen_test_layout_nsINamed() {
+        assert_eq!(
+            ::std::mem::size_of::<nsINamed>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsINamed))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsINamed>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsINamed))
+        );
+    }
+    impl Clone for nsINamed {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    pub type nsRunnableMethod_BaseType = u8;
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsRunnableMethod_ReturnTypeEnforcer {
+        pub _address: u8,
+    }
+    pub type nsRunnableMethod_ReturnTypeEnforcer_ReturnTypeIsSafe = ::std::os::raw::c_int;
+    pub type nsRunnableMethod_check = root::nsRunnableMethod_ReturnTypeEnforcer;
     #[repr(C)]
     #[derive(Debug, Copy, Clone)]
     pub struct nsIIOService {
         _unused: [u8; 0],
     }
     #[repr(C)]
     #[derive(Debug, Copy, Clone)]
     pub struct nsIStringBundleService {
@@ -23433,16 +23364,150 @@ pub mod root {
                 let mIsScopedStyleEnabled: u32 =
                     unsafe { ::std::mem::transmute(mIsScopedStyleEnabled) };
                 mIsScopedStyleEnabled as u64
             });
             __bindgen_bitfield_unit
         }
     }
     #[repr(C)]
+    #[derive(Debug)]
+    pub struct nsLanguageAtomService {
+        pub mLangToGroup: [u64; 4usize],
+        pub mLocaleLanguage: root::RefPtr<root::nsAtom>,
+    }
+    pub type nsLanguageAtomService_Encoding = root::mozilla::Encoding;
+    pub type nsLanguageAtomService_NotNull<T> = root::mozilla::NotNull<T>;
+    #[test]
+    fn bindgen_test_layout_nsLanguageAtomService() {
+        assert_eq!(
+            ::std::mem::size_of::<nsLanguageAtomService>(),
+            40usize,
+            concat!("Size of: ", stringify!(nsLanguageAtomService))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsLanguageAtomService>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsLanguageAtomService))
+        );
+        assert_eq!(
+            unsafe {
+                &(*(::std::ptr::null::<nsLanguageAtomService>())).mLangToGroup as *const _ as usize
+            },
+            0usize,
+            concat!(
+                "Offset of field: ",
+                stringify!(nsLanguageAtomService),
+                "::",
+                stringify!(mLangToGroup)
+            )
+        );
+        assert_eq!(
+            unsafe {
+                &(*(::std::ptr::null::<nsLanguageAtomService>())).mLocaleLanguage as *const _
+                    as usize
+            },
+            32usize,
+            concat!(
+                "Offset of field: ",
+                stringify!(nsLanguageAtomService),
+                "::",
+                stringify!(mLocaleLanguage)
+            )
+        );
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsIXPConnectJSObjectHolder {
+        pub _base: root::nsISupports,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsIXPConnectJSObjectHolder_COMTypeInfo {
+        pub _address: u8,
+    }
+    #[test]
+    fn bindgen_test_layout_nsIXPConnectJSObjectHolder() {
+        assert_eq!(
+            ::std::mem::size_of::<nsIXPConnectJSObjectHolder>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsIXPConnectJSObjectHolder))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsIXPConnectJSObjectHolder>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsIXPConnectJSObjectHolder))
+        );
+    }
+    impl Clone for nsIXPConnectJSObjectHolder {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsIXPConnectWrappedJS {
+        pub _base: root::nsIXPConnectJSObjectHolder,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsIXPConnectWrappedJS_COMTypeInfo {
+        pub _address: u8,
+    }
+    #[test]
+    fn bindgen_test_layout_nsIXPConnectWrappedJS() {
+        assert_eq!(
+            ::std::mem::size_of::<nsIXPConnectWrappedJS>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsIXPConnectWrappedJS))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsIXPConnectWrappedJS>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsIXPConnectWrappedJS))
+        );
+    }
+    impl Clone for nsIXPConnectWrappedJS {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
+    pub struct nsIXPConnect {
+        pub _base: root::nsISupports,
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy, Clone)]
+    pub struct nsIXPConnect_COMTypeInfo {
+        pub _address: u8,
+    }
+    #[test]
+    fn bindgen_test_layout_nsIXPConnect() {
+        assert_eq!(
+            ::std::mem::size_of::<nsIXPConnect>(),
+            8usize,
+            concat!("Size of: ", stringify!(nsIXPConnect))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<nsIXPConnect>(),
+            8usize,
+            concat!("Alignment of ", stringify!(nsIXPConnect))
+        );
+    }
+    impl Clone for nsIXPConnect {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    pub mod xpc {
+        #[allow(unused_imports)]
+        use self::super::super::root;
+    }
+    #[repr(C)]
     #[derive(Debug, Copy, Clone)]
     pub struct nsBidi {
         _unused: [u8; 0],
     }
     #[repr(C)]
     #[derive(Debug, Copy, Clone)]
     pub struct nsIPrintSettings {
         _unused: [u8; 0],
@@ -23549,17 +23614,17 @@ pub mod root {
         pub mFirstMouseMoveTime: root::mozilla::TimeStamp,
         pub mFirstScrollTime: root::mozilla::TimeStamp,
         pub mInteractionTimeEnabled: bool,
         pub mLastStyleUpdateForAllAnimations: root::mozilla::TimeStamp,
         pub mTelemetryScrollLastY: root::nscoord,
         pub mTelemetryScrollMaxY: root::nscoord,
         pub mTelemetryScrollTotalY: root::nscoord,
         pub _bitfield_1: root::__BindgenBitfieldUnit<[u8; 6usize], u8>,
-        pub __bindgen_padding_0: [u16; 3usize],
+        pub mPendingMediaFeatureValuesChange: [u32; 4usize],
     }
     pub type nsPresContext_Encoding = root::mozilla::Encoding;
     pub type nsPresContext_NotNull<T> = root::mozilla::NotNull<T>;
     pub type nsPresContext_LangGroupFontPrefs = root::mozilla::LangGroupFontPrefs;
     pub type nsPresContext_ScrollbarStyles = root::mozilla::ScrollbarStyles;
     pub type nsPresContext_StaticPresData = root::mozilla::StaticPresData;
     pub type nsPresContext_HasThreadSafeRefCnt = root::mozilla::FalseType;
     #[repr(C)]
@@ -23720,17 +23785,17 @@ pub mod root {
     extern "C" {
         #[link_name = "\u{1}_ZN13nsPresContext21_cycleCollectorGlobalE"]
         pub static mut nsPresContext__cycleCollectorGlobal: root::nsPresContext_cycleCollection;
     }
     #[test]
     fn bindgen_test_layout_nsPresContext() {
         assert_eq!(
             ::std::mem::size_of::<nsPresContext>(),
-            1384usize,
+            1400usize,
             concat!("Size of: ", stringify!(nsPresContext))
         );
         assert_eq!(
             ::std::mem::align_of::<nsPresContext>(),
             8usize,
             concat!("Alignment of ", stringify!(nsPresContext))
         );
         assert_eq!(
@@ -24594,16 +24659,29 @@ pub mod root {
             1368usize,
             concat!(
                 "Offset of field: ",
                 stringify!(nsPresContext),
                 "::",
                 stringify!(mTelemetryScrollTotalY)
             )
         );
+        assert_eq!(
+            unsafe {
+                &(*(::std::ptr::null::<nsPresContext>())).mPendingMediaFeatureValuesChange
+                    as *const _ as usize
+            },
+            1380usize,
+            concat!(
+                "Offset of field: ",
+                stringify!(nsPresContext),
+                "::",
+                stringify!(mPendingMediaFeatureValuesChange)
+            )
+        );
     }
     impl nsPresContext {
         #[inline]
         pub fn mHasPendingInterrupt(&self) -> ::std::os::raw::c_uint {
             unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mHasPendingInterrupt(&mut self, val: ::std::os::raw::c_uint) {
@@ -24850,247 +24928,225 @@ pub mod root {
         #[inline]
         pub fn set_mPendingUIResolutionChanged(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
                 self._bitfield_1.set(23usize, 1u8, val as u64)
             }
         }
         #[inline]
-        pub fn mPendingMediaFeatureValuesChanged(&self) -> ::std::os::raw::c_uint {
+        pub fn mPrefChangePendingNeedsReflow(&self) -> ::std::os::raw::c_uint {
             unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u32) }
         }
         #[inline]
-        pub fn set_mPendingMediaFeatureValuesChanged(&mut self, val: ::std::os::raw::c_uint) {
+        pub fn set_mPrefChangePendingNeedsReflow(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
                 self._bitfield_1.set(24usize, 1u8, val as u64)
             }
         }
         #[inline]
-        pub fn mPrefChangePendingNeedsReflow(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u32) }
-        }
-        #[inline]
-        pub fn set_mPrefChangePendingNeedsReflow(&mut self, val: ::std::os::raw::c_uint) {
-            unsafe {
-                let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(25usize, 1u8, val as u64)
-            }
-        }
-        #[inline]
         pub fn mIsEmulatingMedia(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mIsEmulatingMedia(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(26usize, 1u8, val as u64)
+                self._bitfield_1.set(25usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mIsGlyph(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mIsGlyph(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(27usize, 1u8, val as u64)
+                self._bitfield_1.set(26usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mUsesRootEMUnits(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mUsesRootEMUnits(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(28usize, 1u8, val as u64)
+                self._bitfield_1.set(27usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mUsesExChUnits(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mUsesExChUnits(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(29usize, 1u8, val as u64)
-            }
-        }
-        #[inline]
-        pub fn mPendingViewportChange(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u32) }
-        }
-        #[inline]
-        pub fn set_mPendingViewportChange(&mut self, val: ::std::os::raw::c_uint) {
-            unsafe {
-                let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(30usize, 1u8, val as u64)
+                self._bitfield_1.set(28usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mCounterStylesDirty(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mCounterStylesDirty(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(31usize, 1u8, val as u64)
+                self._bitfield_1.set(29usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mFontFeatureValuesDirty(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mFontFeatureValuesDirty(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(32usize, 1u8, val as u64)
+                self._bitfield_1.set(30usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mSuppressResizeReflow(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(33usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mSuppressResizeReflow(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(33usize, 1u8, val as u64)
+                self._bitfield_1.set(31usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mIsVisual(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(34usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mIsVisual(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(34usize, 1u8, val as u64)
+                self._bitfield_1.set(32usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mFireAfterPaintEvents(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(35usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(33usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mFireAfterPaintEvents(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(35usize, 1u8, val as u64)
+                self._bitfield_1.set(33usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mIsChrome(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(36usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(34usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mIsChrome(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(36usize, 1u8, val as u64)
+                self._bitfield_1.set(34usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mIsChromeOriginImage(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(37usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(35usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mIsChromeOriginImage(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(37usize, 1u8, val as u64)
+                self._bitfield_1.set(35usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mPaintFlashing(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(38usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(36usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mPaintFlashing(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(38usize, 1u8, val as u64)
+                self._bitfield_1.set(36usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mPaintFlashingInitialized(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(39usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(37usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mPaintFlashingInitialized(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(39usize, 1u8, val as u64)
+                self._bitfield_1.set(37usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mHasWarnedAboutPositionedTableParts(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(38usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mHasWarnedAboutPositionedTableParts(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(40usize, 1u8, val as u64)
+                self._bitfield_1.set(38usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mHasWarnedAboutTooLargeDashedOrDottedRadius(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(41usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(39usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mHasWarnedAboutTooLargeDashedOrDottedRadius(
             &mut self,
             val: ::std::os::raw::c_uint,
         ) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(41usize, 1u8, val as u64)
+                self._bitfield_1.set(39usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mQuirkSheetAdded(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(42usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mQuirkSheetAdded(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(42usize, 1u8, val as u64)
+                self._bitfield_1.set(40usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mNeedsPrefUpdate(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(43usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(41usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mNeedsPrefUpdate(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(43usize, 1u8, val as u64)
+                self._bitfield_1.set(41usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn mHadNonBlankPaint(&self) -> ::std::os::raw::c_uint {
-            unsafe { ::std::mem::transmute(self._bitfield_1.get(44usize, 1u8) as u32) }
+            unsafe { ::std::mem::transmute(self._bitfield_1.get(42usize, 1u8) as u32) }
         }
         #[inline]
         pub fn set_mHadNonBlankPaint(&mut self, val: ::std::os::raw::c_uint) {
             unsafe {
                 let val: u32 = ::std::mem::transmute(val);
-                self._bitfield_1.set(44usize, 1u8, val as u64)
+                self._bitfield_1.set(42usize, 1u8, val as u64)
             }
         }
         #[inline]
         pub fn new_bitfield_1(
             mHasPendingInterrupt: ::std::os::raw::c_uint,
             mPendingInterruptFromTest: ::std::os::raw::c_uint,
             mInterruptsEnabled: ::std::os::raw::c_uint,
             mUseDocumentFonts: ::std::os::raw::c_uint,
@@ -25108,23 +25164,21 @@ pub mod root {
             mCanPaginatedScroll: ::std::os::raw::c_uint,
             mDoScaledTwips: ::std::os::raw::c_uint,
             mIsRootPaginatedDocument: ::std::os::raw::c_uint,
             mPrefBidiDirection: ::std::os::raw::c_uint,
             mPrefScrollbarSide: ::std::os::raw::c_uint,
             mPendingSysColorChanged: ::std::os::raw::c_uint,
             mPendingThemeChanged: ::std::os::raw::c_uint,
             mPendingUIResolutionChanged: ::std::os::raw::c_uint,
-            mPendingMediaFeatureValuesChanged: ::std::os::raw::c_uint,
             mPrefChangePendingNeedsReflow: ::std::os::raw::c_uint,
             mIsEmulatingMedia: ::std::os::raw::c_uint,
             mIsGlyph: ::std::os::raw::c_uint,
             mUsesRootEMUnits: ::std::os::raw::c_uint,
             mUsesExChUnits: ::std::os::raw::c_uint,
-            mPendingViewportChange: ::std::os::raw::c_uint,
             mCounterStylesDirty: ::std::os::raw::c_uint,
             mFontFeatureValuesDirty: ::std::os::raw::c_uint,
             mSuppressResizeReflow: ::std::os::raw::c_uint,
             mIsVisual: ::std::os::raw::c_uint,
             mFireAfterPaintEvents: ::std::os::raw::c_uint,
             mIsChrome: ::std::os::raw::c_uint,
             mIsChromeOriginImage: ::std::os::raw::c_uint,
             mPaintFlashing: ::std::os::raw::c_uint,
@@ -25239,107 +25293,97 @@ pub mod root {
                 mPendingThemeChanged as u64
             });
             __bindgen_bitfield_unit.set(23usize, 1u8, {
                 let mPendingUIResolutionChanged: u32 =
                     unsafe { ::std::mem::transmute(mPendingUIResolutionChanged) };
                 mPendingUIResolutionChanged as u64
             });
             __bindgen_bitfield_unit.set(24usize, 1u8, {
-                let mPendingMediaFeatureValuesChanged: u32 =
-                    unsafe { ::std::mem::transmute(mPendingMediaFeatureValuesChanged) };
-                mPendingMediaFeatureValuesChanged as u64
-            });
-            __bindgen_bitfield_unit.set(25usize, 1u8, {
                 let mPrefChangePendingNeedsReflow: u32 =
                     unsafe { ::std::mem::transmute(mPrefChangePendingNeedsReflow) };
                 mPrefChangePendingNeedsReflow as u64
             });
-            __bindgen_bitfield_unit.set(26usize, 1u8, {
+            __bindgen_bitfield_unit.set(25usize, 1u8, {
                 let mIsEmulatingMedia: u32 = unsafe { ::std::mem::transmute(mIsEmulatingMedia) };
                 mIsEmulatingMedia as u64
             });
+            __bindgen_bitfield_unit.set(26usize, 1u8, {
+                let mIsGlyph: u32 = unsafe { ::std::mem::transmute(mIsGlyph) };
+                mIsGlyph as u64
+            });
             __bindgen_bitfield_unit.set(27usize, 1u8, {
-                let mIsGlyph: u32 = unsafe { ::std::mem::transmute(mIsGlyph) };
-                mIsGlyph as u64
-            });
-            __bindgen_bitfield_unit.set(28usize, 1u8, {
                 let mUsesRootEMUnits: u32 = unsafe { ::std::mem::transmute(mUsesRootEMUnits) };
                 mUsesRootEMUnits as u64
             });
-            __bindgen_bitfield_unit.set(29usize, 1u8, {
+            __bindgen_bitfield_unit.set(28usize, 1u8, {
                 let mUsesExChUnits: u32 = unsafe { ::std::mem::transmute(mUsesExChUnits) };
                 mUsesExChUnits as u64
             });
-            __bindgen_bitfield_unit.set(30usize, 1u8, {
-                let mPendingViewportChange: u32 =
-                    unsafe { ::std::mem::transmute(mPendingViewportChange) };
-                mPendingViewportChange as u64
-            });
-            __bindgen_bitfield_unit.set(31usize, 1u8, {
+            __bindgen_bitfield_unit.set(29usize, 1u8, {
                 let mCounterStylesDirty: u32 =
                     unsafe { ::std::mem::transmute(mCounterStylesDirty) };
                 mCounterStylesDirty as u64
             });
-            __bindgen_bitfield_unit.set(32usize, 1u8, {
+            __bindgen_bitfield_unit.set(30usize, 1u8, {
                 let mFontFeatureValuesDirty: u32 =
                     unsafe { ::std::mem::transmute(mFontFeatureValuesDirty) };
                 mFontFeatureValuesDirty as u64
             });
-            __bindgen_bitfield_unit.set(33usize, 1u8, {
+            __bindgen_bitfield_unit.set(31usize, 1u8, {
                 let mSuppressResizeReflow: u32 =
                     unsafe { ::std::mem::transmute(mSuppressResizeReflow) };
                 mSuppressResizeReflow as u64
             });
-            __bindgen_bitfield_unit.set(34usize, 1u8, {
+            __bindgen_bitfield_unit.set(32usize, 1u8, {
                 let mIsVisual: u32 = unsafe { ::std::mem::transmute(mIsVisual) };
                 mIsVisual as u64
             });
-            __bindgen_bitfield_unit.set(35usize, 1u8, {
+            __bindgen_bitfield_unit.set(33usize, 1u8, {
                 let mFireAfterPaintEvents: u32 =
                     unsafe { ::std::mem::transmute(mFireAfterPaintEvents) };
                 mFireAfterPaintEvents as u64
             });
-            __bindgen_bitfield_unit.set(36usize, 1u8, {
+            __bindgen_bitfield_unit.set(34usize, 1u8, {
                 let mIsChrome: u32 = unsafe { ::std::mem::transmute(mIsChrome) };
                 mIsChrome as u64
             });
-            __bindgen_bitfield_unit.set(37usize, 1u8, {
+            __bindgen_bitfield_unit.set(35usize, 1u8, {
                 let mIsChromeOriginImage: u32 =
                     unsafe { ::std::mem::transmute(mIsChromeOriginImage) };
                 mIsChromeOriginImage as u64
             });
-            __bindgen_bitfield_unit.set(38usize, 1u8, {
+            __bindgen_bitfield_unit.set(36usize, 1u8, {
                 let mPaintFlashing: u32 = unsafe { ::std::mem::transmute(mPaintFlashing) };
                 mPaintFlashing as u64
             });
-            __bindgen_bitfield_unit.set(39usize, 1u8, {
+            __bindgen_bitfield_unit.set(37usize, 1u8, {
                 let mPaintFlashingInitialized: u32 =
                     unsafe { ::std::mem::transmute(mPaintFlashingInitialized) };
                 mPaintFlashingInitialized as u64
             });
-            __bindgen_bitfield_unit.set(40usize, 1u8, {
+            __bindgen_bitfield_unit.set(38usize, 1u8, {
                 let mHasWarnedAboutPositionedTableParts: u32 =
                     unsafe { ::std::mem::transmute(mHasWarnedAboutPositionedTableParts) };
                 mHasWarnedAboutPositionedTableParts as u64
             });
-            __bindgen_bitfield_unit.set(41usize, 1u8, {
+            __bindgen_bitfield_unit.set(39usize, 1u8, {
                 let mHasWarnedAboutTooLargeDashedOrDottedRadius: u32 =
                     unsafe { ::std::mem::transmute(mHasWarnedAboutTooLargeDashedOrDottedRadius) };
                 mHasWarnedAboutTooLargeDashedOrDottedRadius as u64
             });
-            __bindgen_bitfield_unit.set(42usize, 1u8, {
+            __bindgen_bitfield_unit.set(40usize, 1u8, {
                 let mQuirkSheetAdded: u32 = unsafe { ::std::mem::transmute(mQuirkSheetAdded) };
                 mQuirkSheetAdded as u64
             });
-            __bindgen_bitfield_unit.set(43usize, 1u8, {
+            __bindgen_bitfield_unit.set(41usize, 1u8, {
                 let mNeedsPrefUpdate: u32 = unsafe { ::std::mem::transmute(mNeedsPrefUpdate) };
                 mNeedsPrefUpdate as u64
             });
-            __bindgen_bitfield_unit.set(44usize, 1u8, {
+            __bindgen_bitfield_unit.set(42usize, 1u8, {
                 let mHadNonBlankPaint: u32 = unsafe { ::std::mem::transmute(mHadNonBlankPaint) };
                 mHadNonBlankPaint as u64
             });
             __bindgen_bitfield_unit
         }
     }
     #[repr(i16)]
     #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
@@ -36984,16 +37028,80 @@ pub mod root {
     }
     impl Clone for FontSizePrefs {
         fn clone(&self) -> Self {
             *self
         }
     }
     #[repr(C)]
     #[derive(Debug, Copy)]
+    pub struct MediumFeaturesChangedResult {
+        pub mAffectsDocumentRules: bool,
+        pub mAffectsNonDocumentRules: bool,
+        pub mUsesViewportUnits: bool,
+    }
+    #[test]
+    fn bindgen_test_layout_MediumFeaturesChangedResult() {
+        assert_eq!(
+            ::std::mem::size_of::<MediumFeaturesChangedResult>(),
+            3usize,
+            concat!("Size of: ", stringify!(MediumFeaturesChangedResult))
+        );
+        assert_eq!(
+            ::std::mem::align_of::<MediumFeaturesChangedResult>(),
+            1usize,
+            concat!("Alignment of ", stringify!(MediumFeaturesChangedResult))
+        );
+        assert_eq!(
+            unsafe {
+                &(*(::std::ptr::null::<MediumFeaturesChangedResult>())).mAffectsDocumentRules
+                    as *const _ as usize
+            },
+            0usize,
+            concat!(
+                "Offset of field: ",
+                stringify!(MediumFeaturesChangedResult),
+                "::",
+                stringify!(mAffectsDocumentRules)
+            )
+        );
+        assert_eq!(
+            unsafe {
+                &(*(::std::ptr::null::<MediumFeaturesChangedResult>())).mAffectsNonDocumentRules
+                    as *const _ as usize
+            },
+            1usize,
+            concat!(
+                "Offset of field: ",
+                stringify!(MediumFeaturesChangedResult),
+                "::",
+                stringify!(mAffectsNonDocumentRules)
+            )
+        );
+        assert_eq!(
+            unsafe {
+                &(*(::std::ptr::null::<MediumFeaturesChangedResult>())).mUsesViewportUnits
+                    as *const _ as usize
+            },
+            2usize,
+            concat!(
+                "Offset of field: ",
+                stringify!(MediumFeaturesChangedResult),
+                "::",
+                stringify!(mUsesViewportUnits)
+            )
+        );
+    }
+    impl Clone for MediumFeaturesChangedResult {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+    #[repr(C)]
+    #[derive(Debug, Copy)]
     pub struct GeckoFontMetrics {
         pub mChSize: root::nscoord,
         pub mXSize: root::nscoord,
     }
     #[test]
     fn bindgen_test_layout_GeckoFontMetrics() {
         assert_eq!(
             ::std::mem::size_of::<GeckoFontMetrics>(),
@@ -39485,54 +39593,16 @@ pub mod root {
             8usize,
             concat!(
                 "Alignment of template specialization: ",
                 stringify!(root::nsPtrHashKey<root::WeakFrame>)
             )
         );
     }
     #[test]
-    fn __bindgen_test_layout_nsRefPtrHashKey_open0_nsAtom_close0_instantiation() {
-        assert_eq!(
-            ::std::mem::size_of::<root::nsRefPtrHashKey<root::nsAtom>>(),
-            16usize,
-            concat!(
-                "Size of template specialization: ",
-                stringify!(root::nsRefPtrHashKey<root::nsAtom>)
-            )
-        );
-        assert_eq!(
-            ::std::mem::align_of::<root::nsRefPtrHashKey<root::nsAtom>>(),
-            8usize,
-            concat!(
-                "Alignment of template specialization: ",
-                stringify!(root::nsRefPtrHashKey<root::nsAtom>)
-            )
-        );
-    }
-    #[test]
-    fn __bindgen_test_layout_RefPtr_open0_nsAtom_close0_instantiation_1() {
-        assert_eq!(
-            ::std::mem::size_of::<root::RefPtr<root::nsAtom>>(),
-            8usize,
-            concat!(
-                "Size of template specialization: ",
-                stringify!(root::RefPtr<root::nsAtom>)
-            )
-        );
-        assert_eq!(
-            ::std::mem::align_of::<root::RefPtr<root::nsAtom>>(),
-            8usize,
-            concat!(
-                "Alignment of template specialization: ",
-                stringify!(root::RefPtr<root::nsAtom>)
-            )
-        );
-    }
-    #[test]
     fn __bindgen_test_layout_UniquePtr_open0_IPCClientInfo_DefaultDelete_open1_IPCClientInfo_close1_close0_instantiation(
 ) {
         assert_eq!(
             ::std::mem::size_of::<root::mozilla::UniquePtr<root::mozilla::dom::IPCClientInfo>>(),
             8usize,
             concat!(
                 "Size of template specialization: ",
                 stringify!(root::mozilla::UniquePtr<root::mozilla::dom::IPCClientInfo>)
@@ -40066,17 +40136,17 @@ pub mod root {
             8usize,
             concat!(
                 "Alignment of template specialization: ",
                 stringify!(root::nsCOMPtr)
             )
         );
     }
     #[test]
-    fn __bindgen_test_layout_RefPtr_open0_nsAtom_close0_instantiation_2() {
+    fn __bindgen_test_layout_RefPtr_open0_nsAtom_close0_instantiation_1() {
         assert_eq!(
             ::std::mem::size_of::<root::RefPtr<root::nsAtom>>(),
             8usize,
             concat!(
                 "Size of template specialization: ",
                 stringify!(root::RefPtr<root::nsAtom>)
             )
         );
@@ -41287,16 +41357,54 @@ pub mod root {
             8usize,
             concat!(
                 "Alignment of template specialization: ",
                 stringify!(root::nsCOMPtr)
             )
         );
     }
     #[test]
+    fn __bindgen_test_layout_nsRefPtrHashKey_open0_nsAtom_close0_instantiation() {
+        assert_eq!(
+            ::std::mem::size_of::<root::nsRefPtrHashKey<root::nsAtom>>(),
+            16usize,
+            concat!(
+                "Size of template specialization: ",
+                stringify!(root::nsRefPtrHashKey<root::nsAtom>)
+            )
+        );
+        assert_eq!(
+            ::std::mem::align_of::<root::nsRefPtrHashKey<root::nsAtom>>(),
+            8usize,
+            concat!(
+                "Alignment of template specialization: ",
+                stringify!(root::nsRefPtrHashKey<root::nsAtom>)
+            )
+        );
+    }
+    #[test]
+    fn __bindgen_test_layout_RefPtr_open0_nsAtom_close0_instantiation_2() {
+        assert_eq!(
+            ::std::mem::size_of::<root::RefPtr<root::nsAtom>>(),
+            8usize,
+            concat!(
+                "Size of template specialization: ",
+                stringify!(root::RefPtr<root::nsAtom>)
+            )
+        );
+        assert_eq!(
+            ::std::mem::align_of::<root::RefPtr<root::nsAtom>>(),
+            8usize,
+            concat!(
+                "Alignment of template specialization: ",
+                stringify!(root::RefPtr<root::nsAtom>)
+            )
+        );
+    }
+    #[test]
     fn __bindgen_test_layout_RefPtr_open0_nsAtom_close0_instantiation_3() {
         assert_eq!(
             ::std::mem::size_of::<root::RefPtr<root::nsAtom>>(),
             8usize,
             concat!(
                 "Size of template specialization: ",
                 stringify!(root::RefPtr<root::nsAtom>)
             )
--- a/servo/components/style/stylist.rs
+++ b/servo/components/style/stylist.rs
@@ -1084,19 +1084,16 @@ impl Stylist {
     ///
     /// Returns the sheet origins that were actually affected.
     ///
     /// This means that we may need to rebuild style data even if the
     /// stylesheets haven't changed.
     ///
     /// Also, the device that arrives here may need to take the viewport rules
     /// into account.
-    ///
-    /// For Gecko, this is called when XBL bindings are used by different
-    /// documents.
     pub fn set_device(
         &mut self,
         mut device: Device,
         guards: &StylesheetGuards,
     ) -> OriginSet {
         if viewport_rule::enabled() {
             let cascaded_rule = {
                 let stylesheets = self.stylesheets.iter();
@@ -1114,24 +1111,32 @@ impl Stylist {
                 ViewportConstraints::maybe_new(&device, &cascaded_rule, self.quirks_mode);
 
             if let Some(ref constraints) = self.viewport_constraints {
                 device.account_for_viewport_rule(constraints);
             }
         }
 
         self.device = device;
-        self.media_features_change_changed_style(guards)
+        self.media_features_change_changed_style(guards, &self.device)
     }
 
     /// Returns whether, given a media feature change, any previously-applicable
-    /// style has become non-applicable, or vice-versa for each origin.
+    /// style has become non-applicable, or vice-versa for each origin, using
+    /// `device`.
+    ///
+    /// Passing `device` is needed because this is used for XBL in Gecko, which
+    /// can be stale in various ways, so we need to pass the device of the
+    /// document itself, which is what is kept up-to-date.
+    ///
+    /// Arguably XBL should use something more lightweight than a Stylist.
     pub fn media_features_change_changed_style(
         &self,
         guards: &StylesheetGuards,
+        device: &Device,
     ) -> OriginSet {
         debug!("Stylist::media_features_change_changed_style");
 
         let mut origins = OriginSet::empty();
         let stylesheets = self.stylesheets.iter();
 
         for (stylesheet, origin) in stylesheets {
             if origins.contains(origin.into()) {
@@ -1140,17 +1145,17 @@ impl Stylist {
 
             let guard = guards.for_origin(origin);
             let origin_cascade_data =
                 self.cascade_data.borrow_for_origin(origin);
 
             let affected_changed = !origin_cascade_data.media_feature_affected_matches(
                 stylesheet,
                 guard,
-                &self.device,
+                device,
                 self.quirks_mode
             );
 
             if affected_changed {
                 origins |= origin;
             }
         }
 
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -115,17 +115,17 @@ use style::gecko_bindings::structs::nsID
 use style::gecko_bindings::structs::nsStyleTransformMatrix::MatrixTransformOperator;
 use style::gecko_bindings::structs::nsTArray;
 use style::gecko_bindings::structs::nsresult;
 use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI};
 use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong};
 use style::gecko_bindings::sugar::refptr::RefPtr;
 use style::gecko_properties;
 use style::invalidation::element::restyle_hints;
-use style::media_queries::{Device, MediaList, parse_media_query_list};
+use style::media_queries::{MediaList, parse_media_query_list};
 use style::parser::{Parse, ParserContext, self};
 use style::properties::{ComputedValues, DeclarationSource, Importance};
 use style::properties::{LonghandId, LonghandIdSet, PropertyDeclaration, PropertyDeclarationBlock, PropertyId};
 use style::properties::{PropertyDeclarationId, ShorthandId};
 use style::properties::{SourcePropertyDeclaration, StyleBuilder};
 use style::properties::{parse_one_declaration_into, parse_style_attribute};
 use style::properties::animated_properties::AnimationValue;
 use style::properties::animated_properties::compare_property_priority;
@@ -1116,67 +1116,83 @@ pub extern "C" fn Servo_StyleSet_AppendS
     let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
     let data = &mut *data;
     let guard = global_style_data.shared_lock.read();
     let sheet = unsafe { GeckoStyleSheet::new(sheet) };
     data.stylist.append_stylesheet(sheet, &guard);
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_StyleSet_MediumFeaturesChanged(
-    raw_data: RawServoStyleSetBorrowed,
-    viewport_units_used: *mut bool,
-) -> u8 {
+pub unsafe extern "C" fn Servo_StyleSet_MediumFeaturesChanged(
+    document_set: RawServoStyleSetBorrowed,
+    non_document_sets: *const nsTArray<*mut structs::ServoStyleSet>,
+    may_affect_default_style: bool,
+) -> structs::MediumFeaturesChangedResult {
     let global_style_data = &*GLOBAL_STYLE_DATA;
     let guard = global_style_data.shared_lock.read();
 
     // NOTE(emilio): We don't actually need to flush the stylist here and ensure
     // it's up to date.
     //
     // In case it isn't we would trigger a rebuild + restyle as needed too.
     //
     // We need to ensure the default computed values are up to date though,
     // because those can influence the result of media query evaluation.
-    //
-    // FIXME(emilio, bug 1369984): do the computation conditionally, to do it
-    // less often.
-    let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
-
-    unsafe {
-        *viewport_units_used = data.stylist.device().used_viewport_size();
+    let mut document_data =
+        PerDocumentStyleData::from_ffi(document_set).borrow_mut();
+
+    if may_affect_default_style {
+        document_data.stylist.device_mut().reset_computed_values();
     }
-    data.stylist.device_mut().reset_computed_values();
     let guards = StylesheetGuards::same(&guard);
+
     let origins_in_which_rules_changed =
-        data.stylist.media_features_change_changed_style(&guards);
-
-    // We'd like to return `OriginFlags` here, but bindgen bitfield enums don't
-    // work as return values with the Linux 32-bit ABI at the moment because
-    // they wrap the value in a struct, so for now just unwrap it.
-    OriginFlags::from(origins_in_which_rules_changed).0
-}
-
-#[no_mangle]
-pub extern "C" fn Servo_StyleSet_SetDevice(
-    raw_data: RawServoStyleSetBorrowed,
-    pres_context: RawGeckoPresContextOwned
-) -> u8 {
-    let global_style_data = &*GLOBAL_STYLE_DATA;
-    let guard = global_style_data.shared_lock.read();
-
-    let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
-    let device = Device::new(pres_context);
-    let guards = StylesheetGuards::same(&guard);
-    let origins_in_which_rules_changed =
-        data.stylist.set_device(device, &guards);
-
-    // We'd like to return `OriginFlags` here, but bindgen bitfield enums don't
-    // work as return values with the Linux 32-bit ABI at the moment because
-    // they wrap the value in a struct, so for now just unwrap it.
-    OriginFlags::from(origins_in_which_rules_changed).0
+        document_data.stylist.media_features_change_changed_style(
+            &guards,
+            document_data.stylist.device(),
+        );
+
+    let affects_document_rules = !origins_in_which_rules_changed.is_empty();
+    if affects_document_rules {
+        document_data.stylist.force_stylesheet_origins_dirty(origins_in_which_rules_changed);
+    }
+
+    let mut affects_non_document_rules = false;
+    for non_document_style_set in &**non_document_sets {
+        let non_document_data = &*(**non_document_style_set).mRawSet.mPtr;
+        let non_document_data =
+            mem::transmute::<&structs::RawServoStyleSet, &bindings::RawServoStyleSet>(non_document_data);
+        let mut non_document_data =
+            PerDocumentStyleData::from_ffi(non_document_data).borrow_mut();
+
+        let origins_changed =
+            non_document_data.stylist.media_features_change_changed_style(
+                &guards,
+                document_data.stylist.device(),
+            );
+        if !origins_changed.is_empty() {
+            affects_non_document_rules = true;
+            // XBL stylesets are rebuilt entirely, so we need to mark them
+            // dirty from here instead of going through the stylist
+            // force_origin_dirty stuff, which would be useless.
+            //
+            // FIXME(emilio, bug 1436059): This is super-hacky, make XBL /
+            // Shadow DOM not use a style set at all.
+            (**non_document_style_set).mStylistState = structs::StylistState_StyleSheetsDirty;
+        }
+    }
+
+    let uses_viewport_units =
+        document_data.stylist.device().used_viewport_size();
+
+    structs::MediumFeaturesChangedResult {
+        mAffectsDocumentRules: affects_document_rules,
+        mAffectsNonDocumentRules: affects_non_document_rules,
+        mUsesViewportUnits: uses_viewport_units,
+    }
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_StyleSet_PrependStyleSheet(
     raw_data: RawServoStyleSetBorrowed,
     sheet: *const ServoStyleSheet,
 ) {
     let global_style_data = &*GLOBAL_STYLE_DATA;