From 0534f7292543b222ed3a477c854f5afc92bb22c5 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 22 Aug 2017 18:08:03 -0700 Subject: [PATCH 1/2] Update bindings. --- components/style/gecko/generated/bindings.rs | 4 + .../style/gecko/generated/structs_debug.rs | 257 +++++++++--------- .../style/gecko/generated/structs_release.rs | 257 +++++++++--------- 3 files changed, 266 insertions(+), 252 deletions(-) diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index ac3902817b2..8bfbd705c24 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -1916,6 +1916,10 @@ extern "C" { index: usize) -> ServoStyleContextStrong; } +extern "C" { + pub fn Servo_Element_IsDisplayNone(element: RawGeckoElementBorrowed) + -> bool; +} extern "C" { pub fn Servo_StyleSheet_FromUTF8Bytes(loader: *mut Loader, gecko_stylesheet: diff --git a/components/style/gecko/generated/structs_debug.rs b/components/style/gecko/generated/structs_debug.rs index 828469bf8d7..af92202568e 100644 --- a/components/style/gecko/generated/structs_debug.rs +++ b/components/style/gecko/generated/structs_debug.rs @@ -1047,6 +1047,8 @@ 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 { @@ -2632,6 +2634,7 @@ pub mod root { impl Clone for Element_MappedAttributeEntry { fn clone(&self) -> Self { *self } } + pub const Element_kAllServoDescendantBits: u32 = 25296896; pub const Element_kFireMutationEvent: bool = true; pub const Element_kDontFireMutationEvent: bool = false; pub const Element_kNotifyDocumentObservers: bool = true; @@ -4929,7 +4932,7 @@ pub mod root { pub const ServoTraversalFlags_AggressivelyForgetful: root::mozilla::ServoTraversalFlags = 16; - pub const ServoTraversalFlags_ClearDirtyDescendants: + pub const ServoTraversalFlags_ClearDirtyBits: root::mozilla::ServoTraversalFlags = 32; pub const ServoTraversalFlags_ClearAnimationOnlyDirtyDescendants: @@ -9508,15 +9511,6 @@ pub mod root { "Alignment of field: " , stringify ! ( ServoMediaList ) , "::" , stringify ! ( mRawList ) )); } - pub mod dmd { - #[allow(unused_imports)] - use self::super::super::super::root; - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct JSONWriteFunc { - _unused: [u8; 0], - } /// A PostTraversalTask is a task to be performed immediately after a Servo /// traversal. There are just a few tasks we need to perform, so we use this /// class rather than Runnables, to avoid virtual calls and some allocations. @@ -10068,8 +10062,6 @@ pub mod root { NS_ERROR_SAVE_LINK_AS_TIMEOUT = 2153578528, NS_ERROR_PARSED_DATA_CACHED = 2153578529, NS_REFRESHURI_HEADER_FOUND = 6094850, - NS_ERROR_IMAGE_SRC_CHANGED = 2153644036, - NS_ERROR_IMAGE_BLOCKED = 2153644037, NS_ERROR_CONTENT_BLOCKED = 2153644038, NS_ERROR_CONTENT_BLOCKED_SHOW_ALT = 2153644039, NS_PROPTABLE_PROP_NOT_THERE = 2153644042, @@ -17064,6 +17056,8 @@ pub mod root { pub mDocGroup: root::RefPtr, pub mTrackingScripts: [u64; 6usize], pub mBufferedCSPViolations: root::nsTArray>, + pub mServoRestyleRoot: root::nsCOMPtr, + pub mServoRestyleRootDirtyBits: u32, } pub type nsIDocument_GlobalObject = root::mozilla::dom::GlobalObject; pub type nsIDocument_Encoding = root::mozilla::Encoding; @@ -17358,7 +17352,7 @@ pub mod root { pub const nsIDocument_kSegmentSize: usize = 128; #[test] fn bindgen_test_layout_nsIDocument() { - assert_eq!(::std::mem::size_of::() , 888usize , concat ! + assert_eq!(::std::mem::size_of::() , 904usize , concat ! ( "Size of: " , stringify ! ( nsIDocument ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsIDocument ) )); @@ -25213,57 +25207,57 @@ pub mod root { pub struct nsRange { _unused: [u8; 0], } - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_EDITABLE; - pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_NATIVE_ANONYMOUS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_TYPE_SPECIFIC_BITS_OFFSET; + 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; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_83 { + pub enum _bindgen_ty_72 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, @@ -32841,46 +32835,46 @@ pub mod root { assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsISMILAttr ) )); } - pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_1; + 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_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO: - root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_85 + 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 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_3; + _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_3; pub const ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT: - root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; - pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_PENDING_RESTYLE_FLAGS; - pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; - pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_ALL_RESTYLE_FLAGS; - pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; + 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; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_85 { + pub enum _bindgen_ty_74 { ELEMENT_SHARED_RESTYLE_BIT_1 = 8388608, ELEMENT_SHARED_RESTYLE_BIT_2 = 16777216, ELEMENT_SHARED_RESTYLE_BIT_3 = 33554432, @@ -33756,7 +33750,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_228788_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_203496_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34112,7 +34106,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_230622_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_205330_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34273,7 +34267,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_236242__bindgen_ty_id_236249_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_210954__bindgen_ty_id_210961_close0_instantiation() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34521,7 +34515,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_238741_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213453_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34589,7 +34583,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_239043_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213755_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34701,7 +34695,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_NotNull_open0__bindgen_ty_id_239588_close0_instantiation() { + fn __bindgen_test_layout_NotNull_open0__bindgen_ty_id_214304_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35048,6 +35042,17 @@ pub mod root { root::nsCOMPtr ) )); } #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsINode_close0_instantiation() { + assert_eq!(::std::mem::size_of::>() , + 8usize , concat ! ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::>() , + 8usize , concat ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] fn __bindgen_test_layout_RefPtr_open0_CSSRuleListImpl_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( @@ -35105,7 +35110,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240009_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_214728_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35195,7 +35200,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240409_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_215128_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35296,7 +35301,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_241380_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_216101_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35385,7 +35390,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_241685_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_216406_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35396,7 +35401,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_241690_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_216411_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35453,7 +35458,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_242181_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_216902_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36101,7 +36106,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_245037_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_219758_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36180,7 +36185,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_251322_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_226043_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36213,7 +36218,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_252491_close0_instantiation() { + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_227212_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36224,7 +36229,7 @@ pub mod root { root::JS::Heap<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_252495_close0_instantiation() { + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_227216_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36246,7 +36251,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_TenuredHeap_open0__bindgen_ty_id_252502_close0_instantiation() { + fn __bindgen_test_layout_TenuredHeap_open0__bindgen_ty_id_227223_close0_instantiation() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36325,7 +36330,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_253607_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_228396_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36520,7 +36525,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_255055_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_229844_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36625,7 +36630,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_257463_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_232252_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37326,7 +37331,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_260021_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_234810_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37563,7 +37568,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_267833_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_242622_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37574,7 +37579,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_267838_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_242627_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37662,7 +37667,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_267951_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_242740_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37949,7 +37954,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_269537_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_244326_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37971,7 +37976,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_269699_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_244488_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37982,7 +37987,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_269704_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_244493_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -38114,7 +38119,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_272231_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_246732_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -38125,7 +38130,7 @@ pub mod root { root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_272239_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_246740_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( diff --git a/components/style/gecko/generated/structs_release.rs b/components/style/gecko/generated/structs_release.rs index 20db0475bc0..3eca68919f1 100644 --- a/components/style/gecko/generated/structs_release.rs +++ b/components/style/gecko/generated/structs_release.rs @@ -1047,6 +1047,8 @@ 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 { @@ -2554,6 +2556,7 @@ pub mod root { impl Clone for Element_MappedAttributeEntry { fn clone(&self) -> Self { *self } } + pub const Element_kAllServoDescendantBits: u32 = 25296896; pub const Element_kFireMutationEvent: bool = true; pub const Element_kDontFireMutationEvent: bool = false; pub const Element_kNotifyDocumentObservers: bool = true; @@ -4817,7 +4820,7 @@ pub mod root { pub const ServoTraversalFlags_AggressivelyForgetful: root::mozilla::ServoTraversalFlags = 16; - pub const ServoTraversalFlags_ClearDirtyDescendants: + pub const ServoTraversalFlags_ClearDirtyBits: root::mozilla::ServoTraversalFlags = 32; pub const ServoTraversalFlags_ClearAnimationOnlyDirtyDescendants: @@ -9354,15 +9357,6 @@ pub mod root { "Alignment of field: " , stringify ! ( ServoMediaList ) , "::" , stringify ! ( mRawList ) )); } - pub mod dmd { - #[allow(unused_imports)] - use self::super::super::super::root; - } - #[repr(C)] - #[derive(Debug, Copy, Clone)] - pub struct JSONWriteFunc { - _unused: [u8; 0], - } /// A PostTraversalTask is a task to be performed immediately after a Servo /// traversal. There are just a few tasks we need to perform, so we use this /// class rather than Runnables, to avoid virtual calls and some allocations. @@ -9914,8 +9908,6 @@ pub mod root { NS_ERROR_SAVE_LINK_AS_TIMEOUT = 2153578528, NS_ERROR_PARSED_DATA_CACHED = 2153578529, NS_REFRESHURI_HEADER_FOUND = 6094850, - NS_ERROR_IMAGE_SRC_CHANGED = 2153644036, - NS_ERROR_IMAGE_BLOCKED = 2153644037, NS_ERROR_CONTENT_BLOCKED = 2153644038, NS_ERROR_CONTENT_BLOCKED_SHOW_ALT = 2153644039, NS_PROPTABLE_PROP_NOT_THERE = 2153644042, @@ -16830,6 +16822,8 @@ pub mod root { pub mDocGroup: root::RefPtr, pub mTrackingScripts: [u64; 5usize], pub mBufferedCSPViolations: root::nsTArray, + pub mServoRestyleRoot: root::nsCOMPtr, + pub mServoRestyleRootDirtyBits: u32, } pub type nsIDocument_GlobalObject = root::mozilla::dom::GlobalObject; pub type nsIDocument_Encoding = root::mozilla::Encoding; @@ -17124,7 +17118,7 @@ pub mod root { pub const nsIDocument_kSegmentSize: usize = 128; #[test] fn bindgen_test_layout_nsIDocument() { - assert_eq!(::std::mem::size_of::() , 864usize , concat ! + assert_eq!(::std::mem::size_of::() , 880usize , concat ! ( "Size of: " , stringify ! ( nsIDocument ) )); assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsIDocument ) )); @@ -24817,57 +24811,57 @@ pub mod root { pub struct nsRange { _unused: [u8; 0], } - pub const NODE_HAS_LISTENERMANAGER: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_LISTENERMANAGER; - pub const NODE_HAS_PROPERTIES: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_PROPERTIES; - pub const NODE_IS_ANONYMOUS_ROOT: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_ANONYMOUS_ROOT; - pub const NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE; - pub const NODE_IS_NATIVE_ANONYMOUS_ROOT: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_NATIVE_ANONYMOUS_ROOT; - pub const NODE_FORCE_XBL_BINDINGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_FORCE_XBL_BINDINGS; - pub const NODE_MAY_BE_IN_BINDING_MNGR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_MAY_BE_IN_BINDING_MNGR; - pub const NODE_IS_EDITABLE: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_EDITABLE; - pub const NODE_IS_NATIVE_ANONYMOUS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_NATIVE_ANONYMOUS; - pub const NODE_IS_IN_SHADOW_TREE: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_IN_SHADOW_TREE; - pub const NODE_HAS_EMPTY_SELECTOR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_EMPTY_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_SLOW_SELECTOR; - pub const NODE_HAS_EDGE_CHILD_SELECTOR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_EDGE_CHILD_SELECTOR; - pub const NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS; - pub const NODE_ALL_SELECTOR_FLAGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_ALL_SELECTOR_FLAGS; - pub const NODE_NEEDS_FRAME: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_NEEDS_FRAME; - pub const NODE_DESCENDANTS_NEED_FRAMES: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_DESCENDANTS_NEED_FRAMES; - pub const NODE_HAS_ACCESSKEY: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_ACCESSKEY; - pub const NODE_HAS_DIRECTION_RTL: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_DIRECTION_RTL; - pub const NODE_HAS_DIRECTION_LTR: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_HAS_DIRECTION_LTR; - pub const NODE_ALL_DIRECTION_FLAGS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_ALL_DIRECTION_FLAGS; - pub const NODE_CHROME_ONLY_ACCESS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_CHROME_ONLY_ACCESS; - pub const NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS; - pub const NODE_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_83 = - _bindgen_ty_83::NODE_TYPE_SPECIFIC_BITS_OFFSET; + 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; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_83 { + pub enum _bindgen_ty_72 { NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_PROPERTIES = 8, NODE_IS_ANONYMOUS_ROOT = 16, @@ -32349,46 +32343,46 @@ pub mod root { assert_eq! (::std::mem::align_of::() , 8usize , concat ! ( "Alignment of " , stringify ! ( nsISMILAttr ) )); } - pub const ELEMENT_SHARED_RESTYLE_BIT_1: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_SHARED_RESTYLE_BIT_2: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_SHARED_RESTYLE_BIT_3: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_SHARED_RESTYLE_BIT_4: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_1; + 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_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO: - root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_SNAPSHOT: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_3; - pub const ELEMENT_HANDLED_SNAPSHOT: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_HAS_PENDING_RESTYLE: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_1; - pub const ELEMENT_IS_POTENTIAL_RESTYLE_ROOT: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_2; - pub const ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE: root::_bindgen_ty_85 + 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 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_3; + _bindgen_ty_74::ELEMENT_SHARED_RESTYLE_BIT_3; pub const ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT: - root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_SHARED_RESTYLE_BIT_4; - pub const ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR; - pub const ELEMENT_PENDING_RESTYLE_FLAGS: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_PENDING_RESTYLE_FLAGS; - pub const ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS; - pub const ELEMENT_ALL_RESTYLE_FLAGS: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_ALL_RESTYLE_FLAGS; - pub const ELEMENT_TYPE_SPECIFIC_BITS_OFFSET: root::_bindgen_ty_85 = - _bindgen_ty_85::ELEMENT_TYPE_SPECIFIC_BITS_OFFSET; + 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; #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] - pub enum _bindgen_ty_85 { + pub enum _bindgen_ty_74 { ELEMENT_SHARED_RESTYLE_BIT_1 = 8388608, ELEMENT_SHARED_RESTYLE_BIT_2 = 16777216, ELEMENT_SHARED_RESTYLE_BIT_3 = 33554432, @@ -33264,7 +33258,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_226420_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_201132_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33620,7 +33614,7 @@ pub mod root { root::mozilla::binding_danger::TErrorResult ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_228220_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_202932_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -33781,7 +33775,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_233812__bindgen_ty_id_233819_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_208528__bindgen_ty_id_208535_close0_instantiation() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34029,7 +34023,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_236309_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_211025_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34097,7 +34091,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_236611_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_211327_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34209,7 +34203,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_NotNull_open0__bindgen_ty_id_237156_close0_instantiation() { + fn __bindgen_test_layout_NotNull_open0__bindgen_ty_id_211876_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34554,6 +34548,17 @@ pub mod root { root::nsCOMPtr ) )); } #[test] + fn __bindgen_test_layout_nsCOMPtr_open0_nsINode_close0_instantiation() { + assert_eq!(::std::mem::size_of::() , 8usize , concat ! + ( + "Size of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + assert_eq!(::std::mem::align_of::() , 8usize , concat + ! ( + "Alignment of template specialization: " , stringify ! ( + root::nsCOMPtr ) )); + } + #[test] fn __bindgen_test_layout_RefPtr_open0_CSSRuleListImpl_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( @@ -34611,7 +34616,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_237575_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_212298_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34701,7 +34706,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_237973_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_212696_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34802,7 +34807,7 @@ pub mod root { root::nsTArray<::nsstring::nsStringRepr> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_238934_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213659_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34891,7 +34896,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_239237_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213962_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34902,7 +34907,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_239242_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_213967_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -34959,7 +34964,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_239717_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_214442_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35594,7 +35599,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_242543_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_217268_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35673,7 +35678,7 @@ pub mod root { root::mozilla::DefaultDelete ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_248811_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_223536_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35706,7 +35711,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_249980_close0_instantiation() { + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_224705_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35717,7 +35722,7 @@ pub mod root { root::JS::Heap<*mut root::JSObject> ) )); } #[test] - fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_249984_close0_instantiation() { + fn __bindgen_test_layout_Heap_open0__bindgen_ty_id_224709_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35739,7 +35744,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_TenuredHeap_open0__bindgen_ty_id_249991_close0_instantiation() { + fn __bindgen_test_layout_TenuredHeap_open0__bindgen_ty_id_224716_close0_instantiation() { assert_eq!(::std::mem::size_of::() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -35818,7 +35823,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_251096_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_225889_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36013,7 +36018,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_252544_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_227337_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36118,7 +36123,7 @@ pub mod root { root::nsRefPtrHashKey ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_254917_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_229710_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -36819,7 +36824,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_257399_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_232192_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37056,7 +37061,7 @@ pub mod root { root::nsCOMPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_265211_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240004_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37067,7 +37072,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_265216_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240009_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37155,7 +37160,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_265329_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_240122_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37442,7 +37447,7 @@ pub mod root { ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_266909_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_241702_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37464,7 +37469,7 @@ pub mod root { root::RefPtr ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_267067_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_241860_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37475,7 +37480,7 @@ pub mod root { root::nsTArray<*mut root::nsIContent> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_267072_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_241865_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37607,7 +37612,7 @@ pub mod root { root::nsTArray ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_269589_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_244094_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( @@ -37618,7 +37623,7 @@ pub mod root { root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); } #[test] - fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_269595_close0_instantiation() { + fn __bindgen_test_layout_nsTArray_open0__bindgen_ty_id_244100_close0_instantiation() { assert_eq!(::std::mem::size_of::>() , 8usize , concat ! ( "Size of template specialization: " , stringify ! ( From d4aa8e3cef64668cebb0c2a31b882b25092bb632 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Tue, 18 Jul 2017 18:38:47 -0700 Subject: [PATCH 2/2] Track the restyle root and use it to do less work during the traversal. MozReview-Commit-ID: A8O3JOpsv4E --- components/style/dom.rs | 31 +++------ components/style/gecko/data.rs | 2 +- components/style/gecko/wrapper.rs | 35 ++++++++++ components/style/invalidation/stylesheets.rs | 12 ++-- components/style/stylesheet_set.rs | 9 ++- components/style/stylist.rs | 11 +-- components/style/traversal.rs | 70 +++++++++++++------- components/style/traversal_flags.rs | 6 +- ports/geckolib/glue.rs | 24 +++++-- 9 files changed, 132 insertions(+), 68 deletions(-) diff --git a/components/style/dom.rs b/components/style/dom.rs index 4e699017c64..7716a8a1e38 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -501,13 +501,20 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone + unsafe fn unset_animation_only_dirty_descendants(&self) { } - /// Clear all bits related to dirty descendant. + /// Clear all bits related describing the dirtiness of descendants. /// /// In Gecko, this corresponds to the regular dirty descendants bit, the /// animation-only dirty descendants bit, and the lazy frame construction /// descendants bit. unsafe fn clear_descendants_bits(&self) { self.unset_dirty_descendants(); } + /// Clear all element flags related to dirtiness. + /// + /// In Gecko, this corresponds to the regular dirty descendants bit, the + /// animation-only dirty descendants bit, the lazy frame construction bit, + /// and the lazy frame construction descendants bit. + unsafe fn clear_dirty_bits(&self) { self.unset_dirty_descendants(); } + /// Returns true if this element is a visited link. /// /// Servo doesn't support visited styles yet. @@ -718,28 +725,6 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone + -> bool; } -/// Trait abstracting over different kinds of dirty-descendants bits. -pub trait DescendantsBit { - /// Returns true if the Element has the bit. - fn has(el: E) -> bool; - /// Sets the bit on the Element. - unsafe fn set(el: E); -} - -/// Implementation of DescendantsBit for the regular dirty descendants bit. -pub struct DirtyDescendants; -impl DescendantsBit for DirtyDescendants { - fn has(el: E) -> bool { el.has_dirty_descendants() } - unsafe fn set(el: E) { el.set_dirty_descendants(); } -} - -/// Implementation of DescendantsBit for the animation-only dirty descendants bit. -pub struct AnimationOnlyDirtyDescendants; -impl DescendantsBit for AnimationOnlyDirtyDescendants { - fn has(el: E) -> bool { el.has_animation_only_dirty_descendants() } - unsafe fn set(el: E) { el.set_animation_only_dirty_descendants(); } -} - /// TNode and TElement aren't Send because we want to be careful and explicit /// about our parallel traversal. However, there are certain situations /// (including but not limited to the traversal) where we need to send DOM diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs index 39cfddd3738..28857a3c010 100644 --- a/components/style/gecko/data.rs +++ b/components/style/gecko/data.rs @@ -152,7 +152,7 @@ impl PerDocumentStyleDataImpl { &mut self, guard: &SharedRwLockReadGuard, document_element: Option, - ) + ) -> bool where E: TElement, { diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 926533d9c90..4b7e5993334 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -61,6 +61,7 @@ use gecko_bindings::structs::ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO; use gecko_bindings::structs::ELEMENT_HAS_SNAPSHOT; use gecko_bindings::structs::EffectCompositor_CascadeLevel as CascadeLevel; use gecko_bindings::structs::NODE_DESCENDANTS_NEED_FRAMES; +use gecko_bindings::structs::NODE_NEEDS_FRAME; use gecko_bindings::structs::nsChangeHint; use gecko_bindings::structs::nsIDocument_DocumentTheme as DocumentTheme; use gecko_bindings::structs::nsRestyleHint; @@ -493,6 +494,33 @@ impl<'le> GeckoElement<'le> { unsafe { Gecko_UnsetNodeFlags(self.as_node().0, flags) } } + /// Returns true if this element has descendants for lazy frame construction. + pub fn descendants_need_frames(&self) -> bool { + self.flags() & (NODE_DESCENDANTS_NEED_FRAMES as u32) != 0 + } + + /// Returns true if this element needs lazy frame construction. + pub fn needs_frame(&self) -> bool { + self.flags() & (NODE_NEEDS_FRAME as u32) != 0 + } + + /// Returns true if a traversal starting from this element requires a post-traversal. + pub fn needs_post_traversal(&self) -> bool { + debug!("needs_post_traversal: dd={}, aodd={}, lfcd={}, lfc={}, restyle={:?}", + self.has_dirty_descendants(), + self.has_animation_only_dirty_descendants(), + self.descendants_need_frames(), + self.needs_frame(), + self.borrow_data().unwrap().restyle); + + let has_flag = + self.flags() & (ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO as u32 | + ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO as u32 | + NODE_DESCENDANTS_NEED_FRAMES as u32 | + NODE_NEEDS_FRAME as u32) != 0; + has_flag || self.borrow_data().unwrap().restyle.contains_restyle_data() + } + /// Returns true if this element has a shadow root. fn has_shadow_root(&self) -> bool { self.get_extended_slots().map_or(false, |slots| !slots.mShadowRoot.mRawPtr.is_null()) @@ -1070,6 +1098,13 @@ impl<'le> TElement for GeckoElement<'le> { } #[inline] + unsafe fn clear_dirty_bits(&self) { + self.unset_flags(ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO as u32 | + ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO as u32 | + NODE_DESCENDANTS_NEED_FRAMES as u32 | + NODE_NEEDS_FRAME as u32) + } + fn is_visited_link(&self) -> bool { use element_state::IN_VISITED_STATE; self.get_state().intersects(IN_VISITED_STATE) diff --git a/components/style/invalidation/stylesheets.rs b/components/style/invalidation/stylesheets.rs index 71a1b29e5c0..3c071fc4a4d 100644 --- a/components/style/invalidation/stylesheets.rs +++ b/components/style/invalidation/stylesheets.rs @@ -117,13 +117,17 @@ impl StylesheetInvalidationSet { /// Clears the invalidation set, invalidating elements as needed if /// `document_element` is provided. - pub fn flush(&mut self, document_element: Option) + /// + /// Returns true if any invalidations ocurred. + pub fn flush(&mut self, document_element: Option) -> bool where E: TElement, { - if let Some(e) = document_element { - self.process_invalidations(e); - } + let have_invalidations = match document_element { + Some(e) => self.process_invalidations(e), + None => false, + }; self.clear(); + have_invalidations } /// Clears the invalidation set without processing. diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index 91e87cff239..8548ac53f01 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -182,25 +182,28 @@ where /// Flush the current set, unmarking it as dirty, and returns an iterator /// over the new stylesheet list. + /// + /// Returns true if any elements were invalidated. pub fn flush( &mut self, document_element: Option, - ) -> (StylesheetIterator, OriginSet) + ) -> (StylesheetIterator, OriginSet, bool) where E: TElement, { debug!("StylesheetSet::flush"); let mut origins = OriginSet::empty(); + let mut have_invalidations = false; for (data, origin) in self.invalidation_data.iter_mut_origins() { if data.dirty { - data.invalidations.flush(document_element); + have_invalidations |= data.invalidations.flush(document_element); data.dirty = false; origins |= origin; } } - (self.iter(), origins) + (self.iter(), origins, have_invalidations) } /// Flush stylesheets, but without running any of the invalidation passes. diff --git a/components/style/stylist.rs b/components/style/stylist.rs index dc6924c6c5b..2ea8d5313ac 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -481,19 +481,20 @@ impl Stylist { ua_sheets: Option<&UserAgentStylesheets>, extra_data: &mut PerOrigin, document_element: Option, - ) + ) -> bool where E: TElement, { if !self.stylesheets.has_changed() { - return; + return false; } let author_style_disabled = self.stylesheets.author_style_disabled(); - let (doc_stylesheets, origins_to_rebuild) = self.stylesheets.flush(document_element); + let (doc_stylesheets, origins_to_rebuild, have_invalidations) = + self.stylesheets.flush(document_element); if origins_to_rebuild.is_empty() { - return; + return have_invalidations; } self.num_rebuilds += 1; @@ -538,6 +539,8 @@ impl Stylist { extra_data, origins_to_rebuild, ); + + have_invalidations } /// Insert a given stylesheet before another stylesheet in the document. diff --git a/components/style/traversal.rs b/components/style/traversal.rs index 5379f0cdee8..2882d7d4d5f 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -185,10 +185,16 @@ pub trait DomTraversal : Sync { let should_traverse = Self::element_needs_traversal( root, flags, - data.map(|d| &*d), + data.as_mut().map(|d| &**d), parent_data.as_ref().map(|d| &**d) ); + // If we're not going to traverse at all, we may need to clear some state + // off the root (which would normally be done at the end of recalc_style_at). + if !should_traverse && data.is_some() { + clear_state_after_traversing(root, data.unwrap(), flags); + } + PreTraverseToken(should_traverse) } @@ -592,6 +598,31 @@ where ); } + // FIXME(bholley): Make these assertions pass for servo. + if cfg!(feature = "gecko") && cfg!(debug_assertions) && data.styles.is_display_none() { + debug_assert!(!element.has_dirty_descendants()); + debug_assert!(!element.has_animation_only_dirty_descendants()); + } + + debug_assert!(flags.for_animation_only() || + !flags.contains(ClearDirtyBits) || + !element.has_animation_only_dirty_descendants(), + "Should have cleared animation bits already"); + clear_state_after_traversing(element, data, flags); + + context.thread_local.end_element(element); +} + +fn clear_state_after_traversing( + element: E, + data: &mut ElementData, + flags: TraversalFlags +) +where + E: TElement, +{ + use traversal_flags::*; + // If we are in a forgetful traversal, drop the existing restyle // data here, since we won't need to perform a post-traversal to pick up // any change hints. @@ -599,32 +630,16 @@ where data.clear_restyle_flags_and_damage(); } - // Optionally clear the descendants bits. - if data.styles.is_display_none() { - // When this element is the root of a display:none subtree, we want to clear - // the bits even if the style didn't change (since, if the style did change, - // we'd have already cleared it above). - // - // This keeps the tree in a valid state without requiring the DOM to check - // display:none on the parent when inserting new children (which can be - // moderately expensive). Instead, DOM implementations can unconditionally - // set the dirty descendants bit on any styled parent, and let the traversal - // sort it out. - // - // Note that the NODE_DESCENDANTS_NEED_FRAMES bit should generally only be set - // when appending content beneath an element with a frame (i.e. not - // display:none), so clearing it here isn't strictly necessary, but good - // belt-and-suspenders. - unsafe { element.clear_descendants_bits(); } - } else if flags.for_animation_only() { - if flags.contains(ClearAnimationOnlyDirtyDescendants) { + // Clear dirty bits as appropriate. + if flags.for_animation_only() { + if flags.intersects(ClearDirtyBits | ClearAnimationOnlyDirtyDescendants) { unsafe { element.unset_animation_only_dirty_descendants(); } } - } else if flags.contains(ClearDirtyDescendants) { - unsafe { element.unset_dirty_descendants(); } + } else if flags.contains(ClearDirtyBits) { + // The animation traversal happens first, so we don't need to guard against + // clearing the animation bit on the regular traversal. + unsafe { element.clear_dirty_bits(); } } - - context.thread_local.end_element(element); } fn compute_style( @@ -855,6 +870,11 @@ where } } } - p.clear_descendants_bits(); + if p == root { + // Make sure not to clear NODE_NEEDS_FRAME on the root. + p.clear_descendants_bits(); + } else { + p.clear_dirty_bits(); + } } } diff --git a/components/style/traversal_flags.rs b/components/style/traversal_flags.rs index 341f21016a9..674c9a49631 100644 --- a/components/style/traversal_flags.rs +++ b/components/style/traversal_flags.rs @@ -27,8 +27,8 @@ bitflags! { /// Actively seeks out and clears change hints that may have been posted into /// the tree. Nonsensical without also passing Forgetful. const AggressivelyForgetful = 1 << 4, - /// Clears the dirty descendants bit in the subtree. - const ClearDirtyDescendants = 1 << 5, + /// Clears all the dirty bits on the elements traversed. + const ClearDirtyBits = 1 << 5, /// Clears the animation-only dirty descendants bit in the subtree. const ClearAnimationOnlyDirtyDescendants = 1 << 6, /// Allows the traversal to run in parallel if there are sufficient cores on @@ -67,7 +67,7 @@ pub fn assert_traversal_flags_match() { ServoTraversalFlags_UnstyledOnly => UnstyledOnly, ServoTraversalFlags_Forgetful => Forgetful, ServoTraversalFlags_AggressivelyForgetful => AggressivelyForgetful, - ServoTraversalFlags_ClearDirtyDescendants => ClearDirtyDescendants, + ServoTraversalFlags_ClearDirtyBits => ClearDirtyBits, ServoTraversalFlags_ClearAnimationOnlyDirtyDescendants => ClearAnimationOnlyDirtyDescendants, ServoTraversalFlags_ParallelTraversal => ParallelTraversal, diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 7388314ce0c..bdbf1d319d7 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -25,6 +25,7 @@ use style::gecko::restyle_damage::GeckoRestyleDamage; use style::gecko::selector_parser::PseudoElement; use style::gecko::traversal::RecalcStyleOnly; use style::gecko::wrapper::GeckoElement; +use style::gecko_bindings::bindings; use style::gecko_bindings::bindings::{RawGeckoElementBorrowed, RawGeckoElementBorrowedOrNull}; use style::gecko_bindings::bindings::{RawGeckoKeyframeListBorrowed, RawGeckoKeyframeListBorrowedMut}; use style::gecko_bindings::bindings::{RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockStrong}; @@ -291,14 +292,14 @@ pub extern "C" fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed, traversal_flags, unsafe { &*snapshots }); - debug!("Servo_TraverseSubtree complete (dd={}, aodd={}, restyle={:?})", + debug!("Servo_TraverseSubtree complete (dd={}, aodd={}, lfcd={}, lfc={}, restyle={:?})", element.has_dirty_descendants(), element.has_animation_only_dirty_descendants(), + element.descendants_need_frames(), + element.needs_frame(), element.borrow_data().unwrap().restyle); - element.has_dirty_descendants() || - element.has_animation_only_dirty_descendants() || - element.borrow_data().unwrap().restyle.contains_restyle_data() + element.needs_post_traversal() } /// Checks whether the rule tree has crossed its threshold for unused nodes, and @@ -826,6 +827,14 @@ pub extern "C" fn Servo_Element_GetPseudoComputedValues(element: RawGeckoElement .clone().into() } +#[no_mangle] +pub extern "C" fn Servo_Element_IsDisplayNone(element: RawGeckoElementBorrowed) -> bool +{ + let element = GeckoElement(element); + let data = element.borrow_data().expect("Invoking Servo_Element_IsDisplayNone on unstyled element"); + data.styles.is_display_none() +} + #[no_mangle] pub extern "C" fn Servo_StyleSheet_Empty(mode: SheetParsingMode) -> RawServoStyleSheetContentsStrong { let global_style_data = &*GLOBAL_STYLE_DATA; @@ -991,7 +1000,12 @@ pub extern "C" fn Servo_StyleSet_FlushStyleSheets( let guard = global_style_data.shared_lock.read(); let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); let doc_element = doc_element.map(GeckoElement); - data.flush_stylesheets(&guard, doc_element); + let have_invalidations = data.flush_stylesheets(&guard, doc_element); + if have_invalidations && doc_element.is_some() { + // The invalidation machinery propagates the bits up, but we still + // need to tell the gecko restyle root machinery about it. + unsafe { bindings::Gecko_NoteDirtyElement(doc_element.unwrap().0); } + } } #[no_mangle]