mirror of
https://github.com/servo/servo.git
synced 2025-06-23 00:24:35 +01:00
Auto merge of #18060 - heycam:single-origin, r=emilio
style: Don't rebuild cascade origins that haven't changed. From https://bugzilla.mozilla.org/show_bug.cgi?id=1382925. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18060) <!-- Reviewable:end -->
This commit is contained in:
commit
b1d7b6bfcf
13 changed files with 1364 additions and 899 deletions
|
@ -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,
|
||||
|
|
|
@ -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::{Origin, PerOrigin, StylesheetContents, StylesheetInDocument};
|
||||
use stylist::{ExtraStyleData, Stylist};
|
||||
|
||||
/// Little wrapper to a Gecko style sheet.
|
||||
|
@ -118,7 +118,7 @@ pub struct PerDocumentStyleDataImpl {
|
|||
pub stylesheets: StylesheetSet<GeckoStyleSheet>,
|
||||
|
||||
/// List of effective @font-face and @counter-style rules.
|
||||
pub extra_style_data: ExtraStyleData,
|
||||
pub extra_style_data: PerOrigin<ExtraStyleData>,
|
||||
}
|
||||
|
||||
/// The data itself is an `AtomicRefCell`, which guarantees the proper semantics
|
||||
|
@ -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,
|
||||
|
@ -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() }
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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<root::mozilla::OriginFlags> 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<root::mozilla::OriginFlags> 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::<root::mozilla::DefaultDelete>() ,
|
||||
|
@ -16919,6 +16962,7 @@ pub mod root {
|
|||
pub mPageUnloadingEventTimeStamp: root::mozilla::TimeStamp,
|
||||
pub mDocGroup: root::RefPtr<root::mozilla::dom::DocGroup>,
|
||||
pub mTrackingScripts: [u64; 6usize],
|
||||
pub mBufferedCSPViolations: root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>,
|
||||
}
|
||||
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::<nsIDocument>() , 880usize , concat !
|
||||
assert_eq!(::std::mem::size_of::<nsIDocument>() , 888usize , concat !
|
||||
( "Size of: " , stringify ! ( nsIDocument ) ));
|
||||
assert_eq! (::std::mem::align_of::<nsIDocument>() , 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::<u64>())
|
||||
};
|
||||
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::<u64>())
|
||||
};
|
||||
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::<u64>())
|
||||
};
|
||||
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::<u64>());
|
||||
}
|
||||
}
|
||||
#[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,6 +19300,7 @@ pub mod root {
|
|||
({
|
||||
({
|
||||
({
|
||||
({
|
||||
0
|
||||
}
|
||||
|
|
||||
|
@ -19699,7 +19783,8 @@ pub mod root {
|
|||
(68719476736u64
|
||||
as
|
||||
u64))
|
||||
} |
|
||||
}
|
||||
|
|
||||
((mDidDocumentOpen
|
||||
as
|
||||
u8
|
||||
|
@ -19725,7 +19810,8 @@ pub mod root {
|
|||
u64))
|
||||
} |
|
||||
((mFontFaceSetDirty
|
||||
as u8
|
||||
as
|
||||
u8
|
||||
as
|
||||
u64)
|
||||
<<
|
||||
|
@ -19736,39 +19822,48 @@ pub mod root {
|
|||
u64))
|
||||
} |
|
||||
((mGetUserFontSetCalled
|
||||
as u8 as
|
||||
u64) <<
|
||||
40usize) &
|
||||
as u8
|
||||
as
|
||||
u64)
|
||||
<<
|
||||
40usize)
|
||||
&
|
||||
(1099511627776u64
|
||||
as
|
||||
u64))
|
||||
} |
|
||||
((mPostedFlushUserFontSet
|
||||
as u8 as u64)
|
||||
<< 41usize) &
|
||||
as u8 as
|
||||
u64) <<
|
||||
41usize) &
|
||||
(2199023255552u64
|
||||
as u64))
|
||||
} |
|
||||
((mDidFireDOMContentLoaded
|
||||
as u8 as u64) <<
|
||||
42usize) &
|
||||
(4398046511104u64 as
|
||||
as
|
||||
u64))
|
||||
} |
|
||||
((mHasScrollLinkedEffect as u8
|
||||
as u64) << 43usize) &
|
||||
(8796093022208u64 as u64))
|
||||
((mDidFireDOMContentLoaded
|
||||
as u8 as u64)
|
||||
<< 42usize) &
|
||||
(4398046511104u64
|
||||
as u64))
|
||||
} |
|
||||
((mFrameRequestCallbacksScheduled as
|
||||
u8 as u64) << 44usize) &
|
||||
((mHasScrollLinkedEffect
|
||||
as u8 as u64) <<
|
||||
43usize) &
|
||||
(8796093022208u64 as
|
||||
u64))
|
||||
} |
|
||||
((mFrameRequestCallbacksScheduled
|
||||
as u8 as u64) << 44usize)
|
||||
&
|
||||
(17592186044416u64 as u64))
|
||||
} |
|
||||
((mIsTopLevelContentDocument as u8 as
|
||||
u64) << 45usize) &
|
||||
((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))
|
||||
|
@ -19776,8 +19871,11 @@ pub mod root {
|
|||
((mDidCallBeginLoad as u8 as u64) << 48usize) &
|
||||
(281474976710656u64 as u64))
|
||||
} |
|
||||
((mIsScopedStyleEnabled as u32 as u64) << 49usize) &
|
||||
(1688849860263936u64 as u64))
|
||||
((mBufferingCSPViolations as u8 as u64) << 49usize) &
|
||||
(562949953421312u64 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::<nsISMILAttr>() , 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<root::mozilla::gfx::FontVariation> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::nsCSSSelector>>()
|
||||
, 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::<root::nsTArray<*mut root::mozilla::StyleSheet>>()
|
||||
, 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::<root::std::iterator>() , 1usize ,
|
||||
concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -34239,6 +34337,28 @@ pub mod root {
|
|||
root::nsCOMPtr<root::nsIDocument> ) ));
|
||||
}
|
||||
#[test]
|
||||
fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation() {
|
||||
assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
root::nsTArray<root::nsCOMPtr<root::nsIRunnable>> ) ));
|
||||
assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>>()
|
||||
, 8usize , concat ! (
|
||||
"Alignment of template specialization: " , stringify ! (
|
||||
root::nsTArray<root::nsCOMPtr<root::nsIRunnable>> ) ));
|
||||
}
|
||||
#[test]
|
||||
fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation() {
|
||||
assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIRunnable>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
root::nsCOMPtr<root::nsIRunnable> ) ));
|
||||
assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIRunnable>>()
|
||||
, 8usize , concat ! (
|
||||
"Alignment of template specialization: " , stringify ! (
|
||||
root::nsCOMPtr<root::nsIRunnable> ) ));
|
||||
}
|
||||
#[test]
|
||||
fn __bindgen_test_layout_nsTArray_open0_RefPtr_open1_AnonymousContent_close1_close0_instantiation() {
|
||||
assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>>()
|
||||
, 8usize , concat ! (
|
||||
|
@ -34300,7 +34420,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::StyleSheet> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::dom::Element>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -34368,7 +34488,7 @@ pub mod root {
|
|||
root::nsCOMPtr<root::nsIObserver> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::dom::Element>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -34480,7 +34600,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::URLExtraData> ) ));
|
||||
}
|
||||
#[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::<root::mozilla::NotNull<*const root::mozilla::Encoding>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -34805,6 +34925,28 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::dom::DocGroup> ) ));
|
||||
}
|
||||
#[test]
|
||||
fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_1() {
|
||||
assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
root::nsTArray<root::nsCOMPtr<root::nsIRunnable>> ) ));
|
||||
assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>>()
|
||||
, 8usize , concat ! (
|
||||
"Alignment of template specialization: " , stringify ! (
|
||||
root::nsTArray<root::nsCOMPtr<root::nsIRunnable>> ) ));
|
||||
}
|
||||
#[test]
|
||||
fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_1() {
|
||||
assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIRunnable>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
root::nsCOMPtr<root::nsIRunnable> ) ));
|
||||
assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::nsIRunnable>>()
|
||||
, 8usize , concat ! (
|
||||
"Alignment of template specialization: " , stringify ! (
|
||||
root::nsCOMPtr<root::nsIRunnable> ) ));
|
||||
}
|
||||
#[test]
|
||||
fn __bindgen_test_layout_RefPtr_open0_CSSRuleListImpl_close0_instantiation() {
|
||||
assert_eq!(::std::mem::size_of::<root::RefPtr<root::CSSRuleListImpl>>()
|
||||
, 8usize , concat ! (
|
||||
|
@ -34862,7 +35004,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::StyleSheet> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::StyleSheet>>()
|
||||
, 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::<root::nsTArray<*mut root::mozilla::StyleSheet>>()
|
||||
, 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::<root::nsTArray<*mut root::mozilla::StyleSheet>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -35142,7 +35284,7 @@ pub mod root {
|
|||
root::RefPtr<root::nsCSSFontFaceRule> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -35210,7 +35352,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::CSSStyleSheet> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::StyleSheet>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -35858,7 +36000,7 @@ pub mod root {
|
|||
root::nsCOMPtr<root::nsIWeakReference> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut ::std::os::raw::c_void>>()
|
||||
, 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::<root::nsTArray<*mut root::mozilla::dom::AudioContext>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -35970,7 +36112,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::dom::CallbackObject> ) ));
|
||||
}
|
||||
#[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::<root::JS::Heap<*mut root::JSObject>>()
|
||||
, 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::<root::JS::Heap<*mut root::JSObject>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -36003,7 +36145,7 @@ pub mod root {
|
|||
root::nsCOMPtr<root::nsIGlobalObject> ) ));
|
||||
}
|
||||
#[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::<root::JS::TenuredHeap>() , 8usize ,
|
||||
concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -36036,7 +36178,7 @@ pub mod root {
|
|||
root::nsCOMPtr<root::nsISupports> ) ));
|
||||
}
|
||||
#[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::<root::nsCOMPtr<root::nsIRunnable>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -36047,7 +36189,7 @@ pub mod root {
|
|||
root::nsCOMPtr<root::nsIRunnable> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -36058,7 +36200,7 @@ pub mod root {
|
|||
root::nsTArray<root::nsCOMPtr<root::nsIRunnable>> ) ));
|
||||
}
|
||||
#[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::<root::nsCOMPtr<root::nsIRunnable>>()
|
||||
, 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::<root::nsTArray<*mut root::nsISupports>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -36277,7 +36419,7 @@ pub mod root {
|
|||
root::nsTArray<f64> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::dom::Element>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -36382,7 +36524,7 @@ pub mod root {
|
|||
root::nsRefPtrHashKey<root::nsIAtom> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::CounterStyle>>()
|
||||
, 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::<root::nsTArray<root::nsCOMPtr<root::nsIRunnable>>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -36404,7 +36546,7 @@ pub mod root {
|
|||
root::nsTArray<root::nsCOMPtr<root::nsIRunnable>> ) ));
|
||||
}
|
||||
#[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::<root::nsCOMPtr<root::nsIRunnable>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -37083,7 +37225,7 @@ pub mod root {
|
|||
root::RefPtr<root::nsStyleImageRequest> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::nsISupports>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -37320,7 +37462,7 @@ pub mod root {
|
|||
root::nsCOMPtr<root::nsIURI> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -37419,7 +37561,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::dom::ShadowRoot> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -37728,7 +37870,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::dom::Element> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -37871,7 +38013,7 @@ pub mod root {
|
|||
root::nsTArray<root::mozilla::gfx::FontVariation> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>()
|
||||
, 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::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
|
|
@ -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<root::mozilla::OriginFlags> 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<root::mozilla::OriginFlags> 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::<root::mozilla::DefaultDelete>() ,
|
||||
|
@ -16685,6 +16728,7 @@ pub mod root {
|
|||
pub mPageUnloadingEventTimeStamp: root::mozilla::TimeStamp,
|
||||
pub mDocGroup: root::RefPtr<root::mozilla::dom::DocGroup>,
|
||||
pub mTrackingScripts: [u64; 5usize],
|
||||
pub mBufferedCSPViolations: root::nsTArray<root::nsCOMPtr>,
|
||||
}
|
||||
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::<nsIDocument>() , 856usize , concat !
|
||||
assert_eq!(::std::mem::size_of::<nsIDocument>() , 864usize , concat !
|
||||
( "Size of: " , stringify ! ( nsIDocument ) ));
|
||||
assert_eq! (::std::mem::align_of::<nsIDocument>() , 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::<u64>())
|
||||
};
|
||||
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::<u64>())
|
||||
};
|
||||
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::<u64>())
|
||||
};
|
||||
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::<u64>());
|
||||
}
|
||||
}
|
||||
#[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,6 +19066,7 @@ pub mod root {
|
|||
({
|
||||
({
|
||||
({
|
||||
({
|
||||
0
|
||||
}
|
||||
|
|
||||
|
@ -19465,7 +19549,8 @@ pub mod root {
|
|||
(68719476736u64
|
||||
as
|
||||
u64))
|
||||
} |
|
||||
}
|
||||
|
|
||||
((mDidDocumentOpen
|
||||
as
|
||||
u8
|
||||
|
@ -19491,7 +19576,8 @@ pub mod root {
|
|||
u64))
|
||||
} |
|
||||
((mFontFaceSetDirty
|
||||
as u8
|
||||
as
|
||||
u8
|
||||
as
|
||||
u64)
|
||||
<<
|
||||
|
@ -19502,39 +19588,48 @@ pub mod root {
|
|||
u64))
|
||||
} |
|
||||
((mGetUserFontSetCalled
|
||||
as u8 as
|
||||
u64) <<
|
||||
40usize) &
|
||||
as u8
|
||||
as
|
||||
u64)
|
||||
<<
|
||||
40usize)
|
||||
&
|
||||
(1099511627776u64
|
||||
as
|
||||
u64))
|
||||
} |
|
||||
((mPostedFlushUserFontSet
|
||||
as u8 as u64)
|
||||
<< 41usize) &
|
||||
as u8 as
|
||||
u64) <<
|
||||
41usize) &
|
||||
(2199023255552u64
|
||||
as u64))
|
||||
} |
|
||||
((mDidFireDOMContentLoaded
|
||||
as u8 as u64) <<
|
||||
42usize) &
|
||||
(4398046511104u64 as
|
||||
as
|
||||
u64))
|
||||
} |
|
||||
((mHasScrollLinkedEffect as u8
|
||||
as u64) << 43usize) &
|
||||
(8796093022208u64 as u64))
|
||||
((mDidFireDOMContentLoaded
|
||||
as u8 as u64)
|
||||
<< 42usize) &
|
||||
(4398046511104u64
|
||||
as u64))
|
||||
} |
|
||||
((mFrameRequestCallbacksScheduled as
|
||||
u8 as u64) << 44usize) &
|
||||
((mHasScrollLinkedEffect
|
||||
as u8 as u64) <<
|
||||
43usize) &
|
||||
(8796093022208u64 as
|
||||
u64))
|
||||
} |
|
||||
((mFrameRequestCallbacksScheduled
|
||||
as u8 as u64) << 44usize)
|
||||
&
|
||||
(17592186044416u64 as u64))
|
||||
} |
|
||||
((mIsTopLevelContentDocument as u8 as
|
||||
u64) << 45usize) &
|
||||
((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))
|
||||
|
@ -19542,8 +19637,11 @@ pub mod root {
|
|||
((mDidCallBeginLoad as u8 as u64) << 48usize) &
|
||||
(281474976710656u64 as u64))
|
||||
} |
|
||||
((mIsScopedStyleEnabled as u32 as u64) << 49usize) &
|
||||
(1688849860263936u64 as u64))
|
||||
((mBufferingCSPViolations as u8 as u64) << 49usize) &
|
||||
(562949953421312u64 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::<nsISMILAttr>() , 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<root::mozilla::gfx::FontVariation> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::nsCSSSelector>>()
|
||||
, 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::<root::nsTArray<*mut root::mozilla::StyleSheet>>()
|
||||
, 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::<root::std::iterator>() , 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::<root::nsTArray<root::nsCOMPtr>>() ,
|
||||
8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
root::nsTArray<root::nsCOMPtr> ) ));
|
||||
assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() ,
|
||||
8usize , concat ! (
|
||||
"Alignment of template specialization: " , stringify ! (
|
||||
root::nsTArray<root::nsCOMPtr> ) ));
|
||||
}
|
||||
#[test]
|
||||
fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation() {
|
||||
assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat !
|
||||
(
|
||||
"Size of template specialization: " , stringify ! (
|
||||
root::nsCOMPtr ) ));
|
||||
assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 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::<root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>>()
|
||||
, 8usize , concat ! (
|
||||
|
@ -33808,7 +33928,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::StyleSheet> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::dom::Element>>()
|
||||
, 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::<root::nsTArray<*mut root::mozilla::dom::Element>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -33988,7 +34108,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::URLExtraData> ) ));
|
||||
}
|
||||
#[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::<root::mozilla::NotNull<*const root::mozilla::Encoding>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -34311,6 +34431,28 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::dom::DocGroup> ) ));
|
||||
}
|
||||
#[test]
|
||||
fn __bindgen_test_layout_nsTArray_open0_nsCOMPtr_open1_nsIRunnable_close1_close0_instantiation_1() {
|
||||
assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr>>() ,
|
||||
8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
root::nsTArray<root::nsCOMPtr> ) ));
|
||||
assert_eq!(::std::mem::align_of::<root::nsTArray<root::nsCOMPtr>>() ,
|
||||
8usize , concat ! (
|
||||
"Alignment of template specialization: " , stringify ! (
|
||||
root::nsTArray<root::nsCOMPtr> ) ));
|
||||
}
|
||||
#[test]
|
||||
fn __bindgen_test_layout_nsCOMPtr_open0_nsIRunnable_close0_instantiation_1() {
|
||||
assert_eq!(::std::mem::size_of::<root::nsCOMPtr>() , 8usize , concat !
|
||||
(
|
||||
"Size of template specialization: " , stringify ! (
|
||||
root::nsCOMPtr ) ));
|
||||
assert_eq!(::std::mem::align_of::<root::nsCOMPtr>() , 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::<root::RefPtr<root::CSSRuleListImpl>>()
|
||||
, 8usize , concat ! (
|
||||
|
@ -34368,7 +34510,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::StyleSheet> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::StyleSheet>>()
|
||||
, 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::<root::nsTArray<*mut root::mozilla::StyleSheet>>()
|
||||
, 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::<root::nsTArray<*mut root::mozilla::StyleSheet>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -34648,7 +34790,7 @@ pub mod root {
|
|||
root::RefPtr<root::nsCSSFontFaceRule> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -34716,7 +34858,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::CSSStyleSheet> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::StyleSheet>>()
|
||||
, 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::<root::nsTArray<*mut ::std::os::raw::c_void>>()
|
||||
, 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::<root::nsTArray<*mut root::mozilla::dom::AudioContext>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -35463,7 +35605,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::dom::CallbackObject> ) ));
|
||||
}
|
||||
#[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::<root::JS::Heap<*mut root::JSObject>>()
|
||||
, 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::<root::JS::Heap<*mut root::JSObject>>()
|
||||
, 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::<root::JS::TenuredHeap>() , 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::<root::nsCOMPtr>() , 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::<root::nsTArray<root::nsCOMPtr>>() ,
|
||||
8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -35551,7 +35693,7 @@ pub mod root {
|
|||
root::nsTArray<root::nsCOMPtr> ) ));
|
||||
}
|
||||
#[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::<root::nsCOMPtr>() , 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::<root::nsTArray<*mut root::nsISupports>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -35770,7 +35912,7 @@ pub mod root {
|
|||
root::nsTArray<f64> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::dom::Element>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -35875,7 +36017,7 @@ pub mod root {
|
|||
root::nsRefPtrHashKey<root::nsIAtom> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::CounterStyle>>()
|
||||
, 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::<root::nsTArray<root::nsCOMPtr>>() ,
|
||||
8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -35897,7 +36039,7 @@ pub mod root {
|
|||
root::nsTArray<root::nsCOMPtr> ) ));
|
||||
}
|
||||
#[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::<root::nsCOMPtr>() , 8usize , concat !
|
||||
(
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -36576,7 +36718,7 @@ pub mod root {
|
|||
root::RefPtr<root::nsStyleImageRequest> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::nsISupports>>()
|
||||
, 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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -36912,7 +37054,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::dom::ShadowRoot> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -37221,7 +37363,7 @@ pub mod root {
|
|||
root::RefPtr<root::mozilla::dom::Element> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 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::<root::nsTArray<*mut root::nsIContent>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
@ -37364,7 +37506,7 @@ pub mod root {
|
|||
root::nsTArray<root::mozilla::gfx::FontVariation> ) ));
|
||||
}
|
||||
#[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::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>()
|
||||
, 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::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>()
|
||||
, 8usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! (
|
||||
|
|
|
@ -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;
|
||||
|
|
50
components/style/gecko_bindings/sugar/origin_flags.rs
Normal file
50
components/style/gecko_bindings/sugar/origin_flags.rs
Normal file
|
@ -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<Origin> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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.
|
||||
|
|
|
@ -8,7 +8,7 @@ use dom::TElement;
|
|||
use invalidation::stylesheets::StylesheetInvalidationSet;
|
||||
use shared_lock::SharedRwLockReadGuard;
|
||||
use std::slice;
|
||||
use stylesheets::StylesheetInDocument;
|
||||
use stylesheets::{Origin, 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<StylesheetSetEntry<S>>,
|
||||
|
||||
/// Whether the entries list above has changed since the last restyle.
|
||||
dirty: bool,
|
||||
/// Per-origin stylesheet invalidation data.
|
||||
invalidation_data: PerOrigin<InvalidationData>,
|
||||
|
||||
/// Has author style been disabled?
|
||||
author_style_disabled: bool,
|
||||
|
||||
/// The style invalidations that we still haven't processed.
|
||||
invalidations: StylesheetInvalidationSet,
|
||||
}
|
||||
|
||||
impl<S> StylesheetSet<S>
|
||||
|
@ -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,29 +153,35 @@ 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
|
||||
/// over the new stylesheet list.
|
||||
pub fn flush<E>(
|
||||
&mut self,
|
||||
document_element: Option<E>
|
||||
document_element: Option<E>,
|
||||
) -> StylesheetIterator<S>
|
||||
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() {
|
||||
if data.dirty {
|
||||
data.invalidations.flush(document_element);
|
||||
data.dirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
self.iter()
|
||||
}
|
||||
|
@ -202,7 +196,36 @@ 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.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 {
|
||||
/// 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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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, PerOrigin, PerOriginClear};
|
||||
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.
|
||||
|
|
146
components/style/stylesheets/origin.rs
Normal file
146
components/style/stylesheets/origin.rs
Normal file
|
@ -0,0 +1,146 @@
|
|||
/* 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).
|
||||
|
||||
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
|
||||
#[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-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.
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Debug, Default)]
|
||||
pub struct PerOrigin<T> {
|
||||
/// Data for `Origin::UserAgent`.
|
||||
pub user_agent: T,
|
||||
|
||||
/// Data for `Origin::User`.
|
||||
pub user: T,
|
||||
|
||||
/// Data for `Origin::Author`.
|
||||
pub author: T,
|
||||
}
|
||||
|
||||
impl<T> PerOrigin<T> {
|
||||
/// 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::User => &self.user,
|
||||
Origin::Author => &self.author,
|
||||
}
|
||||
}
|
||||
|
||||
/// 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::User => &mut self.user,
|
||||
Origin::Author => &mut self.author,
|
||||
}
|
||||
}
|
||||
|
||||
/// Iterates over references to per-origin extra style data, from highest
|
||||
/// level (author) to lowest (user agent).
|
||||
pub fn iter_origins(&self) -> PerOriginIter<T> {
|
||||
PerOriginIter {
|
||||
data: &self,
|
||||
cur: 0,
|
||||
}
|
||||
}
|
||||
|
||||
/// Iterates over mutable references to per-origin extra style data, from
|
||||
/// highest level (author) to lowest (user agent).
|
||||
pub fn iter_mut_origins(&mut self) -> PerOriginIterMut<T> {
|
||||
PerOriginIterMut {
|
||||
data: self,
|
||||
cur: 0,
|
||||
_marker: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// An object that can be cleared.
|
||||
pub trait PerOriginClear {
|
||||
/// Clears the object.
|
||||
fn clear(&mut self);
|
||||
}
|
||||
|
||||
impl<T> PerOriginClear for PerOrigin<T> where T: PerOriginClear {
|
||||
fn clear(&mut self) {
|
||||
self.user_agent.clear();
|
||||
self.user.clear();
|
||||
self.author.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/// Iterator over `PerOrigin<T>`, from highest level (author) 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<T>,
|
||||
cur: usize,
|
||||
}
|
||||
|
||||
impl<'a, T> Iterator for PerOriginIter<'a, T> where T: 'a {
|
||||
type Item = (&'a T, Origin);
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let result = match self.cur {
|
||||
0 => (&self.data.author, Origin::Author),
|
||||
1 => (&self.data.user, Origin::User),
|
||||
2 => (&self.data.user_agent, Origin::UserAgent),
|
||||
_ => return None,
|
||||
};
|
||||
self.cur += 1;
|
||||
Some(result)
|
||||
}
|
||||
}
|
||||
|
||||
/// Like `PerOriginIter<T>`, 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<T>,
|
||||
cur: usize,
|
||||
_marker: PhantomData<&'a mut PerOrigin<T>>,
|
||||
}
|
||||
|
||||
impl<'a, T> Iterator for PerOriginIterMut<'a, T> where T: 'a {
|
||||
type Item = (&'a mut T, Origin);
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let result = match self.cur {
|
||||
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,
|
||||
};
|
||||
self.cur += 1;
|
||||
Some(result)
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
@ -73,9 +74,6 @@ pub struct Stylist {
|
|||
/// Viewport constraints based on the current device.
|
||||
viewport_constraints: Option<ViewportConstraints>,
|
||||
|
||||
/// 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,
|
||||
|
@ -83,14 +81,10 @@ 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.
|
||||
cascade_data: CascadeData,
|
||||
cascade_data: PerOrigin<CascadeData>,
|
||||
|
||||
/// The rule tree, that stores the results of selector matching.
|
||||
rule_tree: RuleTree,
|
||||
|
@ -102,98 +96,10 @@ pub struct Stylist {
|
|||
/// FIXME(emilio): Use the rule tree!
|
||||
precomputed_pseudo_element_decls: PerPseudoElementMap<Vec<ApplicableDeclarationBlock>>,
|
||||
|
||||
/// 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,
|
||||
}
|
||||
|
||||
/// 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<Arc<Locked<FontFaceRule>>>,
|
||||
/// A map of effective counter-style rules.
|
||||
pub counter_styles: PrecomputedHashMap<Atom, Arc<Locked<CounterStyleRule>>>,
|
||||
}
|
||||
|
||||
#[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<Locked<FontFaceRule>>) {
|
||||
self.font_faces.push(rule.clone());
|
||||
}
|
||||
|
||||
/// Add the given @counter-style rule.
|
||||
fn add_counter_style(&mut self, guard: &SharedRwLockReadGuard,
|
||||
rule: &Arc<Locked<CounterStyleRule>>) {
|
||||
let name = rule.read_with(guard).mName.raw::<nsIAtom>().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 {
|
||||
|
@ -225,13 +131,10 @@ impl Stylist {
|
|||
viewport_constraints: None,
|
||||
device: device,
|
||||
is_device_dirty: true,
|
||||
is_cleared: true,
|
||||
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(),
|
||||
num_rebuilds: 0,
|
||||
}
|
||||
|
@ -241,12 +144,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 +160,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 +177,8 @@ impl Stylist {
|
|||
pub fn each_invalidation_map<F>(&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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -286,32 +189,46 @@ 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.effective_media_query_results.clear();
|
||||
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();
|
||||
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.
|
||||
self.viewport_constraints = None;
|
||||
|
||||
// XXX(heycam) Why do this, if we are preserving the Device?
|
||||
self.is_device_dirty = true;
|
||||
}
|
||||
|
||||
/// rebuild the stylist for the given document stylesheets, and optionally
|
||||
/// 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
|
||||
.iter_origins()
|
||||
.any(|(d, _)| d.is_cleared)
|
||||
}
|
||||
|
||||
/// 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
|
||||
|
@ -324,15 +241,35 @@ impl Stylist {
|
|||
ua_stylesheets: Option<&UserAgentStylesheets>,
|
||||
stylesheets_changed: bool,
|
||||
author_style_disabled: bool,
|
||||
extra_data: &mut ExtraStyleData
|
||||
extra_data: &mut PerOrigin<ExtraStyleData>
|
||||
) -> bool
|
||||
where
|
||||
I: Iterator<Item = &'a S> + 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;
|
||||
// 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<bool> = 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) {
|
||||
return false;
|
||||
|
@ -340,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.
|
||||
//
|
||||
|
@ -362,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);
|
||||
}
|
||||
}
|
||||
|
||||
extra_data.clear();
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
@ -404,13 +361,13 @@ impl Stylist {
|
|||
ua_stylesheets: Option<&UserAgentStylesheets>,
|
||||
stylesheets_changed: bool,
|
||||
author_style_disabled: bool,
|
||||
extra_data: &mut ExtraStyleData
|
||||
extra_data: &mut PerOrigin<ExtraStyleData>
|
||||
) -> bool
|
||||
where
|
||||
I: Iterator<Item = &'a S> + 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.
|
||||
|
@ -426,7 +383,7 @@ impl Stylist {
|
|||
&mut self,
|
||||
stylesheet: &S,
|
||||
guard: &SharedRwLockReadGuard,
|
||||
_extra_data: &mut ExtraStyleData
|
||||
_extra_data: &mut PerOrigin<ExtraStyleData>
|
||||
)
|
||||
where
|
||||
S: StylesheetInDocument + ToMediaListKey + 'static,
|
||||
|
@ -436,13 +393,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) => {
|
||||
|
@ -467,7 +425,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()
|
||||
));
|
||||
|
@ -490,7 +448,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);
|
||||
|
@ -515,18 +473,22 @@ 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);
|
||||
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);
|
||||
|
@ -567,18 +529,18 @@ 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
|
||||
} 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())
|
||||
})
|
||||
|
@ -588,9 +550,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)
|
||||
|
@ -602,7 +564,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 +814,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 +836,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()
|
||||
}
|
||||
|
||||
|
@ -1031,8 +999,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 -> {}, {}",
|
||||
|
@ -1071,7 +1045,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);
|
||||
|
@ -1088,7 +1064,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);
|
||||
|
@ -1324,7 +1302,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 +1317,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 +1342,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 +1409,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<Arc<Locked<FontFaceRule>>>,
|
||||
|
||||
/// A map of effective counter-style rules.
|
||||
#[cfg(feature = "gecko")]
|
||||
pub counter_styles: PrecomputedHashMap<Atom, Arc<Locked<CounterStyleRule>>>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
impl ExtraStyleData {
|
||||
/// Add the given @font-face rule.
|
||||
fn add_font_face(&mut self, rule: &Arc<Locked<FontFaceRule>>) {
|
||||
self.font_faces.push(rule.clone());
|
||||
}
|
||||
|
||||
/// Add the given @counter-style rule.
|
||||
fn add_counter_style(&mut self, guard: &SharedRwLockReadGuard,
|
||||
rule: &Arc<Locked<CounterStyleRule>>) {
|
||||
let name = rule.read_with(guard).mName.raw::<nsIAtom>().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 +1615,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<Rule>,
|
||||
|
||||
|
@ -1751,14 +1667,26 @@ struct PerOriginCascadeData {
|
|||
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
|
||||
selectors_for_cache_revalidation: SelectorMap<RevalidationSelectorAndHashes>,
|
||||
|
||||
/// 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,
|
||||
|
||||
/// 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 PerOriginCascadeData {
|
||||
impl CascadeData {
|
||||
fn new() -> Self {
|
||||
Self {
|
||||
element_map: SelectorMap::new(),
|
||||
|
@ -1770,8 +1698,11 @@ impl PerOriginCascadeData {
|
|||
state_dependencies: ElementState::empty(),
|
||||
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,
|
||||
is_cleared: true,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1783,7 +1714,17 @@ 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) {
|
||||
if self.is_cleared {
|
||||
return;
|
||||
}
|
||||
|
||||
self.element_map = SelectorMap::new();
|
||||
self.pseudos_map = Default::default();
|
||||
self.animations = Default::default();
|
||||
|
@ -1793,12 +1734,17 @@ impl PerOriginCascadeData {
|
|||
self.state_dependencies = ElementState::empty();
|
||||
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;
|
||||
self.is_cleared = true;
|
||||
}
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,10 @@ 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::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;
|
||||
|
@ -114,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;
|
||||
|
@ -845,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]
|
||||
|
@ -894,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]
|
||||
|
@ -912,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]
|
||||
|
@ -930,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]
|
||||
|
@ -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]
|
||||
|
@ -1008,6 +1012,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<T, R, F>(raw: &<Locked<T> as HasFFI>::FFIType, func: F) -> R
|
||||
where Locked<T>: HasArcFFI, F: FnOnce(&T) -> R
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue