diff options
author | Bobby Holley <bobbyholley@gmail.com> | 2016-10-26 22:56:59 -0700 |
---|---|---|
committer | Bobby Holley <bobbyholley@gmail.com> | 2016-10-29 13:45:40 -0700 |
commit | 5442fbec3f5a4d00c6cc61adfefc0ae747194db2 (patch) | |
tree | ce64c7b35b129765f8fc999c9db176ffa190fae0 /components/script_layout_interface/wrapper_traits.rs | |
parent | 47d29fd056d1ee5dffdf04c8daf1e097bdd3f38f (diff) | |
download | servo-5442fbec3f5a4d00c6cc61adfefc0ae747194db2.tar.gz servo-5442fbec3f5a4d00c6cc61adfefc0ae747194db2.zip |
Hoist most styling functionality from TNode to TElement.
MozReview-Commit-ID: DZ8ZrsZIiAU
Diffstat (limited to 'components/script_layout_interface/wrapper_traits.rs')
-rw-r--r-- | components/script_layout_interface/wrapper_traits.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/components/script_layout_interface/wrapper_traits.rs b/components/script_layout_interface/wrapper_traits.rs index 669a3e331be..416d04d9522 100644 --- a/components/script_layout_interface/wrapper_traits.rs +++ b/components/script_layout_interface/wrapper_traits.rs @@ -19,7 +19,7 @@ use style::atomic_refcell::AtomicRefCell; use style::computed_values::display; use style::context::SharedStyleContext; use style::data::NodeData; -use style::dom::{LayoutIterator, NodeInfo, PresentationalHintsSynthetizer, TNode}; +use style::dom::{LayoutIterator, NodeInfo, PresentationalHintsSynthetizer, TElement, TNode}; use style::dom::OpaqueNode; use style::properties::ServoComputedValues; use style::selector_impl::{PseudoElement, PseudoElementCascadeType, ServoSelectorImpl}; @@ -73,6 +73,7 @@ impl<T> PseudoElementType<T> { /// Trait to abstract access to layout data across various data structures. pub trait GetLayoutData { fn get_style_and_layout_data(&self) -> Option<OpaqueStyleAndLayoutData>; + fn init_style_and_layout_data(&self, data: OpaqueStyleAndLayoutData); } /// A wrapper so that layout can access only the methods that it should have access to. Layout must @@ -88,10 +89,6 @@ pub trait LayoutNode: GetLayoutData + TNode { unsafe fn clear_dirty_bits(&self); - fn get_style_data(&self) -> Option<&AtomicRefCell<NodeData>>; - - fn init_style_and_layout_data(&self, data: OpaqueStyleAndLayoutData); - fn rev_children(self) -> LayoutIterator<ReverseChildrenIterator<Self>> { LayoutIterator(ReverseChildrenIterator { current: self.last_child(), @@ -276,6 +273,10 @@ pub trait DangerousThreadSafeLayoutNode: ThreadSafeLayoutNode { unsafe fn dangerous_next_sibling(&self) -> Option<Self>; } +pub trait LayoutElement: Clone + Copy + Sized + Debug + GetLayoutData + TElement { + fn get_style_data(&self) -> Option<&AtomicRefCell<NodeData>>; +} + pub trait ThreadSafeLayoutElement: Clone + Copy + Sized + Debug + ::selectors::Element<Impl=ServoSelectorImpl> + GetLayoutData + |