From 0635fddbfce77007c42351e1a9ac7495eaef0516 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 13:36:31 +0800 Subject: [PATCH 01/13] style: Move Origin into its own file. --- components/style/stylesheets/mod.rs | 18 ++---------------- components/style/stylesheets/origin.rs | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 components/style/stylesheets/origin.rs diff --git a/components/style/stylesheets/mod.rs b/components/style/stylesheets/mod.rs index 758bbdeb1a1..e5fc73b9064 100644 --- a/components/style/stylesheets/mod.rs +++ b/components/style/stylesheets/mod.rs @@ -14,6 +14,7 @@ mod loader; mod media_rule; mod memory; mod namespace_rule; +mod origin; mod page_rule; mod rule_list; mod rule_parser; @@ -43,6 +44,7 @@ pub use self::memory::{MallocSizeOf, MallocSizeOfFn, MallocSizeOfWithGuard}; #[cfg(feature = "gecko")] pub use self::memory::{MallocSizeOfWithRepeats, SizeOfState}; pub use self::namespace_rule::NamespaceRule; +pub use self::origin::Origin; pub use self::page_rule::PageRule; pub use self::rule_parser::{State, TopLevelRuleParser}; pub use self::rule_list::{CssRules, CssRulesHelpers}; @@ -82,22 +84,6 @@ impl UrlExtraData { #[cfg(feature = "gecko")] impl Eq for UrlExtraData {} -/// Each style rule has an origin, which determines where it enters the cascade. -/// -/// http://dev.w3.org/csswg/css-cascade/#cascading-origins -#[derive(Clone, PartialEq, Eq, Copy, Debug)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] -pub enum Origin { - /// http://dev.w3.org/csswg/css-cascade/#cascade-origin-ua - UserAgent, - - /// http://dev.w3.org/csswg/css-cascade/#cascade-origin-author - Author, - - /// http://dev.w3.org/csswg/css-cascade/#cascade-origin-user - User, -} - /// A CSS rule. /// /// TODO(emilio): Lots of spec links should be around. diff --git a/components/style/stylesheets/origin.rs b/components/style/stylesheets/origin.rs new file mode 100644 index 00000000000..312b62cb087 --- /dev/null +++ b/components/style/stylesheets/origin.rs @@ -0,0 +1,21 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +///! [CSS cascade origins](https://drafts.csswg.org/css-cascade/#cascading-origins). + +/// Each style rule has an origin, which determines where it enters the cascade. +/// +/// https://drafts.csswg.org/css-cascade/#cascading-origins +#[derive(Clone, PartialEq, Eq, Copy, Debug)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +pub enum Origin { + /// https://drafts.csswg.org/css-cascade/#cascade-origin-us + UserAgent, + + /// https://drafts.csswg.org/css-cascade/#cascade-origin-author + Author, + + /// https://drafts.csswg.org/css-cascade/#cascade-origin-user + User, +} From 321643ae6140d39963d5f021ed22e914acf40a8b Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 13:40:44 +0800 Subject: [PATCH 02/13] style: Factor out per-origin data storage. Also add an iter_mut_origins() function. --- components/layout_thread/lib.rs | 4 +- components/style/gecko/data.rs | 4 +- components/style/stylesheets/mod.rs | 2 +- components/style/stylesheets/origin.rs | 125 +++++++++++ components/style/stylist.rs | 285 +++++++------------------ 5 files changed, 207 insertions(+), 213 deletions(-) diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 9635e0b081d..bf150468dac 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -137,7 +137,7 @@ use style::selector_parser::SnapshotMap; use style::servo::restyle_damage::{REFLOW, REFLOW_OUT_OF_FLOW, REPAINT, REPOSITION, STORE_OVERFLOW}; use style::shared_lock::{SharedRwLock, SharedRwLockReadGuard, StylesheetGuards}; use style::stylesheets::{Origin, Stylesheet, StylesheetInDocument, UserAgentStylesheets}; -use style::stylist::{ExtraStyleData, Stylist}; +use style::stylist::Stylist; use style::thread_state; use style::timer::Timer; use style::traversal::{DomTraversal, TraversalDriver}; @@ -1206,7 +1206,7 @@ impl LayoutThread { author: &author_guard, ua_or_user: &ua_or_user_guard, }; - let mut extra_data = ExtraStyleData; + let mut extra_data = Default::default(); let needs_dirtying = self.stylist.update( StylesheetIterator(data.document_stylesheets.iter()), &guards, diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs index 54dab9fe283..45983338ae9 100644 --- a/components/style/gecko/data.rs +++ b/components/style/gecko/data.rs @@ -17,7 +17,7 @@ use properties::ComputedValues; use servo_arc::Arc; use shared_lock::{Locked, StylesheetGuards, SharedRwLockReadGuard}; use stylesheet_set::StylesheetSet; -use stylesheets::{StylesheetContents, StylesheetInDocument}; +use stylesheets::{PerOrigin, StylesheetContents, StylesheetInDocument}; use stylist::{ExtraStyleData, Stylist}; /// Little wrapper to a Gecko style sheet. @@ -118,7 +118,7 @@ pub struct PerDocumentStyleDataImpl { pub stylesheets: StylesheetSet, /// List of effective @font-face and @counter-style rules. - pub extra_style_data: ExtraStyleData, + pub extra_style_data: PerOrigin, } /// The data itself is an `AtomicRefCell`, which guarantees the proper semantics diff --git a/components/style/stylesheets/mod.rs b/components/style/stylesheets/mod.rs index e5fc73b9064..469fefe3934 100644 --- a/components/style/stylesheets/mod.rs +++ b/components/style/stylesheets/mod.rs @@ -44,7 +44,7 @@ pub use self::memory::{MallocSizeOf, MallocSizeOfFn, MallocSizeOfWithGuard}; #[cfg(feature = "gecko")] pub use self::memory::{MallocSizeOfWithRepeats, SizeOfState}; pub use self::namespace_rule::NamespaceRule; -pub use self::origin::Origin; +pub use self::origin::{Origin, PerOrigin, PerOriginClear}; pub use self::page_rule::PageRule; pub use self::rule_parser::{State, TopLevelRuleParser}; pub use self::rule_list::{CssRules, CssRulesHelpers}; diff --git a/components/style/stylesheets/origin.rs b/components/style/stylesheets/origin.rs index 312b62cb087..a9a31bfe124 100644 --- a/components/style/stylesheets/origin.rs +++ b/components/style/stylesheets/origin.rs @@ -4,6 +4,9 @@ ///! [CSS cascade origins](https://drafts.csswg.org/css-cascade/#cascading-origins). +use std::marker::PhantomData; +use std::mem::transmute; + /// Each style rule has an origin, which determines where it enters the cascade. /// /// https://drafts.csswg.org/css-cascade/#cascading-origins @@ -19,3 +22,125 @@ pub enum Origin { /// https://drafts.csswg.org/css-cascade/#cascade-origin-user User, } + +/// An object that stores a `T` for each origin of the CSS cascade. +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Debug, Default)] +pub struct PerOrigin { + /// Data for `Origin::UserAgent`. + pub user_agent: T, + + /// Data for `Origin::Author`. + pub author: T, + + /// Data for `Origin::User`. + pub user: T, +} + +impl PerOrigin { + /// Returns a reference to the per-origin data for the specified origin. + #[inline] + pub fn borrow_for_origin(&self, origin: &Origin) -> &T { + match *origin { + Origin::UserAgent => &self.user_agent, + Origin::Author => &self.author, + Origin::User => &self.user, + } + } + + /// Returns a mutable reference to the per-origin data for the specified + /// origin. + #[inline] + pub fn borrow_mut_for_origin(&mut self, origin: &Origin) -> &mut T { + match *origin { + Origin::UserAgent => &mut self.user_agent, + Origin::Author => &mut self.author, + Origin::User => &mut self.user, + } + } + + /// Iterates over references to per-origin extra style data, from highest + /// level (user) to lowest (user agent). + pub fn iter_origins(&self) -> PerOriginIter { + PerOriginIter { + data: &self, + cur: 0, + } + } + + /// Iterates over mutable references to per-origin extra style data, from + /// highest level (user) to lowest (user agent). + pub fn iter_mut_origins(&mut self) -> PerOriginIterMut { + PerOriginIterMut { + data: self, + cur: 0, + _marker: PhantomData, + } + } +} + +/// An object that can be cleared. +pub trait PerOriginClear { + /// Clears the object. + fn clear(&mut self); +} + +impl PerOriginClear for PerOrigin where T: PerOriginClear { + fn clear(&mut self) { + self.user_agent.clear(); + self.author.clear(); + self.user.clear(); + } +} + +/// Iterator over `PerOrigin`, from highest level (user) to lowest +/// (user agent). +/// +/// We rely on this specific order for correctly looking up @font-face, +/// @counter-style and @keyframes rules. +pub struct PerOriginIter<'a, T: 'a> { + data: &'a PerOrigin, + cur: usize, +} + +impl<'a, T> Iterator for PerOriginIter<'a, T> where T: 'a { + type Item = (&'a T, Origin); + + fn next(&mut self) -> Option { + let result = match self.cur { + 0 => (&self.data.user, Origin::User), + 1 => (&self.data.author, Origin::Author), + 2 => (&self.data.user_agent, Origin::UserAgent), + _ => return None, + }; + self.cur += 1; + Some(result) + } +} + +/// Like `PerOriginIter`, but iterates over mutable references to the +/// per-origin data. +/// +/// We must use unsafe code here since it's not possible for the borrow +/// checker to know that we are safely returning a different reference +/// each time from `next()`. +pub struct PerOriginIterMut<'a, T: 'a> { + data: *mut PerOrigin, + cur: usize, + _marker: PhantomData<&'a mut PerOrigin>, +} + +impl<'a, T> Iterator for PerOriginIterMut<'a, T> where T: 'a { + type Item = (&'a mut T, Origin); + + fn next(&mut self) -> Option { + let result = match self.cur { + 0 => (unsafe { transmute(&mut (*self.data).user) }, Origin::User), + 1 => (unsafe { transmute(&mut (*self.data).author) }, Origin::Author), + 2 => (unsafe { transmute(&mut (*self.data).user_agent) }, Origin::UserAgent), + _ => return None, + }; + self.cur += 1; + Some(result) + } +} diff --git a/components/style/stylist.rs b/components/style/stylist.rs index f3d79277a80..51585a7d7f1 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -40,7 +40,8 @@ use style_traits::viewport::ViewportConstraints; #[cfg(feature = "gecko")] use stylesheets::{CounterStyleRule, FontFaceRule}; use stylesheets::{CssRule, StyleRule}; -use stylesheets::{StylesheetInDocument, Origin, UserAgentStylesheets}; +use stylesheets::{StylesheetInDocument, Origin, PerOrigin, PerOriginClear}; +use stylesheets::UserAgentStylesheets; use stylesheets::keyframes_rule::KeyframesAnimation; use stylesheets::viewport_rule::{self, MaybeNew, ViewportRule}; use thread_state; @@ -90,7 +91,7 @@ pub struct Stylist { /// Selector maps for all of the style sheets in the stylist, after /// evalutaing media rules against the current device, split out per /// cascade level. - cascade_data: CascadeData, + cascade_data: PerOrigin, /// The rule tree, that stores the results of selector matching. rule_tree: RuleTree, @@ -110,90 +111,6 @@ pub struct Stylist { num_rebuilds: usize, } -/// This struct holds data which users of Stylist may want to extract -/// from stylesheets which can be done at the same time as updating. -#[cfg(feature = "gecko")] -#[derive(Default)] -pub struct ExtraStyleData { - /// Extra data from user agent stylesheets - user_agent: PerOriginExtraStyleData, - /// Extra data from author stylesheets - author: PerOriginExtraStyleData, - /// Extra data from user stylesheets - user: PerOriginExtraStyleData, -} - -/// This struct holds data which users of Stylist may want to extract -/// from stylesheets which can be done at the same time as updating. -#[cfg(feature = "gecko")] -#[derive(Default)] -pub struct PerOriginExtraStyleData { - /// A list of effective font-face rules and their origin. - pub font_faces: Vec>>, - /// A map of effective counter-style rules. - pub counter_styles: PrecomputedHashMap>>, -} - -#[cfg(feature = "gecko")] -impl ExtraStyleData { - /// Clear the internal data. - pub fn clear(&mut self) { - self.user_agent.clear(); - self.author.clear(); - self.user.clear(); - } - - /// Returns a reference to the per-origin extra style data for - /// the specified origin. - #[inline] - pub fn borrow_mut_for_origin(&mut self, origin: &Origin) -> &mut PerOriginExtraStyleData { - match *origin { - Origin::UserAgent => &mut self.user_agent, - Origin::Author => &mut self.author, - Origin::User => &mut self.user, - } - } - - /// Iterates over the per-origin extra style data, from highest level (user) - /// to lowest (user agent). - pub fn iter_origins(&self) -> ExtraStyleDataIter { - ExtraStyleDataIter { - extra_style_data: &self, - cur: 0, - } - } -} - -#[cfg(feature = "gecko")] -impl PerOriginExtraStyleData { - /// Clears the stored @font-face and @counter-style rules. - fn clear(&mut self) { - self.font_faces.clear(); - self.counter_styles.clear(); - } - - /// Add the given @font-face rule. - fn add_font_face(&mut self, rule: &Arc>) { - self.font_faces.push(rule.clone()); - } - - /// Add the given @counter-style rule. - fn add_counter_style(&mut self, guard: &SharedRwLockReadGuard, - rule: &Arc>) { - let name = rule.read_with(guard).mName.raw::().into(); - self.counter_styles.insert(name, rule.clone()); - } -} - -#[allow(missing_docs)] -#[cfg(feature = "servo")] -pub struct ExtraStyleData; - -#[cfg(feature = "servo")] -impl ExtraStyleData { - fn clear(&mut self) {} -} - /// What cascade levels to include when styling elements. #[derive(Copy, Clone, PartialEq)] pub enum RuleInclusion { @@ -229,7 +146,7 @@ impl Stylist { quirks_mode: quirks_mode, effective_media_query_results: EffectiveMediaQueryResults::new(), - cascade_data: CascadeData::new(), + cascade_data: Default::default(), precomputed_pseudo_element_decls: PerPseudoElementMap::default(), rules_source_order: 0, rule_tree: RuleTree::new(), @@ -241,12 +158,12 @@ impl Stylist { /// Returns the number of selectors. pub fn num_selectors(&self) -> usize { - self.cascade_data.iter_origins().map(|d| d.num_selectors).sum() + self.cascade_data.iter_origins().map(|(d, _)| d.num_selectors).sum() } /// Returns the number of declarations. pub fn num_declarations(&self) -> usize { - self.cascade_data.iter_origins().map(|d| d.num_declarations).sum() + self.cascade_data.iter_origins().map(|(d, _)| d.num_declarations).sum() } /// Returns the number of times the stylist has been rebuilt. @@ -257,13 +174,13 @@ impl Stylist { /// Returns the number of revalidation_selectors. pub fn num_revalidation_selectors(&self) -> usize { self.cascade_data.iter_origins() - .map(|d| d.selectors_for_cache_revalidation.len()).sum() + .map(|(d, _)| d.selectors_for_cache_revalidation.len()).sum() } /// Returns the number of entries in invalidation maps. pub fn num_invalidations(&self) -> usize { self.cascade_data.iter_origins() - .map(|d| d.invalidation_map.len()).sum() + .map(|(d, _)| d.invalidation_map.len()).sum() } /// Invokes `f` with the `InvalidationMap` for each origin. @@ -274,8 +191,8 @@ impl Stylist { pub fn each_invalidation_map(&self, mut f: F) where F: FnMut(&InvalidationMap) { - for origin_cascade_data in self.cascade_data.iter_origins() { - f(&origin_cascade_data.invalidation_map) + for (data, _) in self.cascade_data.iter_origins() { + f(&data.invalidation_map) } } @@ -324,7 +241,7 @@ impl Stylist { ua_stylesheets: Option<&UserAgentStylesheets>, stylesheets_changed: bool, author_style_disabled: bool, - extra_data: &mut ExtraStyleData + extra_data: &mut PerOrigin ) -> bool where I: Iterator + Clone, @@ -404,7 +321,7 @@ impl Stylist { ua_stylesheets: Option<&UserAgentStylesheets>, stylesheets_changed: bool, author_style_disabled: bool, - extra_data: &mut ExtraStyleData + extra_data: &mut PerOrigin ) -> bool where I: Iterator + Clone, @@ -426,7 +343,7 @@ impl Stylist { &mut self, stylesheet: &S, guard: &SharedRwLockReadGuard, - _extra_data: &mut ExtraStyleData + _extra_data: &mut PerOrigin ) where S: StylesheetInDocument + ToMediaListKey + 'static, @@ -574,11 +491,11 @@ impl Stylist { } else if *local_name == local_name!("style") { self.cascade_data .iter_origins() - .any(|d| d.style_attribute_dependency) + .any(|(d, _)| d.style_attribute_dependency) } else { self.cascade_data .iter_origins() - .any(|d| { + .any(|(d, _)| { d.attribute_dependencies .might_contain_hash(local_name.get_hash()) }) @@ -602,7 +519,7 @@ impl Stylist { pub fn has_state_dependency(&self, state: ElementState) -> bool { self.cascade_data .iter_origins() - .any(|d| d.state_dependencies.intersects(state)) + .any(|(d, _)| d.state_dependencies.intersects(state)) } /// Computes the style for a given "precomputed" pseudo-element, taking the @@ -852,6 +769,12 @@ impl Stylist { self.quirks_mode) } + fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool { + self.cascade_data + .iter_origins() + .any(|(d, _)| d.has_rules_for_pseudo(pseudo)) + } + /// Computes the cascade inputs for a lazily-cascaded pseudo-element. /// /// See the documentation on lazy pseudo-elements in @@ -868,7 +791,7 @@ impl Stylist { let pseudo = pseudo.canonical(); debug_assert!(pseudo.is_lazy()); - if !self.cascade_data.has_rules_for_pseudo(&pseudo) { + if !self.has_rules_for_pseudo(&pseudo) { return CascadeInputs::default() } @@ -1324,7 +1247,7 @@ impl Stylist { pub fn may_have_rules_for_id(&self, id: &Atom) -> bool { self.cascade_data .iter_origins() - .any(|d| d.mapped_ids.might_contain_hash(id.get_hash())) + .any(|(d, _)| d.mapped_ids.might_contain_hash(id.get_hash())) } /// Return whether the device is dirty, that is, whether the screen size or @@ -1339,7 +1262,7 @@ impl Stylist { pub fn get_animation(&self, name: &Atom) -> Option<&KeyframesAnimation> { self.cascade_data .iter_origins() - .filter_map(|d| d.animations.get(name)) + .filter_map(|(d, _)| d.animations.get(name)) .next() } @@ -1364,8 +1287,8 @@ impl Stylist { // the lookups, which means that the bitvecs are comparable. We verify // this in the caller by asserting that the bitvecs are same-length. let mut results = BitVec::new(); - for origin_cascade_data in self.cascade_data.iter_origins() { - origin_cascade_data.selectors_for_cache_revalidation.lookup( + for (data, _) in self.cascade_data.iter_origins() { + data.selectors_for_cache_revalidation.lookup( *element, self.quirks_mode, &mut |selector_and_hashes| { results.push(matches_selector(&selector_and_hashes.selector, selector_and_hashes.selector_offset, @@ -1431,6 +1354,44 @@ impl Stylist { } } +/// This struct holds data which users of Stylist may want to extract +/// from stylesheets which can be done at the same time as updating. +#[derive(Default)] +pub struct ExtraStyleData { + /// A list of effective font-face rules and their origin. + #[cfg(feature = "gecko")] + pub font_faces: Vec>>, + + /// A map of effective counter-style rules. + #[cfg(feature = "gecko")] + pub counter_styles: PrecomputedHashMap>>, +} + +#[cfg(feature = "gecko")] +impl ExtraStyleData { + /// Add the given @font-face rule. + fn add_font_face(&mut self, rule: &Arc>) { + self.font_faces.push(rule.clone()); + } + + /// Add the given @counter-style rule. + fn add_counter_style(&mut self, guard: &SharedRwLockReadGuard, + rule: &Arc>) { + let name = rule.read_with(guard).mName.raw::().into(); + self.counter_styles.insert(name, rule.clone()); + } +} + +impl PerOriginClear for ExtraStyleData { + fn clear(&mut self) { + #[cfg(feature = "gecko")] + { + self.font_faces.clear(); + self.counter_styles.clear(); + } + } +} + /// SelectorMapEntry implementation for use in our revalidation selector map. #[derive(Clone, Debug)] struct RevalidationSelectorAndHashes { @@ -1599,111 +1560,11 @@ impl<'a> SelectorVisitor for StylistSelectorVisitor<'a> { } } -/// Data resulting from performing the CSS cascade. -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] -#[derive(Debug)] -struct CascadeData { - /// Rules from user agent stylesheets - user_agent: PerOriginCascadeData, - /// Rules from author stylesheets - author: PerOriginCascadeData, - /// Rules from user stylesheets - user: PerOriginCascadeData, -} - -impl CascadeData { - fn new() -> Self { - CascadeData { - user_agent: PerOriginCascadeData::new(), - author: PerOriginCascadeData::new(), - user: PerOriginCascadeData::new(), - } - } - - #[inline] - fn borrow_mut_for_origin(&mut self, origin: &Origin) -> &mut PerOriginCascadeData { - match *origin { - Origin::UserAgent => &mut self.user_agent, - Origin::Author => &mut self.author, - Origin::User => &mut self.user, - } - } - - fn clear(&mut self) { - self.user_agent.clear(); - self.author.clear(); - self.user.clear(); - } - - fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool { - self.iter_origins().any(|d| d.has_rules_for_pseudo(pseudo)) - } - - fn iter_origins(&self) -> CascadeDataIter { - CascadeDataIter { - cascade_data: &self, - cur: 0, - } - } -} - -/// Iterator over `PerOriginCascadeData`, from highest level (user) to lowest -/// (user agent). -/// -/// We rely on this specific order for correctly looking up animations -/// (prioritizing rules at higher cascade levels), among other things. -struct CascadeDataIter<'a> { - cascade_data: &'a CascadeData, - cur: usize, -} - -impl<'a> Iterator for CascadeDataIter<'a> { - type Item = &'a PerOriginCascadeData; - - fn next(&mut self) -> Option<&'a PerOriginCascadeData> { - let result = match self.cur { - 0 => &self.cascade_data.user, - 1 => &self.cascade_data.author, - 2 => &self.cascade_data.user_agent, - _ => return None, - }; - self.cur += 1; - Some(result) - } -} - -/// Iterator over `PerOriginExtraStyleData`, from highest level (user) to lowest -/// (user agent). -/// -/// We rely on this specific order for correctly looking up the @font-face -/// and @counter-style rules. -#[cfg(feature = "gecko")] -pub struct ExtraStyleDataIter<'a> { - extra_style_data: &'a ExtraStyleData, - cur: usize, -} - -#[cfg(feature = "gecko")] -impl<'a> Iterator for ExtraStyleDataIter<'a> { - type Item = (&'a PerOriginExtraStyleData, Origin); - - fn next(&mut self) -> Option<(&'a PerOriginExtraStyleData, Origin)> { - let result = match self.cur { - 0 => (&self.extra_style_data.user, Origin::User), - 1 => (&self.extra_style_data.author, Origin::Author), - 2 => (&self.extra_style_data.user_agent, Origin::UserAgent), - _ => return None, - }; - self.cur += 1; - Some(result) - } -} - /// Data resulting from performing the CSS cascade that is specific to a given /// origin. #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Debug)] -struct PerOriginCascadeData { +struct CascadeData { /// Rules from stylesheets at this `CascadeData`'s origin. element_map: SelectorMap, @@ -1758,7 +1619,7 @@ struct PerOriginCascadeData { num_declarations: usize, } -impl PerOriginCascadeData { +impl CascadeData { fn new() -> Self { Self { element_map: SelectorMap::new(), @@ -1783,6 +1644,12 @@ impl PerOriginCascadeData { } } + fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool { + self.pseudos_map.get(pseudo).is_some() + } +} + +impl PerOriginClear for CascadeData { fn clear(&mut self) { self.element_map = SelectorMap::new(); self.pseudos_map = Default::default(); @@ -1796,9 +1663,11 @@ impl PerOriginCascadeData { self.num_selectors = 0; self.num_declarations = 0; } +} - fn has_rules_for_pseudo(&self, pseudo: &PseudoElement) -> bool { - self.pseudos_map.get(pseudo).is_some() +impl Default for CascadeData { + fn default() -> Self { + CascadeData::new() } } From f9d1a0e2d1cc3fbf498bf14586976553a5123737 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 15:34:38 +0800 Subject: [PATCH 03/13] style: Split style sheet invalidations per-origin. --- components/style/stylesheet_set.rs | 93 +++++++++++++++++------------- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index f38ff22d535..039a7a1e611 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -8,7 +8,7 @@ use dom::TElement; use invalidation::stylesheets::StylesheetInvalidationSet; use shared_lock::SharedRwLockReadGuard; use std::slice; -use stylesheets::StylesheetInDocument; +use stylesheets::{PerOrigin, StylesheetInDocument}; use stylist::Stylist; /// Entry for a StylesheetSet. We don't bother creating a constructor, because @@ -49,14 +49,11 @@ where /// include recursive `@import` rules. entries: Vec>, - /// Whether the entries list above has changed since the last restyle. - dirty: bool, + /// Per-origin stylesheet invalidation data. + invalidation_data: PerOrigin, /// Has author style been disabled? author_style_disabled: bool, - - /// The style invalidations that we still haven't processed. - invalidations: StylesheetInvalidationSet, } impl StylesheetSet @@ -67,9 +64,8 @@ where pub fn new() -> Self { StylesheetSet { entries: vec![], - dirty: false, + invalidation_data: Default::default(), author_style_disabled: false, - invalidations: StylesheetInvalidationSet::new(), } } @@ -83,6 +79,18 @@ where self.entries.retain(|entry| entry.sheet != *sheet); } + fn collect_invalidations_for( + &mut self, + stylist: &Stylist, + sheet: &S, + guard: &SharedRwLockReadGuard, + ) { + let origin = sheet.contents(guard).origin; + let data = self.invalidation_data.borrow_mut_for_origin(&origin); + data.invalidations.collect_invalidations_for(stylist, sheet, guard); + data.dirty = true; + } + /// Appends a new stylesheet to the current set. pub fn append_stylesheet( &mut self, @@ -92,12 +100,7 @@ where ) { debug!("StylesheetSet::append_stylesheet"); self.remove_stylesheet_if_present(&sheet); - self.invalidations.collect_invalidations_for( - stylist, - &sheet, - guard - ); - self.dirty = true; + self.collect_invalidations_for(stylist, &sheet, guard); self.entries.push(StylesheetSetEntry { sheet }); } @@ -110,13 +113,8 @@ where ) { debug!("StylesheetSet::prepend_stylesheet"); self.remove_stylesheet_if_present(&sheet); - self.invalidations.collect_invalidations_for( - stylist, - &sheet, - guard - ); + self.collect_invalidations_for(stylist, &sheet, guard); self.entries.insert(0, StylesheetSetEntry { sheet }); - self.dirty = true; } /// Insert a given stylesheet before another stylesheet in the document. @@ -132,13 +130,8 @@ where let index = self.entries.iter().position(|entry| { entry.sheet == before_sheet }).expect("`before_sheet` stylesheet not found"); - self.invalidations.collect_invalidations_for( - stylist, - &sheet, - guard - ); + self.collect_invalidations_for(stylist, &sheet, guard); self.entries.insert(index, StylesheetSetEntry { sheet }); - self.dirty = true; } /// Remove a given stylesheet from the set. @@ -150,12 +143,7 @@ where ) { debug!("StylesheetSet::remove_stylesheet"); self.remove_stylesheet_if_present(&sheet); - self.dirty = true; - self.invalidations.collect_invalidations_for( - stylist, - &sheet, - guard - ); + self.collect_invalidations_for(stylist, &sheet, guard); } /// Notes that the author style has been disabled for this document. @@ -165,13 +153,15 @@ where return; } self.author_style_disabled = disabled; - self.dirty = true; - self.invalidations.invalidate_fully(); + self.invalidation_data.author.invalidations.invalidate_fully(); + self.invalidation_data.author.dirty = true; } /// Returns whether the given set has changed from the last flush. pub fn has_changed(&self) -> bool { - self.dirty + self.invalidation_data + .iter_origins() + .any(|(d, _)| d.dirty) } /// Flush the current set, unmarking it as dirty, and returns an iterator @@ -184,10 +174,12 @@ where E: TElement, { debug!("StylesheetSet::flush"); - debug_assert!(self.dirty); + debug_assert!(self.has_changed()); - self.dirty = false; - self.invalidations.flush(document_element); + for data in self.invalidation_data.iter_mut_origins() { + data.0.invalidations.flush(document_element); + data.0.dirty = false; + } self.iter() } @@ -202,7 +194,28 @@ where /// /// FIXME(emilio): Make this more granular. pub fn force_dirty(&mut self) { - self.dirty = true; - self.invalidations.invalidate_fully(); + for data in self.invalidation_data.iter_mut_origins() { + data.0.invalidations.invalidate_fully(); + data.0.dirty = true; + } + } +} + +struct InvalidationData { + /// The stylesheet invalidations for this origin that we still haven't + /// processed. + invalidations: StylesheetInvalidationSet, + + /// Whether the sheets for this origin in the `StylesheetSet`'s entry list + /// has changed since the last restyle. + dirty: bool, +} + +impl Default for InvalidationData { + fn default() -> Self { + InvalidationData { + invalidations: StylesheetInvalidationSet::new(), + dirty: false, + } } } From db6a09f24f9ef023c2b7e1d19531b0720a17d1cc Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 15:46:57 +0800 Subject: [PATCH 04/13] style: Move cached media query results into per-origin data. --- .../style/invalidation/media_queries.rs | 1 + components/style/stylist.rs | 41 +++++++++++++------ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/components/style/invalidation/media_queries.rs b/components/style/invalidation/media_queries.rs index 73b8f6a60b8..b50f44ce919 100644 --- a/components/style/invalidation/media_queries.rs +++ b/components/style/invalidation/media_queries.rs @@ -52,6 +52,7 @@ impl ToMediaListKey for MediaRule {} /// A struct that holds the result of a media query evaluation pass for the /// media queries that evaluated successfully. +#[derive(Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct EffectiveMediaQueryResults { /// The set of media lists that matched last time. diff --git a/components/style/stylist.rs b/components/style/stylist.rs index 51585a7d7f1..c614df68c2c 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -74,9 +74,6 @@ pub struct Stylist { /// Viewport constraints based on the current device. viewport_constraints: Option, - /// Effective media query results cached from the last rebuild. - effective_media_query_results: EffectiveMediaQueryResults, - /// If true, the quirks-mode stylesheet is applied. #[cfg_attr(feature = "servo", ignore_heap_size_of = "defined in selectors")] quirks_mode: QuirksMode, @@ -144,7 +141,6 @@ impl Stylist { is_device_dirty: true, is_cleared: true, quirks_mode: quirks_mode, - effective_media_query_results: EffectiveMediaQueryResults::new(), cascade_data: Default::default(), precomputed_pseudo_element_decls: PerPseudoElementMap::default(), @@ -215,7 +211,6 @@ impl Stylist { self.is_cleared = true; - self.effective_media_query_results.clear(); self.viewport_constraints = None; // preserve current device self.is_device_dirty = true; @@ -353,13 +348,14 @@ impl Stylist { return; } - self.effective_media_query_results.saw_effective(stylesheet); - let origin = stylesheet.origin(guard); - let origin_cascade_data = self.cascade_data.borrow_mut_for_origin(&origin); + origin_cascade_data + .effective_media_query_results + .saw_effective(stylesheet); + for rule in stylesheet.effective_rules(&self.device, guard) { match *rule { CssRule::Style(ref locked) => { @@ -436,14 +432,18 @@ impl Stylist { } CssRule::Import(ref lock) => { let import_rule = lock.read_with(guard); - self.effective_media_query_results.saw_effective(import_rule); + origin_cascade_data + .effective_media_query_results + .saw_effective(import_rule); // NOTE: effective_rules visits the inner stylesheet if // appropriate. } CssRule::Media(ref lock) => { let media_rule = lock.read_with(guard); - self.effective_media_query_results.saw_effective(media_rule); + origin_cascade_data + .effective_media_query_results + .saw_effective(media_rule); } CssRule::Keyframes(ref keyframes_rule) => { let keyframes_rule = keyframes_rule.read_with(guard); @@ -954,8 +954,14 @@ impl Stylist { let effective_now = stylesheet.is_effective_for_device(&self.device, guard); + let origin = stylesheet.origin(guard); + let origin_cascade_data = + self.cascade_data.borrow_for_origin(&origin); + let effective_then = - self.effective_media_query_results.was_effective(stylesheet); + origin_cascade_data + .effective_media_query_results + .was_effective(stylesheet); if effective_now != effective_then { debug!(" > Stylesheet changed -> {}, {}", @@ -994,7 +1000,9 @@ impl Stylist { import_rule.stylesheet .is_effective_for_device(&self.device, guard); let effective_then = - self.effective_media_query_results.was_effective(import_rule); + origin_cascade_data + .effective_media_query_results + .was_effective(import_rule); if effective_now != effective_then { debug!(" > @import rule changed {} -> {}", effective_then, effective_now); @@ -1011,7 +1019,9 @@ impl Stylist { let effective_now = mq.evaluate(&self.device, self.quirks_mode); let effective_then = - self.effective_media_query_results.was_effective(media_rule); + origin_cascade_data + .effective_media_query_results + .was_effective(media_rule); if effective_now != effective_then { debug!(" > @media rule changed {} -> {}", effective_then, effective_now); @@ -1612,6 +1622,9 @@ struct CascadeData { #[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")] selectors_for_cache_revalidation: SelectorMap, + /// Effective media query results cached from the last rebuild. + effective_media_query_results: EffectiveMediaQueryResults, + /// The total number of selectors. num_selectors: usize, @@ -1631,6 +1644,7 @@ impl CascadeData { state_dependencies: ElementState::empty(), mapped_ids: NonCountingBloomFilter::new(), selectors_for_cache_revalidation: SelectorMap::new(), + effective_media_query_results: EffectiveMediaQueryResults::new(), num_selectors: 0, num_declarations: 0, } @@ -1660,6 +1674,7 @@ impl PerOriginClear for CascadeData { self.state_dependencies = ElementState::empty(); self.mapped_ids.clear(); self.selectors_for_cache_revalidation = SelectorMap::new(); + self.effective_media_query_results.clear(); self.num_selectors = 0; self.num_declarations = 0; } From 57ee17d6d9d0985c447ef5affbdbb3101b213c6d Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 15:59:36 +0800 Subject: [PATCH 05/13] style: Move rule source order counter into per-origin data. --- components/style/stylist.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/components/style/stylist.rs b/components/style/stylist.rs index c614df68c2c..b224ee54364 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -100,10 +100,6 @@ pub struct Stylist { /// FIXME(emilio): Use the rule tree! precomputed_pseudo_element_decls: PerPseudoElementMap>, - /// A monotonically increasing counter to represent the order on which a - /// style rule appears in a stylesheet, needed to sort them by source order. - rules_source_order: u32, - /// The total number of times the stylist has been rebuilt. num_rebuilds: usize, } @@ -144,7 +140,6 @@ impl Stylist { cascade_data: Default::default(), precomputed_pseudo_element_decls: PerPseudoElementMap::default(), - rules_source_order: 0, rule_tree: RuleTree::new(), num_rebuilds: 0, } @@ -217,7 +212,6 @@ impl Stylist { // preserve current quirks_mode value self.cascade_data.clear(); self.precomputed_pseudo_element_decls.clear(); - self.rules_source_order = 0; // We want to keep rule_tree around across stylist rebuilds. // preserve num_rebuilds value, since it should stay across // clear()/rebuild() cycles. @@ -380,7 +374,7 @@ impl Stylist { .expect("Unexpected tree pseudo-element?") .push(ApplicableDeclarationBlock::new( StyleSource::Style(locked.clone()), - self.rules_source_order, + origin_cascade_data.rules_source_order, CascadeLevel::UANormal, selector.specificity() )); @@ -403,7 +397,7 @@ impl Stylist { selector.clone(), hashes.clone(), locked.clone(), - self.rules_source_order + origin_cascade_data.rules_source_order ); map.insert(rule, self.quirks_mode); @@ -428,7 +422,7 @@ impl Stylist { self.quirks_mode); } } - self.rules_source_order += 1; + origin_cascade_data.rules_source_order += 1; } CssRule::Import(ref lock) => { let import_rule = lock.read_with(guard); @@ -1625,6 +1619,10 @@ struct CascadeData { /// Effective media query results cached from the last rebuild. effective_media_query_results: EffectiveMediaQueryResults, + /// A monotonically increasing counter to represent the order on which a + /// style rule appears in a stylesheet, needed to sort them by source order. + rules_source_order: u32, + /// The total number of selectors. num_selectors: usize, @@ -1645,6 +1643,7 @@ impl CascadeData { mapped_ids: NonCountingBloomFilter::new(), selectors_for_cache_revalidation: SelectorMap::new(), effective_media_query_results: EffectiveMediaQueryResults::new(), + rules_source_order: 0, num_selectors: 0, num_declarations: 0, } @@ -1675,6 +1674,7 @@ impl PerOriginClear for CascadeData { self.mapped_ids.clear(); self.selectors_for_cache_revalidation = SelectorMap::new(); self.effective_media_query_results.clear(); + self.rules_source_order = 0; self.num_selectors = 0; self.num_declarations = 0; } From 72107eb838bf43c22f628fe7470d1faaedf85b03 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 16:19:47 +0800 Subject: [PATCH 06/13] style: Move cleared state into per-origin data. --- components/style/stylist.rs | 57 +++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/components/style/stylist.rs b/components/style/stylist.rs index b224ee54364..ab1cd2bf74d 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -81,10 +81,6 @@ pub struct Stylist { /// If true, the device has changed, and the stylist needs to be updated. is_device_dirty: bool, - /// If true, the stylist is in a cleared state (e.g. just-constructed, or - /// had clear() called on it with no following rebuild()). - is_cleared: bool, - /// Selector maps for all of the style sheets in the stylist, after /// evalutaing media rules against the current device, split out per /// cascade level. @@ -135,7 +131,6 @@ impl Stylist { viewport_constraints: None, device: device, is_device_dirty: true, - is_cleared: true, quirks_mode: quirks_mode, cascade_data: Default::default(), @@ -194,27 +189,26 @@ impl Stylist { /// device: Someone might have set this on us. /// quirks_mode: Again, someone might have set this on us. /// num_rebuilds: clear() followed by rebuild() should just increment this + /// rule_tree: So we can re-use rule nodes across rebuilds. /// /// We don't just use struct update syntax with Stylist::new(self.device) /// beause for some of our members we can clear them instead of creating new /// objects. This does cause unfortunate code duplication with /// Stylist::new. pub fn clear(&mut self) { - if self.is_cleared { - return - } - - self.is_cleared = true; - - self.viewport_constraints = None; - // preserve current device - self.is_device_dirty = true; - // preserve current quirks_mode value self.cascade_data.clear(); self.precomputed_pseudo_element_decls.clear(); - // We want to keep rule_tree around across stylist rebuilds. - // preserve num_rebuilds value, since it should stay across - // clear()/rebuild() cycles. + self.viewport_constraints = None; + + // XXX(heycam) Why do this, if we are preserving the Device? + self.is_device_dirty = true; + } + + /// Returns whether any origin's `CascadeData` has been cleared. + fn any_origin_cleared(&self) -> bool { + self.cascade_data + .iter_origins() + .any(|(d, _)| d.is_cleared) } /// rebuild the stylist for the given document stylesheets, and optionally @@ -236,9 +230,11 @@ impl Stylist { I: Iterator + Clone, S: StylesheetInDocument + ToMediaListKey + 'static, { - debug_assert!(!self.is_cleared || self.is_device_dirty); + debug_assert!(!self.any_origin_cleared() || self.is_device_dirty); - self.is_cleared = false; + for (data, _) in self.cascade_data.iter_mut_origins() { + data.is_cleared = false; + } if !(self.is_device_dirty || stylesheets_changed) { return false; @@ -316,7 +312,7 @@ impl Stylist { I: Iterator + Clone, S: StylesheetInDocument + ToMediaListKey + 'static, { - debug_assert!(!self.is_cleared || self.is_device_dirty); + debug_assert!(!self.any_origin_cleared() || self.is_device_dirty); // We have to do a dirtiness check before clearing, because if // we're not actually dirty we need to no-op here. @@ -478,7 +474,7 @@ impl Stylist { pub fn might_have_attribute_dependency(&self, local_name: &LocalName) -> bool { - if self.is_cleared || self.is_device_dirty { + if self.any_origin_cleared() || self.is_device_dirty { // We can't tell what attributes are in our style rules until // we rebuild. true @@ -499,9 +495,9 @@ impl Stylist { /// Returns whether the given ElementState bit might be relied upon by a /// selector of some rule in the stylist. pub fn might_have_state_dependency(&self, state: ElementState) -> bool { - if self.is_cleared || self.is_device_dirty { - // If self.is_cleared is true, we can't tell what states our style - // rules rely on until we rebuild. + if self.any_origin_cleared() || self.is_device_dirty { + // We can't tell what states our style rules rely on until + // we rebuild. true } else { self.has_state_dependency(state) @@ -1628,6 +1624,11 @@ struct CascadeData { /// The total number of declarations. num_declarations: usize, + + /// If true, the `CascadeData` is in a cleared state (e.g. just-constructed, + /// or had `clear()` called on it with no following `rebuild()` on the + /// `Stylist`). + is_cleared: bool, } impl CascadeData { @@ -1646,6 +1647,7 @@ impl CascadeData { rules_source_order: 0, num_selectors: 0, num_declarations: 0, + is_cleared: true, } } @@ -1664,6 +1666,10 @@ impl CascadeData { impl PerOriginClear for CascadeData { fn clear(&mut self) { + if self.is_cleared { + return; + } + self.element_map = SelectorMap::new(); self.pseudos_map = Default::default(); self.animations = Default::default(); @@ -1677,6 +1683,7 @@ impl PerOriginClear for CascadeData { self.rules_source_order = 0; self.num_selectors = 0; self.num_declarations = 0; + self.is_cleared = true; } } From f3a7adfcc7f31aeb0ca71650ca717759d87d73f9 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 17:15:44 +0800 Subject: [PATCH 07/13] style: Add ability to clear and rebuild individual origins. --- components/style/gecko/data.rs | 7 +++- components/style/stylist.rs | 77 +++++++++++++++++++++++++++++----- 2 files changed, 72 insertions(+), 12 deletions(-) diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs index 45983338ae9..3e44ee02e2a 100644 --- a/components/style/gecko/data.rs +++ b/components/style/gecko/data.rs @@ -17,7 +17,7 @@ use properties::ComputedValues; use servo_arc::Arc; use shared_lock::{Locked, StylesheetGuards, SharedRwLockReadGuard}; use stylesheet_set::StylesheetSet; -use stylesheets::{PerOrigin, StylesheetContents, StylesheetInDocument}; +use stylesheets::{Origin, PerOrigin, StylesheetContents, StylesheetInDocument}; use stylist::{ExtraStyleData, Stylist}; /// Little wrapper to a Gecko style sheet. @@ -193,6 +193,11 @@ impl PerDocumentStyleDataImpl { self.stylist.clear(); } + /// Clear the stylist's data for the specified origin. + pub fn clear_stylist_origin(&mut self, origin: &Origin) { + self.stylist.clear_origin(origin); + } + /// Returns whether visited links are enabled. fn visited_links_enabled(&self) -> bool { unsafe { bindings::Gecko_AreVisitedLinksEnabled() } diff --git a/components/style/stylist.rs b/components/style/stylist.rs index ab1cd2bf74d..394d5013f64 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -204,6 +204,23 @@ impl Stylist { self.is_device_dirty = true; } + /// Clear the stylist's state for the specified origin. + pub fn clear_origin(&mut self, origin: &Origin) { + self.cascade_data.borrow_mut_for_origin(origin).clear(); + + if *origin == Origin::UserAgent { + // We only collect these declarations from UA sheets. + self.precomputed_pseudo_element_decls.clear(); + } + + // The stored `ViewportConstraints` contains data from rules across + // all origins. + self.viewport_constraints = None; + + // XXX(heycam) Why do this, if we are preserving the Device? + self.is_device_dirty = true; + } + /// Returns whether any origin's `CascadeData` has been cleared. fn any_origin_cleared(&self) -> bool { self.cascade_data @@ -211,7 +228,7 @@ impl Stylist { .any(|(d, _)| d.is_cleared) } - /// rebuild the stylist for the given document stylesheets, and optionally + /// Rebuild the stylist for the given document stylesheets, and optionally /// with a set of user agent stylesheets. /// /// This method resets all the style data each time the stylesheets change @@ -232,8 +249,26 @@ impl Stylist { { debug_assert!(!self.any_origin_cleared() || self.is_device_dirty); - for (data, _) in self.cascade_data.iter_mut_origins() { - data.is_cleared = false; + // Determine the origins that actually need updating. + // + // XXX(heycam): What is the relationship between `stylesheets_changed` + // and the `is_cleared` fields on each origin's `CascadeData`? Can + // we avoid passing in `stylesheets_changed`? + let mut to_update: PerOrigin = Default::default(); + + // If we're provided with a list of UA and user style sheets, then + // we must update those cascade levels. (Servo does this, but Gecko + // just includes the UA and User sheets in `doc_stylesheets`.) + if ua_stylesheets.is_some() { + to_update.user_agent = true; + to_update.user = true; + } + + for (data, origin) in self.cascade_data.iter_mut_origins() { + if data.is_cleared { + data.is_cleared = false; + *to_update.borrow_mut_for_origin(&origin) = true; + } } if !(self.is_device_dirty || stylesheets_changed) { @@ -242,8 +277,9 @@ impl Stylist { self.num_rebuilds += 1; + // Update viewport_constraints regardless of which origins' + // `CascadeData` we're updating. self.viewport_constraints = None; - if viewport_rule::enabled() { // TODO(emilio): This doesn't look so efficient. // @@ -264,29 +300,48 @@ impl Stylist { self.viewport_constraints = ViewportConstraints::maybe_new(&self.device, &cascaded_rule, - self.quirks_mode) + self.quirks_mode); + + if let Some(ref constraints) = self.viewport_constraints { + self.device.account_for_viewport_rule(constraints); + } } - if let Some(ref constraints) = self.viewport_constraints { - self.device.account_for_viewport_rule(constraints); + // XXX(heycam): We should probably just move the `extra_data` to be + // stored on the `Stylist` instead of Gecko's `PerDocumentStyleData`. + // That would let us clear it inside `clear()` and `clear_origin()`. + for (update, origin) in to_update.iter_origins() { + if *update { + extra_data.borrow_mut_for_origin(&origin).clear(); + } } - extra_data.clear(); - if let Some(ua_stylesheets) = ua_stylesheets { for stylesheet in &ua_stylesheets.user_or_user_agent_stylesheets { + debug_assert!(matches!( + stylesheet.contents(guards.ua_or_user).origin, + Origin::UserAgent | Origin::User)); self.add_stylesheet(stylesheet, guards.ua_or_user, extra_data); } if self.quirks_mode != QuirksMode::NoQuirks { + let stylesheet = &ua_stylesheets.quirks_mode_stylesheet; + debug_assert!(matches!( + stylesheet.contents(guards.ua_or_user).origin, + Origin::UserAgent | Origin::User)); self.add_stylesheet(&ua_stylesheets.quirks_mode_stylesheet, guards.ua_or_user, extra_data); } } - // Only use author stylesheets if author styles are enabled. + // Only add stylesheets for origins we are updating, and only add + // Author level sheets if author style is not disabled. let sheets_to_add = doc_stylesheets.filter(|s| { - !author_style_disabled || s.origin(guards.author) != Origin::Author + match s.contents(guards.author).origin { + Origin::UserAgent => to_update.user_agent, + Origin::Author => to_update.author && !author_style_disabled, + Origin::User => to_update.user, + } }); for stylesheet in sheets_to_add { From 84451e521bf1bf3275ea7d043168de14e29a01b5 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 17:23:56 +0800 Subject: [PATCH 08/13] style: Only flush stylesheet invalidations for origins that have changed. --- components/style/gecko/data.rs | 2 +- components/style/stylesheet_set.rs | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs index 3e44ee02e2a..1ac69f2f29e 100644 --- a/components/style/gecko/data.rs +++ b/components/style/gecko/data.rs @@ -163,7 +163,7 @@ impl PerDocumentStyleDataImpl { } let author_style_disabled = self.stylesheets.author_style_disabled(); - self.stylist.clear(); + let iter = self.stylesheets.flush(document_element); self.stylist.rebuild( iter, diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index 039a7a1e611..60f35dd2788 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -8,7 +8,7 @@ use dom::TElement; use invalidation::stylesheets::StylesheetInvalidationSet; use shared_lock::SharedRwLockReadGuard; use std::slice; -use stylesheets::{PerOrigin, StylesheetInDocument}; +use stylesheets::{Origin, PerOrigin, StylesheetInDocument}; use stylist::Stylist; /// Entry for a StylesheetSet. We don't bother creating a constructor, because @@ -168,7 +168,7 @@ where /// over the new stylesheet list. pub fn flush( &mut self, - document_element: Option + document_element: Option, ) -> StylesheetIterator where E: TElement, @@ -176,9 +176,11 @@ where debug!("StylesheetSet::flush"); debug_assert!(self.has_changed()); - for data in self.invalidation_data.iter_mut_origins() { - data.0.invalidations.flush(document_element); - data.0.dirty = false; + for (data, _) in self.invalidation_data.iter_mut_origins() { + if data.dirty { + data.invalidations.flush(document_element); + data.dirty = false; + } } self.iter() @@ -194,11 +196,19 @@ where /// /// FIXME(emilio): Make this more granular. pub fn force_dirty(&mut self) { - for data in self.invalidation_data.iter_mut_origins() { - data.0.invalidations.invalidate_fully(); - data.0.dirty = true; + for (data, _) in self.invalidation_data.iter_mut_origins() { + data.invalidations.invalidate_fully(); + data.dirty = true; } } + + /// Mark the stylesheets for the specified origin as dirty, because + /// something external may have invalidated it. + pub fn force_dirty_origin(&mut self, origin: &Origin) { + let data = self.invalidation_data.borrow_mut_for_origin(origin); + data.invalidations.invalidate_fully(); + data.dirty = true; + } } struct InvalidationData { From d90ff1801a5d13ec47a087aef56fc2ee29089678 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 17:38:06 +0800 Subject: [PATCH 09/13] style: Fix origin iteration order. --- components/style/stylesheets/origin.rs | 32 +++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/components/style/stylesheets/origin.rs b/components/style/stylesheets/origin.rs index a9a31bfe124..7ca3e21fcbe 100644 --- a/components/style/stylesheets/origin.rs +++ b/components/style/stylesheets/origin.rs @@ -16,11 +16,11 @@ pub enum Origin { /// https://drafts.csswg.org/css-cascade/#cascade-origin-us UserAgent, - /// https://drafts.csswg.org/css-cascade/#cascade-origin-author - Author, - /// https://drafts.csswg.org/css-cascade/#cascade-origin-user User, + + /// https://drafts.csswg.org/css-cascade/#cascade-origin-author + Author, } /// An object that stores a `T` for each origin of the CSS cascade. @@ -30,11 +30,11 @@ pub struct PerOrigin { /// Data for `Origin::UserAgent`. pub user_agent: T, - /// Data for `Origin::Author`. - pub author: T, - /// Data for `Origin::User`. pub user: T, + + /// Data for `Origin::Author`. + pub author: T, } impl PerOrigin { @@ -43,8 +43,8 @@ impl PerOrigin { pub fn borrow_for_origin(&self, origin: &Origin) -> &T { match *origin { Origin::UserAgent => &self.user_agent, - Origin::Author => &self.author, Origin::User => &self.user, + Origin::Author => &self.author, } } @@ -54,13 +54,13 @@ impl PerOrigin { pub fn borrow_mut_for_origin(&mut self, origin: &Origin) -> &mut T { match *origin { Origin::UserAgent => &mut self.user_agent, - Origin::Author => &mut self.author, Origin::User => &mut self.user, + Origin::Author => &mut self.author, } } /// Iterates over references to per-origin extra style data, from highest - /// level (user) to lowest (user agent). + /// level (author) to lowest (user agent). pub fn iter_origins(&self) -> PerOriginIter { PerOriginIter { data: &self, @@ -69,7 +69,7 @@ impl PerOrigin { } /// Iterates over mutable references to per-origin extra style data, from - /// highest level (user) to lowest (user agent). + /// highest level (author) to lowest (user agent). pub fn iter_mut_origins(&mut self) -> PerOriginIterMut { PerOriginIterMut { data: self, @@ -88,12 +88,12 @@ pub trait PerOriginClear { impl PerOriginClear for PerOrigin where T: PerOriginClear { fn clear(&mut self) { self.user_agent.clear(); - self.author.clear(); self.user.clear(); + self.author.clear(); } } -/// Iterator over `PerOrigin`, from highest level (user) to lowest +/// Iterator over `PerOrigin`, from highest level (author) to lowest /// (user agent). /// /// We rely on this specific order for correctly looking up @font-face, @@ -108,8 +108,8 @@ impl<'a, T> Iterator for PerOriginIter<'a, T> where T: 'a { fn next(&mut self) -> Option { let result = match self.cur { - 0 => (&self.data.user, Origin::User), - 1 => (&self.data.author, Origin::Author), + 0 => (&self.data.author, Origin::Author), + 1 => (&self.data.user, Origin::User), 2 => (&self.data.user_agent, Origin::UserAgent), _ => return None, }; @@ -135,8 +135,8 @@ impl<'a, T> Iterator for PerOriginIterMut<'a, T> where T: 'a { fn next(&mut self) -> Option { let result = match self.cur { - 0 => (unsafe { transmute(&mut (*self.data).user) }, Origin::User), - 1 => (unsafe { transmute(&mut (*self.data).author) }, Origin::Author), + 0 => (unsafe { transmute(&mut (*self.data).author) }, Origin::Author), + 1 => (unsafe { transmute(&mut (*self.data).user) }, Origin::User), 2 => (unsafe { transmute(&mut (*self.data).user_agent) }, Origin::UserAgent), _ => return None, }; From 0cf487b0ace9aa5055d8a5c4c90256684d39392a Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 18:18:52 +0800 Subject: [PATCH 10/13] style: Make Servo_StyleSet_NoteStyleSheetsChanged take a set of origins to dirty. --- components/style/gecko_bindings/sugar/mod.rs | 1 + .../gecko_bindings/sugar/origin_flags.rs | 50 +++++++++++++++++++ ports/geckolib/glue.rs | 8 ++- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 components/style/gecko_bindings/sugar/origin_flags.rs diff --git a/components/style/gecko_bindings/sugar/mod.rs b/components/style/gecko_bindings/sugar/mod.rs index 159beb6a332..1d4208f5421 100644 --- a/components/style/gecko_bindings/sugar/mod.rs +++ b/components/style/gecko_bindings/sugar/mod.rs @@ -13,6 +13,7 @@ mod ns_style_auto_array; pub mod ns_style_coord; mod ns_t_array; mod ns_timing_function; +mod origin_flags; pub mod ownership; pub mod refptr; mod style_complex_color; diff --git a/components/style/gecko_bindings/sugar/origin_flags.rs b/components/style/gecko_bindings/sugar/origin_flags.rs new file mode 100644 index 00000000000..1a121ee98ad --- /dev/null +++ b/components/style/gecko_bindings/sugar/origin_flags.rs @@ -0,0 +1,50 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//! Helper to iterate over `OriginFlags` bits. + +use gecko_bindings::structs::OriginFlags; +use gecko_bindings::structs::OriginFlags_Author; +use gecko_bindings::structs::OriginFlags_User; +use gecko_bindings::structs::OriginFlags_UserAgent; +use stylesheets::Origin; + +impl OriginFlags { + /// Returns an iterator over the origins present in the `OriginFlags`, + /// in order from highest priority (author) to lower (user agent). + pub fn iter(self) -> OriginFlagsIter { + OriginFlagsIter { + origin_flags: self, + cur: 0, + } + } +} + +/// Iterates over the origins present in an `OriginFlags`, in order from +/// highest priority (author) to lower (user agent). +pub struct OriginFlagsIter { + origin_flags: OriginFlags, + cur: usize, +} + +impl Iterator for OriginFlagsIter { + type Item = Origin; + + fn next(&mut self) -> Option { + loop { + let (bit, origin) = match self.cur { + 0 => (OriginFlags_Author, Origin::Author), + 1 => (OriginFlags_User, Origin::User), + 2 => (OriginFlags_UserAgent, Origin::UserAgent), + _ => return None, + }; + + self.cur += 1; + + if (self.origin_flags & bit).0 != 0 { + return Some(origin); + } + } + } +} diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index d20fce6fb13..f4a767024ac 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -74,6 +74,7 @@ use style::gecko_bindings::structs::{nsCSSFontFaceRule, nsCSSCounterStyleRule}; use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint, PropertyValuePair}; use style::gecko_bindings::structs::IterationCompositeOperation; use style::gecko_bindings::structs::MallocSizeOf; +use style::gecko_bindings::structs::OriginFlags; use style::gecko_bindings::structs::RawGeckoGfxMatrix4x4; use style::gecko_bindings::structs::RawGeckoPresContextOwned; use style::gecko_bindings::structs::SeenPtrs; @@ -954,11 +955,14 @@ pub extern "C" fn Servo_StyleSet_FlushStyleSheets( pub extern "C" fn Servo_StyleSet_NoteStyleSheetsChanged( raw_data: RawServoStyleSetBorrowed, author_style_disabled: bool, + changed_origins: OriginFlags, ) { let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); - data.stylesheets.force_dirty(); + for origin in changed_origins.iter() { + data.stylesheets.force_dirty_origin(&origin); + data.clear_stylist_origin(&origin); + } data.stylesheets.set_author_style_disabled(author_style_disabled); - data.clear_stylist(); } #[no_mangle] From 9ef387182919389f77f3f0c213be75a62b56182e Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 18:34:07 +0800 Subject: [PATCH 11/13] geckolib: Add FFI function to get stylesheet origin. --- ports/geckolib/glue.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index f4a767024ac..8c96744fe7c 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -75,6 +75,9 @@ use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint, PropertyValueP use style::gecko_bindings::structs::IterationCompositeOperation; use style::gecko_bindings::structs::MallocSizeOf; use style::gecko_bindings::structs::OriginFlags; +use style::gecko_bindings::structs::OriginFlags_Author; +use style::gecko_bindings::structs::OriginFlags_User; +use style::gecko_bindings::structs::OriginFlags_UserAgent; use style::gecko_bindings::structs::RawGeckoGfxMatrix4x4; use style::gecko_bindings::structs::RawGeckoPresContextOwned; use style::gecko_bindings::structs::SeenPtrs; @@ -1012,6 +1015,17 @@ pub extern "C" fn Servo_StyleSheet_SizeOfIncludingThis( .malloc_size_of_children(&guard, malloc_size_of) } +#[no_mangle] +pub extern "C" fn Servo_StyleSheet_GetOrigin( + sheet: RawServoStyleSheetContentsBorrowed +) -> OriginFlags { + match StylesheetContents::as_arc(&sheet).origin { + Origin::UserAgent => OriginFlags_UserAgent, + Origin::User => OriginFlags_User, + Origin::Author => OriginFlags_Author, + } +} + fn read_locked_arc(raw: & as HasFFI>::FFIType, func: F) -> R where Locked: HasArcFFI, F: FnOnce(&T) -> R { From 22a6a2c1bb8330be413518cf207b1b50a7836e00 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sat, 12 Aug 2017 18:59:43 +0800 Subject: [PATCH 12/13] geckolib: Only dirty the relevant origin when stylesheets are added or removed. --- ports/geckolib/glue.rs | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 8c96744fe7c..b8ab946de88 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -118,6 +118,7 @@ use style::stylesheets::{FontFeatureValuesRule, ImportRule, KeyframesRule, Mallo use style::stylesheets::{MallocSizeOfWithRepeats, MediaRule}; use style::stylesheets::{NamespaceRule, Origin, PageRule, SizeOfState, StyleRule, SupportsRule}; use style::stylesheets::StylesheetContents; +use style::stylesheets::StylesheetInDocument; use style::stylesheets::StylesheetLoader as StyleStylesheetLoader; use style::stylesheets::keyframes_rule::{Keyframe, KeyframeSelector, KeyframesStepValue}; use style::stylesheets::supports_rule::parse_condition_or_declaration; @@ -849,12 +850,10 @@ pub extern "C" fn Servo_StyleSet_AppendStyleSheet( let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); let mut data = &mut *data; let guard = global_style_data.shared_lock.read(); - data.stylesheets.append_stylesheet( - &data.stylist, - unsafe { GeckoStyleSheet::new(sheet) }, - &guard - ); - data.clear_stylist(); + let sheet = unsafe { GeckoStyleSheet::new(sheet) }; + let origin = sheet.contents(&guard).origin; + data.stylesheets.append_stylesheet(&data.stylist, sheet, &guard); + data.clear_stylist_origin(&origin); } #[no_mangle] @@ -898,12 +897,10 @@ pub extern "C" fn Servo_StyleSet_PrependStyleSheet( let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); let mut data = &mut *data; let guard = global_style_data.shared_lock.read(); - data.stylesheets.prepend_stylesheet( - &data.stylist, - unsafe { GeckoStyleSheet::new(sheet) }, - &guard, - ); - data.clear_stylist(); + let sheet = unsafe { GeckoStyleSheet::new(sheet) }; + let origin = sheet.contents(&guard).origin; + data.stylesheets.prepend_stylesheet(&data.stylist, sheet, &guard); + data.clear_stylist_origin(&origin); } #[no_mangle] @@ -916,13 +913,15 @@ pub extern "C" fn Servo_StyleSet_InsertStyleSheetBefore( let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); let mut data = &mut *data; let guard = global_style_data.shared_lock.read(); + let sheet = unsafe { GeckoStyleSheet::new(sheet) }; + let origin = sheet.contents(&guard).origin; data.stylesheets.insert_stylesheet_before( &data.stylist, - unsafe { GeckoStyleSheet::new(sheet) }, + sheet, unsafe { GeckoStyleSheet::new(before_sheet) }, &guard, ); - data.clear_stylist(); + data.clear_stylist_origin(&origin); } #[no_mangle] @@ -934,12 +933,10 @@ pub extern "C" fn Servo_StyleSet_RemoveStyleSheet( let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); let mut data = &mut *data; let guard = global_style_data.shared_lock.read(); - data.stylesheets.remove_stylesheet( - &data.stylist, - unsafe { GeckoStyleSheet::new(sheet) }, - &guard, - ); - data.clear_stylist(); + let sheet = unsafe { GeckoStyleSheet::new(sheet) }; + let origin = sheet.contents(&guard).origin; + data.stylesheets.remove_stylesheet(&data.stylist, sheet, &guard); + data.clear_stylist_origin(&origin); } #[no_mangle] From d6856c0020b7a1eb914549e1c61201580d3fe163 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Sun, 13 Aug 2017 19:39:01 +0800 Subject: [PATCH 13/13] style: Update Gecko bindings. --- components/style/gecko/generated/bindings.rs | 10 +- .../style/gecko/generated/structs_debug.rs | 692 +++++++++++------- .../style/gecko/generated/structs_release.rs | 692 +++++++++++------- 3 files changed, 843 insertions(+), 551 deletions(-) diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index e9e012a3a89..0d6dbabb502 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -15,6 +15,7 @@ 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::MallocSizeOf; +use gecko_bindings::structs::mozilla::OriginFlags; use gecko_bindings::structs::mozilla::Side; use gecko_bindings::structs::mozilla::UniquePtr; use gecko_bindings::structs::nsIContent; @@ -1956,6 +1957,11 @@ extern "C" { RawServoStyleSheetContentsBorrowed) -> usize; } +extern "C" { + pub fn Servo_StyleSheet_GetOrigin(sheet: + RawServoStyleSheetContentsBorrowed) + -> OriginFlags; +} extern "C" { pub fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextOwned) -> RawServoStyleSetOwned; @@ -2006,7 +2012,9 @@ extern "C" { extern "C" { pub fn Servo_StyleSet_NoteStyleSheetsChanged(set: RawServoStyleSetBorrowed, - author_style_disabled: bool); + author_style_disabled: bool, + changed_origins: + OriginFlags); } extern "C" { pub fn Servo_StyleSet_GetKeyframesForName(set: RawServoStyleSetBorrowed, diff --git a/components/style/gecko/generated/structs_debug.rs b/components/style/gecko/generated/structs_debug.rs index ead3685edd3..04581692a4c 100644 --- a/components/style/gecko/generated/structs_debug.rs +++ b/components/style/gecko/generated/structs_debug.rs @@ -1052,8 +1052,6 @@ pub mod root { } pub type pair_first_type<_T1> = _T1; pub type pair_second_type<_T2> = _T2; - pub type pair__PCCP = u8; - pub type pair__PCCFP = u8; #[repr(C)] #[derive(Debug, Copy)] pub struct input_iterator_tag { @@ -8285,6 +8283,51 @@ pub mod root { PropertyStyleAnimationValuePair ) , "::" , stringify ! ( mValue ) )); } + pub const OriginFlags_UserAgent: root::mozilla::OriginFlags = + OriginFlags(1); + pub const OriginFlags_User: root::mozilla::OriginFlags = + OriginFlags(2); + pub const OriginFlags_Author: root::mozilla::OriginFlags = + OriginFlags(4); + pub const OriginFlags_All: root::mozilla::OriginFlags = + OriginFlags(7); + impl ::std::ops::BitOr for + root::mozilla::OriginFlags { + type + Output + = + Self; + #[inline] + fn bitor(self, other: Self) -> Self { + OriginFlags(self.0 | other.0) + } + } + impl ::std::ops::BitOrAssign for root::mozilla::OriginFlags { + #[inline] + fn bitor_assign(&mut self, rhs: root::mozilla::OriginFlags) { + self.0 |= rhs.0; + } + } + impl ::std::ops::BitAnd for + root::mozilla::OriginFlags { + type + Output + = + Self; + #[inline] + fn bitand(self, other: Self) -> Self { + OriginFlags(self.0 & other.0) + } + } + impl ::std::ops::BitAndAssign for root::mozilla::OriginFlags { + #[inline] + fn bitand_assign(&mut self, rhs: root::mozilla::OriginFlags) { + self.0 &= rhs.0; + } + } + #[repr(C)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub struct OriginFlags(pub u8); #[test] fn __bindgen_test_layout_DefaultDelete_open0_RawServoStyleSet_close0_instantiation() { assert_eq!(::std::mem::size_of::() , @@ -16919,6 +16962,7 @@ pub mod root { pub mPageUnloadingEventTimeStamp: root::mozilla::TimeStamp, pub mDocGroup: root::RefPtr, pub mTrackingScripts: [u64; 6usize], + pub mBufferedCSPViolations: root::nsTArray>, } pub type nsIDocument_GlobalObject = root::mozilla::dom::GlobalObject; pub type nsIDocument_Encoding = root::mozilla::Encoding; @@ -17213,7 +17257,7 @@ pub mod root { pub const nsIDocument_kSegmentSize: usize = 128; #[test] fn bindgen_test_layout_nsIDocument() { - assert_eq!(::std::mem::size_of::() , 880usize , concat ! + assert_eq!(::std::mem::size_of::() , 888usize , concat ! ( "Size of: " , stringify ! ( nsIDocument ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsIDocument ) )); @@ -19082,7 +19126,7 @@ pub mod root { } } #[inline] - pub fn mIsScopedStyleEnabled(&self) -> ::std::os::raw::c_uint { + pub fn mBufferingCSPViolations(&self) -> bool { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -19092,15 +19136,14 @@ pub mod root { *mut u64 as *mut u8, ::std::mem::size_of::()) }; - let mask = 1688849860263936u64 as u64; + let mask = 562949953421312u64 as u64; let val = (unit_field_val & mask) >> 49usize; - unsafe { ::std::mem::transmute(val as u32) } + unsafe { ::std::mem::transmute(val as u8) } } #[inline] - pub fn set_mIsScopedStyleEnabled(&mut self, - val: ::std::os::raw::c_uint) { - let mask = 1688849860263936u64 as u64; - let val = val as u32 as u64; + pub fn set_mBufferingCSPViolations(&mut self, val: bool) { + let mask = 562949953421312u64 as u64; + let val = val as u8 as u64; let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -19121,6 +19164,45 @@ pub mod root { } } #[inline] + pub fn mIsScopedStyleEnabled(&self) -> ::std::os::raw::c_uint { + let mut unit_field_val: u64 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u64 as *mut u8, + ::std::mem::size_of::()) + }; + let mask = 3377699720527872u64 as u64; + let val = (unit_field_val & mask) >> 50usize; + unsafe { ::std::mem::transmute(val as u32) } + } + #[inline] + pub fn set_mIsScopedStyleEnabled(&mut self, + val: ::std::os::raw::c_uint) { + let mask = 3377699720527872u64 as u64; + let val = val as u32 as u64; + let mut unit_field_val: u64 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u64 as *mut u8, + ::std::mem::size_of::()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 50usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::()); + } + } + #[inline] pub fn new_bitfield_1(mBidiEnabled: bool, mMathMLEnabled: bool, mIsInitialDocumentInWindow: bool, mIgnoreDocGroupMismatches: bool, @@ -19165,6 +19247,7 @@ pub mod root { mIsContentDocument: bool, mMightHaveStaleServoData: bool, mDidCallBeginLoad: bool, + mBufferingCSPViolations: bool, mIsScopedStyleEnabled: ::std::os::raw::c_uint) -> u64 { ({ @@ -19217,567 +19300,582 @@ pub mod root { ({ ({ ({ - 0 + ({ + 0 + } + | + ((mBidiEnabled + as + u8 + as + u64) + << + 0usize) + & + (1u64 + as + u64)) } | - ((mBidiEnabled + ((mMathMLEnabled as u8 as u64) << - 0usize) + 1usize) & - (1u64 + (2u64 as u64)) } | - ((mMathMLEnabled + ((mIsInitialDocumentInWindow as u8 as u64) << - 1usize) + 2usize) & - (2u64 + (4u64 as u64)) } | - ((mIsInitialDocumentInWindow + ((mIgnoreDocGroupMismatches as u8 as u64) << - 2usize) + 3usize) & - (4u64 + (8u64 as u64)) } | - ((mIgnoreDocGroupMismatches + ((mLoadedAsData as u8 as u64) << - 3usize) + 4usize) & - (8u64 + (16u64 as u64)) } | - ((mLoadedAsData + ((mLoadedAsInteractiveData as u8 as u64) << - 4usize) + 5usize) & - (16u64 + (32u64 as u64)) } | - ((mLoadedAsInteractiveData + ((mMayStartLayout as u8 as u64) << - 5usize) + 6usize) & - (32u64 + (64u64 as u64)) } | - ((mMayStartLayout + ((mHaveFiredTitleChange as u8 as u64) << - 6usize) + 7usize) & - (64u64 + (128u64 as u64)) } | - ((mHaveFiredTitleChange + ((mIsShowing as u8 as u64) << - 7usize) + 8usize) & - (128u64 + (256u64 as u64)) } | - ((mIsShowing + ((mVisible as u8 as u64) << - 8usize) + 9usize) & - (256u64 + (512u64 as u64)) } | - ((mVisible + ((mHasReferrerPolicyCSP as u8 as u64) << - 9usize) + 10usize) & - (512u64 + (1024u64 as u64)) } | - ((mHasReferrerPolicyCSP + ((mRemovedFromDocShell as u8 as u64) << - 10usize) + 11usize) & - (1024u64 + (2048u64 as u64)) } | - ((mRemovedFromDocShell + ((mAllowDNSPrefetch as u8 as u64) << - 11usize) + 12usize) & - (2048u64 + (4096u64 as u64)) } | - ((mAllowDNSPrefetch + ((mIsStaticDocument as u8 as u64) << - 12usize) + 13usize) & - (4096u64 + (8192u64 as u64)) } | - ((mIsStaticDocument + ((mCreatingStaticClone as u8 as u64) << - 13usize) + 14usize) & - (8192u64 + (16384u64 as u64)) } | - ((mCreatingStaticClone + ((mInUnlinkOrDeletion as u8 as u64) << - 14usize) + 15usize) & - (16384u64 + (32768u64 as u64)) } | - ((mInUnlinkOrDeletion + ((mHasHadScriptHandlingObject as u8 as u64) << - 15usize) + 16usize) & - (32768u64 + (65536u64 as u64)) } | - ((mHasHadScriptHandlingObject + ((mIsBeingUsedAsImage as u8 as u64) << - 16usize) + 17usize) & - (65536u64 + (131072u64 as u64)) } | - ((mIsBeingUsedAsImage + ((mIsSyntheticDocument as u8 as u64) << - 17usize) + 18usize) & - (131072u64 + (262144u64 as u64)) } | - ((mIsSyntheticDocument + ((mHasLinksToUpdate as u8 as u64) << - 18usize) + 19usize) & - (262144u64 + (524288u64 as u64)) } | - ((mHasLinksToUpdate + ((mHasLinksToUpdateRunnable as u8 as u64) << - 19usize) + 20usize) & - (524288u64 + (1048576u64 as u64)) } | - ((mHasLinksToUpdateRunnable + ((mMayHaveDOMMutationObservers as u8 as u64) << - 20usize) + 21usize) & - (1048576u64 + (2097152u64 as u64)) } | - ((mMayHaveDOMMutationObservers + ((mMayHaveAnimationObservers as u8 as u64) << - 21usize) + 22usize) & - (2097152u64 + (4194304u64 as u64)) } | - ((mMayHaveAnimationObservers + ((mHasMixedActiveContentLoaded as u8 as u64) << - 22usize) + 23usize) & - (4194304u64 + (8388608u64 as u64)) } | - ((mHasMixedActiveContentLoaded + ((mHasMixedActiveContentBlocked as u8 as u64) << - 23usize) + 24usize) & - (8388608u64 + (16777216u64 as u64)) } | - ((mHasMixedActiveContentBlocked + ((mHasMixedDisplayContentLoaded as u8 as u64) << - 24usize) + 25usize) & - (16777216u64 + (33554432u64 as u64)) } | - ((mHasMixedDisplayContentLoaded + ((mHasMixedDisplayContentBlocked as u8 as u64) << - 25usize) + 26usize) & - (33554432u64 + (67108864u64 as u64)) } | - ((mHasMixedDisplayContentBlocked + ((mHasMixedContentObjectSubrequest as u8 as u64) << - 26usize) + 27usize) & - (67108864u64 + (134217728u64 as u64)) } | - ((mHasMixedContentObjectSubrequest + ((mHasCSP as u8 as u64) << - 27usize) + 28usize) & - (134217728u64 + (268435456u64 as u64)) } | - ((mHasCSP + ((mHasUnsafeEvalCSP as u8 as u64) << - 28usize) + 29usize) & - (268435456u64 + (536870912u64 as u64)) } | - ((mHasUnsafeEvalCSP + ((mHasUnsafeInlineCSP as u8 as u64) << - 29usize) + 30usize) & - (536870912u64 + (1073741824u64 as u64)) } | - ((mHasUnsafeInlineCSP + ((mHasTrackingContentBlocked as u8 as u64) << - 30usize) + 31usize) & - (1073741824u64 + (2147483648u64 as u64)) } | - ((mHasTrackingContentBlocked + ((mHasTrackingContentLoaded as u8 as u64) << - 31usize) + 32usize) & - (2147483648u64 + (4294967296u64 as u64)) } | - ((mHasTrackingContentLoaded + ((mBFCacheDisallowed as u8 as u64) << - 32usize) + 33usize) & - (4294967296u64 + (8589934592u64 as u64)) } | - ((mBFCacheDisallowed + ((mHasHadDefaultView as u8 as u64) << - 33usize) + 34usize) & - (8589934592u64 + (17179869184u64 as u64)) } | - ((mHasHadDefaultView + ((mStyleSheetChangeEventsEnabled as u8 as u64) << - 34usize) + 35usize) & - (17179869184u64 + (34359738368u64 as u64)) } | - ((mStyleSheetChangeEventsEnabled + ((mIsSrcdocDocument as u8 as u64) << - 35usize) + 36usize) & - (34359738368u64 + (68719476736u64 as u64)) } | - ((mIsSrcdocDocument + ((mDidDocumentOpen as u8 as u64) << - 36usize) + 37usize) & - (68719476736u64 + (137438953472u64 as u64)) } | - ((mDidDocumentOpen + ((mHasDisplayDocument as u8 as u64) << - 37usize) + 38usize) & - (137438953472u64 + (274877906944u64 as u64)) } | - ((mHasDisplayDocument + ((mFontFaceSetDirty as u8 as u64) << - 38usize) + 39usize) & - (274877906944u64 + (549755813888u64 as u64)) } | - ((mFontFaceSetDirty + ((mGetUserFontSetCalled as u8 as u64) << - 39usize) + 40usize) & - (549755813888u64 + (1099511627776u64 as u64)) } | - ((mGetUserFontSetCalled + ((mPostedFlushUserFontSet as u8 as u64) << - 40usize) & - (1099511627776u64 + 41usize) & + (2199023255552u64 as u64)) } | - ((mPostedFlushUserFontSet + ((mDidFireDOMContentLoaded as u8 as u64) - << 41usize) & - (2199023255552u64 + << 42usize) & + (4398046511104u64 as u64)) } | - ((mDidFireDOMContentLoaded + ((mHasScrollLinkedEffect as u8 as u64) << - 42usize) & - (4398046511104u64 as + 43usize) & + (8796093022208u64 as u64)) } | - ((mHasScrollLinkedEffect as u8 - as u64) << 43usize) & - (8796093022208u64 as u64)) + ((mFrameRequestCallbacksScheduled + as u8 as u64) << 44usize) + & + (17592186044416u64 as u64)) } | - ((mFrameRequestCallbacksScheduled as - u8 as u64) << 44usize) & - (17592186044416u64 as u64)) + ((mIsTopLevelContentDocument as u8 + as u64) << 45usize) & + (35184372088832u64 as u64)) } | - ((mIsTopLevelContentDocument as u8 as - u64) << 45usize) & - (35184372088832u64 as u64)) + ((mIsContentDocument as u8 as u64) << + 46usize) & + (70368744177664u64 as u64)) } | - ((mIsContentDocument as u8 as u64) << 46usize) - & (70368744177664u64 as u64)) + ((mMightHaveStaleServoData as u8 as u64) << + 47usize) & (140737488355328u64 as u64)) } | - ((mMightHaveStaleServoData as u8 as u64) << - 47usize) & (140737488355328u64 as u64)) + ((mDidCallBeginLoad as u8 as u64) << 48usize) & + (281474976710656u64 as u64)) } | - ((mDidCallBeginLoad as u8 as u64) << 48usize) & - (281474976710656u64 as u64)) + ((mBufferingCSPViolations as u8 as u64) << 49usize) & + (562949953421312u64 as u64)) } | - ((mIsScopedStyleEnabled as u32 as u64) << 49usize) & - (1688849860263936u64 as u64)) + ((mIsScopedStyleEnabled as u32 as u64) << 50usize) & + (3377699720527872u64 as u64)) } } #[repr(C)] @@ -25014,57 +25112,57 @@ pub mod root { pub struct nsRange { _unused: [u8; 0], } - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_EDITABLE; - pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_NATIVE_ANONYMOUS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_TYPE_SPECIFIC_BITS_OFFSET; + pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_LISTENERMANAGER; + pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_PROPERTIES; + pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_ANONYMOUS_ROOT; + pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; + pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_NATIVE_ANONYMOUS_ROOT; + pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_FORCE_XBL_BINDINGS; + pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_MAY_BE_IN_BINDING_MNGR; + pub const NODE_IS_EDITABLE: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_EDITABLE; + pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_NATIVE_ANONYMOUS; + pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_IN_SHADOW_TREE; + pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_EMPTY_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_SLOW_SELECTOR; + pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_EDGE_CHILD_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; + pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_ALL_SELECTOR_FLAGS; + pub const NODE_NEEDS_FRAME: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_NEEDS_FRAME; + pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_DESCENDANTS_NEED_FRAMES; + pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_ACCESSKEY; + pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_DIRECTION_RTL; + pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_DIRECTION_LTR; + pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_ALL_DIRECTION_FLAGS; + pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_CHROME_ONLY_ACCESS; + pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; + pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_72 { + pub enum _bindgen_ty_84 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, @@ -32642,46 +32740,46 @@ pub mod root { assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsISMILAttr ) )); } - pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_1; pub const ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO: - root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_74 + root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_86 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_3; + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_3; pub const ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT: - root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; - pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_PENDING_RESTYLE_FLAGS; - pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; - pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_ALL_RESTYLE_FLAGS; - pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; + root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; + pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_PENDING_RESTYLE_FLAGS; + pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; + pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_ALL_RESTYLE_FLAGS; + pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_74 { + pub enum _bindgen_ty_86 { ELEMENT_SHARED_RESTYLE_BIT_1 = 8388608, ELEMENT_SHARED_RESTYLE_BIT_2 = 16777216, ELEMENT_SHARED_RESTYLE_BIT_3 = 33554432, @@ -33557,7 +33655,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_200542_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_226841_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33913,7 +34011,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_202359_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_228658_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34074,7 +34172,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_iterator_open0_input_iterator_tag_UniquePtr_open1_JSErrorNotes_Note_DeletePolicy_open2_JSErrorNotes_Note_close2_close1_long__bindgen_ty_id_207978__bindgen_ty_id_207985_close0_instantiation() { + fn __bindgen_test_layout_iterator_open0_input_iterator_tag_UniquePtr_open1_JSErrorNotes_Note_DeletePolicy_open2_JSErrorNotes_Note_close2_close1_long__bindgen_ty_id_234269__bindgen_ty_id_234276_close0_instantiation() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34239,6 +34337,28 @@ pub mod root { root::nsCOMPtr ) )); } #[test] + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray> ) )); + assert_eq!(::std::mem::align_of::>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_AnonymousContent_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( @@ -34300,7 +34420,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_210463_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_236754_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34368,7 +34488,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_210765_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_237056_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34480,7 +34600,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_NotNull_open0__bindgen_ty_id_211307_close0_instantiation() { + fn __bindgen_test_layout_NotNull_open0__bindgen_ty_id_237598_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34805,6 +34925,28 @@ pub mod root { root::RefPtr ) )); } #[test] + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::>>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray> ) )); + assert_eq!(::std::mem::align_of::>>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray> ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::>() + , 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() + , 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] fn __bindgen_test_layout_RefPtr_open0_CSSRuleListImpl_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( @@ -34862,7 +35004,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_211722_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_238019_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34952,7 +35094,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_212121_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_238418_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35053,7 +35195,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213085_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_239383_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35142,7 +35284,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213390_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_239688_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35153,7 +35295,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213395_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_239693_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35210,7 +35352,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213886_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240184_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35858,7 +36000,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_216747_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_243035_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35937,7 +36079,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_223009_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_249305_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35970,7 +36112,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_224170_close0_instantiation() { + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_250466_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35981,7 +36123,7 @@ pub mod root { root::JS::Heap<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_224174_close0_instantiation() { + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_250470_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36003,7 +36145,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_TenuredHeap_open0__bindgen_ty_id_224181_close0_instantiation() { + fn __bindgen_test_layout_TenuredHeap_open0__bindgen_ty_id_250477_close0_instantiation() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36036,7 +36178,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_2() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36047,7 +36189,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_2() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36058,7 +36200,7 @@ pub mod root { root::nsTArray> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_1() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_3() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36082,7 +36224,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_225354_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_251547_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36277,7 +36419,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_226802_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_252995_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36382,7 +36524,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_229225_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_255418_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36393,7 +36535,7 @@ pub mod root { root::nsTArray<*mut root::mozilla::CounterStyle> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_1() { + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_3() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36404,7 +36546,7 @@ pub mod root { root::nsTArray> ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_2() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_4() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37083,7 +37225,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_231778_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_257971_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37320,7 +37462,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_239586_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_265779_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37331,7 +37473,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_239591_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_265784_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37419,7 +37561,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_239704_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_265897_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37706,7 +37848,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_241290_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_267483_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37728,7 +37870,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_241452_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_267645_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37739,7 +37881,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_241457_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_267650_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37871,7 +38013,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_243541_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_269734_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37882,7 +38024,7 @@ pub mod root { root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_243549_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_269742_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( diff --git a/components/style/gecko/generated/structs_release.rs b/components/style/gecko/generated/structs_release.rs index be299f97ee7..0eaf91144ae 100644 --- a/components/style/gecko/generated/structs_release.rs +++ b/components/style/gecko/generated/structs_release.rs @@ -1052,8 +1052,6 @@ pub mod root { } pub type pair_first_type<_T1> = _T1; pub type pair_second_type<_T2> = _T2; - pub type pair__PCCP = u8; - pub type pair__PCCFP = u8; #[repr(C)] #[derive(Debug, Copy)] pub struct input_iterator_tag { @@ -8131,6 +8129,51 @@ pub mod root { PropertyStyleAnimationValuePair ) , "::" , stringify ! ( mValue ) )); } + pub const OriginFlags_UserAgent: root::mozilla::OriginFlags = + OriginFlags(1); + pub const OriginFlags_User: root::mozilla::OriginFlags = + OriginFlags(2); + pub const OriginFlags_Author: root::mozilla::OriginFlags = + OriginFlags(4); + pub const OriginFlags_All: root::mozilla::OriginFlags = + OriginFlags(7); + impl ::std::ops::BitOr for + root::mozilla::OriginFlags { + type + Output + = + Self; + #[inline] + fn bitor(self, other: Self) -> Self { + OriginFlags(self.0 | other.0) + } + } + impl ::std::ops::BitOrAssign for root::mozilla::OriginFlags { + #[inline] + fn bitor_assign(&mut self, rhs: root::mozilla::OriginFlags) { + self.0 |= rhs.0; + } + } + impl ::std::ops::BitAnd for + root::mozilla::OriginFlags { + type + Output + = + Self; + #[inline] + fn bitand(self, other: Self) -> Self { + OriginFlags(self.0 & other.0) + } + } + impl ::std::ops::BitAndAssign for root::mozilla::OriginFlags { + #[inline] + fn bitand_assign(&mut self, rhs: root::mozilla::OriginFlags) { + self.0 &= rhs.0; + } + } + #[repr(C)] + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] + pub struct OriginFlags(pub u8); #[test] fn __bindgen_test_layout_DefaultDelete_open0_RawServoStyleSet_close0_instantiation() { assert_eq!(::std::mem::size_of::() , @@ -16685,6 +16728,7 @@ pub mod root { pub mPageUnloadingEventTimeStamp: root::mozilla::TimeStamp, pub mDocGroup: root::RefPtr, pub mTrackingScripts: [u64; 5usize], + pub mBufferedCSPViolations: root::nsTArray, } pub type nsIDocument_GlobalObject = root::mozilla::dom::GlobalObject; pub type nsIDocument_Encoding = root::mozilla::Encoding; @@ -16979,7 +17023,7 @@ pub mod root { pub const nsIDocument_kSegmentSize: usize = 128; #[test] fn bindgen_test_layout_nsIDocument() { - assert_eq!(::std::mem::size_of::() , 856usize , concat ! + assert_eq!(::std::mem::size_of::() , 864usize , concat ! ( "Size of: " , stringify ! ( nsIDocument ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsIDocument ) )); @@ -18848,7 +18892,7 @@ pub mod root { } } #[inline] - pub fn mIsScopedStyleEnabled(&self) -> ::std::os::raw::c_uint { + pub fn mBufferingCSPViolations(&self) -> bool { let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -18858,15 +18902,14 @@ pub mod root { *mut u64 as *mut u8, ::std::mem::size_of::()) }; - let mask = 1688849860263936u64 as u64; + let mask = 562949953421312u64 as u64; let val = (unit_field_val & mask) >> 49usize; - unsafe { ::std::mem::transmute(val as u32) } + unsafe { ::std::mem::transmute(val as u8) } } #[inline] - pub fn set_mIsScopedStyleEnabled(&mut self, - val: ::std::os::raw::c_uint) { - let mask = 1688849860263936u64 as u64; - let val = val as u32 as u64; + pub fn set_mBufferingCSPViolations(&mut self, val: bool) { + let mask = 562949953421312u64 as u64; + let val = val as u8 as u64; let mut unit_field_val: u64 = unsafe { ::std::mem::uninitialized() }; unsafe { @@ -18887,6 +18930,45 @@ pub mod root { } } #[inline] + pub fn mIsScopedStyleEnabled(&self) -> ::std::os::raw::c_uint { + let mut unit_field_val: u64 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u64 as *mut u8, + ::std::mem::size_of::()) + }; + let mask = 3377699720527872u64 as u64; + let val = (unit_field_val & mask) >> 50usize; + unsafe { ::std::mem::transmute(val as u32) } + } + #[inline] + pub fn set_mIsScopedStyleEnabled(&mut self, + val: ::std::os::raw::c_uint) { + let mask = 3377699720527872u64 as u64; + let val = val as u32 as u64; + let mut unit_field_val: u64 = + unsafe { ::std::mem::uninitialized() }; + unsafe { + ::std::ptr::copy_nonoverlapping(&self._bitfield_1 as *const _ + as *const u8, + &mut unit_field_val as + *mut u64 as *mut u8, + ::std::mem::size_of::()) + }; + unit_field_val &= !mask; + unit_field_val |= (val << 50usize) & mask; + unsafe { + ::std::ptr::copy_nonoverlapping(&unit_field_val as *const _ as + *const u8, + &mut self._bitfield_1 as + *mut _ as *mut u8, + ::std::mem::size_of::()); + } + } + #[inline] pub fn new_bitfield_1(mBidiEnabled: bool, mMathMLEnabled: bool, mIsInitialDocumentInWindow: bool, mIgnoreDocGroupMismatches: bool, @@ -18931,6 +19013,7 @@ pub mod root { mIsContentDocument: bool, mMightHaveStaleServoData: bool, mDidCallBeginLoad: bool, + mBufferingCSPViolations: bool, mIsScopedStyleEnabled: ::std::os::raw::c_uint) -> u64 { ({ @@ -18983,567 +19066,582 @@ pub mod root { ({ ({ ({ - 0 + ({ + 0 + } + | + ((mBidiEnabled + as + u8 + as + u64) + << + 0usize) + & + (1u64 + as + u64)) } | - ((mBidiEnabled + ((mMathMLEnabled as u8 as u64) << - 0usize) + 1usize) & - (1u64 + (2u64 as u64)) } | - ((mMathMLEnabled + ((mIsInitialDocumentInWindow as u8 as u64) << - 1usize) + 2usize) & - (2u64 + (4u64 as u64)) } | - ((mIsInitialDocumentInWindow + ((mIgnoreDocGroupMismatches as u8 as u64) << - 2usize) + 3usize) & - (4u64 + (8u64 as u64)) } | - ((mIgnoreDocGroupMismatches + ((mLoadedAsData as u8 as u64) << - 3usize) + 4usize) & - (8u64 + (16u64 as u64)) } | - ((mLoadedAsData + ((mLoadedAsInteractiveData as u8 as u64) << - 4usize) + 5usize) & - (16u64 + (32u64 as u64)) } | - ((mLoadedAsInteractiveData + ((mMayStartLayout as u8 as u64) << - 5usize) + 6usize) & - (32u64 + (64u64 as u64)) } | - ((mMayStartLayout + ((mHaveFiredTitleChange as u8 as u64) << - 6usize) + 7usize) & - (64u64 + (128u64 as u64)) } | - ((mHaveFiredTitleChange + ((mIsShowing as u8 as u64) << - 7usize) + 8usize) & - (128u64 + (256u64 as u64)) } | - ((mIsShowing + ((mVisible as u8 as u64) << - 8usize) + 9usize) & - (256u64 + (512u64 as u64)) } | - ((mVisible + ((mHasReferrerPolicyCSP as u8 as u64) << - 9usize) + 10usize) & - (512u64 + (1024u64 as u64)) } | - ((mHasReferrerPolicyCSP + ((mRemovedFromDocShell as u8 as u64) << - 10usize) + 11usize) & - (1024u64 + (2048u64 as u64)) } | - ((mRemovedFromDocShell + ((mAllowDNSPrefetch as u8 as u64) << - 11usize) + 12usize) & - (2048u64 + (4096u64 as u64)) } | - ((mAllowDNSPrefetch + ((mIsStaticDocument as u8 as u64) << - 12usize) + 13usize) & - (4096u64 + (8192u64 as u64)) } | - ((mIsStaticDocument + ((mCreatingStaticClone as u8 as u64) << - 13usize) + 14usize) & - (8192u64 + (16384u64 as u64)) } | - ((mCreatingStaticClone + ((mInUnlinkOrDeletion as u8 as u64) << - 14usize) + 15usize) & - (16384u64 + (32768u64 as u64)) } | - ((mInUnlinkOrDeletion + ((mHasHadScriptHandlingObject as u8 as u64) << - 15usize) + 16usize) & - (32768u64 + (65536u64 as u64)) } | - ((mHasHadScriptHandlingObject + ((mIsBeingUsedAsImage as u8 as u64) << - 16usize) + 17usize) & - (65536u64 + (131072u64 as u64)) } | - ((mIsBeingUsedAsImage + ((mIsSyntheticDocument as u8 as u64) << - 17usize) + 18usize) & - (131072u64 + (262144u64 as u64)) } | - ((mIsSyntheticDocument + ((mHasLinksToUpdate as u8 as u64) << - 18usize) + 19usize) & - (262144u64 + (524288u64 as u64)) } | - ((mHasLinksToUpdate + ((mHasLinksToUpdateRunnable as u8 as u64) << - 19usize) + 20usize) & - (524288u64 + (1048576u64 as u64)) } | - ((mHasLinksToUpdateRunnable + ((mMayHaveDOMMutationObservers as u8 as u64) << - 20usize) + 21usize) & - (1048576u64 + (2097152u64 as u64)) } | - ((mMayHaveDOMMutationObservers + ((mMayHaveAnimationObservers as u8 as u64) << - 21usize) + 22usize) & - (2097152u64 + (4194304u64 as u64)) } | - ((mMayHaveAnimationObservers + ((mHasMixedActiveContentLoaded as u8 as u64) << - 22usize) + 23usize) & - (4194304u64 + (8388608u64 as u64)) } | - ((mHasMixedActiveContentLoaded + ((mHasMixedActiveContentBlocked as u8 as u64) << - 23usize) + 24usize) & - (8388608u64 + (16777216u64 as u64)) } | - ((mHasMixedActiveContentBlocked + ((mHasMixedDisplayContentLoaded as u8 as u64) << - 24usize) + 25usize) & - (16777216u64 + (33554432u64 as u64)) } | - ((mHasMixedDisplayContentLoaded + ((mHasMixedDisplayContentBlocked as u8 as u64) << - 25usize) + 26usize) & - (33554432u64 + (67108864u64 as u64)) } | - ((mHasMixedDisplayContentBlocked + ((mHasMixedContentObjectSubrequest as u8 as u64) << - 26usize) + 27usize) & - (67108864u64 + (134217728u64 as u64)) } | - ((mHasMixedContentObjectSubrequest + ((mHasCSP as u8 as u64) << - 27usize) + 28usize) & - (134217728u64 + (268435456u64 as u64)) } | - ((mHasCSP + ((mHasUnsafeEvalCSP as u8 as u64) << - 28usize) + 29usize) & - (268435456u64 + (536870912u64 as u64)) } | - ((mHasUnsafeEvalCSP + ((mHasUnsafeInlineCSP as u8 as u64) << - 29usize) + 30usize) & - (536870912u64 + (1073741824u64 as u64)) } | - ((mHasUnsafeInlineCSP + ((mHasTrackingContentBlocked as u8 as u64) << - 30usize) + 31usize) & - (1073741824u64 + (2147483648u64 as u64)) } | - ((mHasTrackingContentBlocked + ((mHasTrackingContentLoaded as u8 as u64) << - 31usize) + 32usize) & - (2147483648u64 + (4294967296u64 as u64)) } | - ((mHasTrackingContentLoaded + ((mBFCacheDisallowed as u8 as u64) << - 32usize) + 33usize) & - (4294967296u64 + (8589934592u64 as u64)) } | - ((mBFCacheDisallowed + ((mHasHadDefaultView as u8 as u64) << - 33usize) + 34usize) & - (8589934592u64 + (17179869184u64 as u64)) } | - ((mHasHadDefaultView + ((mStyleSheetChangeEventsEnabled as u8 as u64) << - 34usize) + 35usize) & - (17179869184u64 + (34359738368u64 as u64)) } | - ((mStyleSheetChangeEventsEnabled + ((mIsSrcdocDocument as u8 as u64) << - 35usize) + 36usize) & - (34359738368u64 + (68719476736u64 as u64)) } | - ((mIsSrcdocDocument + ((mDidDocumentOpen as u8 as u64) << - 36usize) + 37usize) & - (68719476736u64 + (137438953472u64 as u64)) } | - ((mDidDocumentOpen + ((mHasDisplayDocument as u8 as u64) << - 37usize) + 38usize) & - (137438953472u64 + (274877906944u64 as u64)) } | - ((mHasDisplayDocument + ((mFontFaceSetDirty as u8 as u64) << - 38usize) + 39usize) & - (274877906944u64 + (549755813888u64 as u64)) } | - ((mFontFaceSetDirty + ((mGetUserFontSetCalled as u8 as u64) << - 39usize) + 40usize) & - (549755813888u64 + (1099511627776u64 as u64)) } | - ((mGetUserFontSetCalled + ((mPostedFlushUserFontSet as u8 as u64) << - 40usize) & - (1099511627776u64 + 41usize) & + (2199023255552u64 as u64)) } | - ((mPostedFlushUserFontSet + ((mDidFireDOMContentLoaded as u8 as u64) - << 41usize) & - (2199023255552u64 + << 42usize) & + (4398046511104u64 as u64)) } | - ((mDidFireDOMContentLoaded + ((mHasScrollLinkedEffect as u8 as u64) << - 42usize) & - (4398046511104u64 as + 43usize) & + (8796093022208u64 as u64)) } | - ((mHasScrollLinkedEffect as u8 - as u64) << 43usize) & - (8796093022208u64 as u64)) + ((mFrameRequestCallbacksScheduled + as u8 as u64) << 44usize) + & + (17592186044416u64 as u64)) } | - ((mFrameRequestCallbacksScheduled as - u8 as u64) << 44usize) & - (17592186044416u64 as u64)) + ((mIsTopLevelContentDocument as u8 + as u64) << 45usize) & + (35184372088832u64 as u64)) } | - ((mIsTopLevelContentDocument as u8 as - u64) << 45usize) & - (35184372088832u64 as u64)) + ((mIsContentDocument as u8 as u64) << + 46usize) & + (70368744177664u64 as u64)) } | - ((mIsContentDocument as u8 as u64) << 46usize) - & (70368744177664u64 as u64)) + ((mMightHaveStaleServoData as u8 as u64) << + 47usize) & (140737488355328u64 as u64)) } | - ((mMightHaveStaleServoData as u8 as u64) << - 47usize) & (140737488355328u64 as u64)) + ((mDidCallBeginLoad as u8 as u64) << 48usize) & + (281474976710656u64 as u64)) } | - ((mDidCallBeginLoad as u8 as u64) << 48usize) & - (281474976710656u64 as u64)) + ((mBufferingCSPViolations as u8 as u64) << 49usize) & + (562949953421312u64 as u64)) } | - ((mIsScopedStyleEnabled as u32 as u64) << 49usize) & - (1688849860263936u64 as u64)) + ((mIsScopedStyleEnabled as u32 as u64) << 50usize) & + (3377699720527872u64 as u64)) } } #[repr(C)] @@ -24618,57 +24716,57 @@ pub mod root { pub struct nsRange { _unused: [u8; 0], } - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_EDITABLE; - pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_NATIVE_ANONYMOUS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_72 = - _bindgen_ty_72::NODE_TYPE_SPECIFIC_BITS_OFFSET; + pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_LISTENERMANAGER; + pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_PROPERTIES; + pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_ANONYMOUS_ROOT; + pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; + pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_NATIVE_ANONYMOUS_ROOT; + pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_FORCE_XBL_BINDINGS; + pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_MAY_BE_IN_BINDING_MNGR; + pub const NODE_IS_EDITABLE: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_EDITABLE; + pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_NATIVE_ANONYMOUS; + pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_IN_SHADOW_TREE; + pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_EMPTY_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_SLOW_SELECTOR; + pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_EDGE_CHILD_SELECTOR; + pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; + pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_ALL_SELECTOR_FLAGS; + pub const NODE_NEEDS_FRAME: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_NEEDS_FRAME; + pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_DESCENDANTS_NEED_FRAMES; + pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_ACCESSKEY; + pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_DIRECTION_RTL; + pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_HAS_DIRECTION_LTR; + pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_ALL_DIRECTION_FLAGS; + pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_CHROME_ONLY_ACCESS; + pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; + pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_84 = + _bindgen_ty_84::NODE_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_72 { + pub enum _bindgen_ty_84 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, @@ -32150,46 +32248,46 @@ pub mod root { assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsISMILAttr ) )); } - pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_1; pub const ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO: - root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_74 + root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_3; + pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_1; + pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_2; + pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_86 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_3; + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_3; pub const ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT: - root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; - pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_PENDING_RESTYLE_FLAGS; - pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; - pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_ALL_RESTYLE_FLAGS; - pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_74 = - _bindgen_ty_74::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; + root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_SHARED_RESTYLE_BIT_4; + pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; + pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_PENDING_RESTYLE_FLAGS; + pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; + pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_ALL_RESTYLE_FLAGS; + pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_86 = + _bindgen_ty_86::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_74 { + pub enum _bindgen_ty_86 { ELEMENT_SHARED_RESTYLE_BIT_1 = 8388608, ELEMENT_SHARED_RESTYLE_BIT_2 = 16777216, ELEMENT_SHARED_RESTYLE_BIT_3 = 33554432, @@ -33065,7 +33163,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_198181_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_224480_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33421,7 +33519,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_199964_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_226263_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33582,7 +33680,7 @@ pub mod root { root::JS::DeletePolicy ) )); } #[test] - fn __bindgen_test_layout_iterator_open0_input_iterator_tag_UniquePtr_open1_JSErrorNotes_Note_DeletePolicy_open2_JSErrorNotes_Note_close2_close1_long__bindgen_ty_id_205555__bindgen_ty_id_205562_close0_instantiation() { + fn __bindgen_test_layout_iterator_open0_input_iterator_tag_UniquePtr_open1_JSErrorNotes_Note_DeletePolicy_open2_JSErrorNotes_Note_close2_close1_long__bindgen_ty_id_231846__bindgen_ty_id_231853_close0_instantiation() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33747,6 +33845,28 @@ pub mod root { root::nsCOMPtr ) )); } #[test] + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_AnonymousContent_close1_close0_instantiation() { assert_eq!(::std::mem::size_of::>>() , 8usize , concat ! ( @@ -33808,7 +33928,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_208038_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_234329_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33876,7 +33996,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_208340_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_234631_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33988,7 +34108,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_NotNull_open0__bindgen_ty_id_208882_close0_instantiation() { + fn __bindgen_test_layout_NotNull_open0__bindgen_ty_id_235173_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34311,6 +34431,28 @@ pub mod root { root::RefPtr ) )); } #[test] + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsTArray ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsTArray ) )); + } + #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_1() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] fn __bindgen_test_layout_RefPtr_open0_CSSRuleListImpl_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( @@ -34368,7 +34510,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_209295_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_235592_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34458,7 +34600,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_209692_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_235989_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34559,7 +34701,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_210646_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_236944_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34648,7 +34790,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_210949_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_237247_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34659,7 +34801,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_210954_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_237252_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34716,7 +34858,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_211429_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_237727_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35351,7 +35493,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_214260_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240548_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35430,7 +35572,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_220505_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_246801_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35463,7 +35605,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_221666_close0_instantiation() { + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_247962_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35474,7 +35616,7 @@ pub mod root { root::JS::Heap<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_221670_close0_instantiation() { + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_247966_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35496,7 +35638,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_TenuredHeap_open0__bindgen_ty_id_221677_close0_instantiation() { + fn __bindgen_test_layout_TenuredHeap_open0__bindgen_ty_id_247973_close0_instantiation() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35529,7 +35671,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_2() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35540,7 +35682,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_2() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35551,7 +35693,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_1() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_3() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35575,7 +35717,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_222850_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_249043_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35770,7 +35912,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_224298_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_250491_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35875,7 +36017,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_226686_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_252879_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35886,7 +36028,7 @@ pub mod root { root::nsTArray<*mut root::mozilla::CounterStyle> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_1() { + fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_3() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35897,7 +36039,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_2() { + fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_4() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36576,7 +36718,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_229163_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_255356_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36813,7 +36955,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_236971_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_263164_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36824,7 +36966,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_236976_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_263169_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36912,7 +37054,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_237089_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_263282_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37199,7 +37341,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_238669_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_264862_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37221,7 +37363,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_238827_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_265020_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37232,7 +37374,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_238832_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_265025_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37364,7 +37506,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240906_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_267099_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37375,7 +37517,7 @@ pub mod root { root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240912_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_267105_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! (