diff options
Diffstat (limited to 'components/shared/script_layout/lib.rs')
-rw-r--r-- | components/shared/script_layout/lib.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/components/shared/script_layout/lib.rs b/components/shared/script_layout/lib.rs index 69e577e139d..499d99753fe 100644 --- a/components/shared/script_layout/lib.rs +++ b/components/shared/script_layout/lib.rs @@ -27,7 +27,7 @@ use fonts::{FontContext, SystemFontServiceProxy}; use fxhash::FxHashMap; use ipc_channel::ipc::IpcSender; use libc::c_void; -use malloc_size_of::MallocSizeOfOps; +use malloc_size_of::{MallocSizeOf as MallocSizeOfTrait, MallocSizeOfOps}; use malloc_size_of_derive::MallocSizeOf; use net_traits::image_cache::{ImageCache, PendingImageId}; use pixels::Image; @@ -51,7 +51,11 @@ use style::selector_parser::{PseudoElement, RestyleDamage, Snapshot}; use style::stylesheets::Stylesheet; use webrender_api::ImageKey; -pub type GenericLayoutData = dyn Any + Send + Sync; +pub trait GenericLayoutDataTrait: Any + MallocSizeOfTrait { + fn as_any(&self) -> &dyn Any; +} + +pub type GenericLayoutData = dyn GenericLayoutDataTrait + Send + Sync; #[derive(MallocSizeOf)] pub struct StyleData { @@ -59,7 +63,6 @@ pub struct StyleData { /// style system is being used standalone, this is all that hangs /// off the node. This must be first to permit the various /// transmutations between ElementData and PersistentLayoutData. - #[ignore_malloc_size_of = "This probably should not be ignored"] pub element_data: AtomicRefCell<ElementData>, /// Information needed during parallel traversals. @@ -240,9 +243,9 @@ pub trait Layout { /// Set the scroll states of this layout after a compositor scroll. fn set_scroll_offsets(&mut self, scroll_states: &[ScrollState]); - fn query_content_box(&self, node: OpaqueNode) -> Option<Rect<Au>>; - fn query_content_boxes(&self, node: OpaqueNode) -> Vec<Rect<Au>>; - fn query_client_rect(&self, node: OpaqueNode) -> Rect<i32>; + fn query_content_box(&self, node: TrustedNodeAddress) -> Option<Rect<Au>>; + fn query_content_boxes(&self, node: TrustedNodeAddress) -> Vec<Rect<Au>>; + fn query_client_rect(&self, node: TrustedNodeAddress) -> Rect<i32>; fn query_element_inner_outer_text(&self, node: TrustedNodeAddress) -> String; fn query_nodes_from_point( &self, |