diff options
Diffstat (limited to 'components/layout')
-rw-r--r-- | components/layout/layout_thread.rs | 2 | ||||
-rw-r--r-- | components/layout/wrapper.rs | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs index 64d37f889d4..d72653dc634 100644 --- a/components/layout/layout_thread.rs +++ b/components/layout/layout_thread.rs @@ -85,7 +85,7 @@ use util::thread_state; use util::workqueue::WorkQueue; use webrender_helpers::{WebRenderDisplayListConverter, WebRenderFrameBuilder}; use webrender_traits; -use wrapper::{LayoutNode, NonOpaqueStyleAndLayoutData, ServoLayoutNode}; +use wrapper::{LayoutNode, LayoutNodeLayoutData, NonOpaqueStyleAndLayoutData, ServoLayoutNode}; /// The number of screens of data we're allowed to generate display lists for in each direction. pub const DISPLAY_PORT_SIZE_FACTOR: i32 = 8; diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 4ab9b97ce64..2acb1636f4e 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -83,7 +83,9 @@ pub trait LayoutNode: TNode { fn init_style_and_layout_data(&self, data: OpaqueStyleAndLayoutData); fn get_style_and_layout_data(&self) -> Option<OpaqueStyleAndLayoutData>; +} +pub trait LayoutNodeLayoutData { /// Similar to borrow_data*, but returns the full PrivateLayoutData rather /// than only the PrivateStyleData. unsafe fn borrow_layout_data_unchecked(&self) -> Option<*const PrivateLayoutData>; @@ -320,7 +322,9 @@ impl<'ln> LayoutNode for ServoLayoutNode<'ln> { self.get_jsmanaged().get_style_and_layout_data() } } +} +impl<T: LayoutNode> LayoutNodeLayoutData for T { unsafe fn borrow_layout_data_unchecked(&self) -> Option<*const PrivateLayoutData> { self.get_style_and_layout_data().map(|opaque| { let container = *opaque.ptr as NonOpaqueStyleAndLayoutData; |