aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface
diff options
context:
space:
mode:
authorBobby Holley <bobbyholley@gmail.com>2016-09-20 17:25:38 -0700
committerBobby Holley <bobbyholley@gmail.com>2016-09-20 17:48:31 -0700
commit4aa3e589c047f006fa37c25e5bf1ba1e1b69b8e4 (patch)
tree063205a63951370694b00028cd40dfaf8b7e69b0 /components/script_layout_interface
parente6bbff110a017019ac31cf0700b1e722d8a1c61b (diff)
downloadservo-4aa3e589c047f006fa37c25e5bf1ba1e1b69b8e4.tar.gz
servo-4aa3e589c047f006fa37c25e5bf1ba1e1b69b8e4.zip
Introduce the LayoutIterator newtype and return it for all children() methods in style and layout.
Diffstat (limited to 'components/script_layout_interface')
-rw-r--r--components/script_layout_interface/wrapper_traits.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script_layout_interface/wrapper_traits.rs b/components/script_layout_interface/wrapper_traits.rs
index 51133fc2daf..dcb1f68cfb4 100644
--- a/components/script_layout_interface/wrapper_traits.rs
+++ b/components/script_layout_interface/wrapper_traits.rs
@@ -15,7 +15,7 @@ use std::sync::Arc;
use string_cache::{Atom, Namespace};
use style::computed_values::display;
use style::context::SharedStyleContext;
-use style::dom::{NodeInfo, PresentationalHintsSynthetizer, TNode};
+use style::dom::{LayoutIterator, NodeInfo, PresentationalHintsSynthetizer, TNode};
use style::dom::OpaqueNode;
use style::properties::ServoComputedValues;
use style::refcell::{Ref, RefCell};
@@ -81,10 +81,10 @@ pub trait LayoutNode: TNode {
fn init_style_and_layout_data(&self, data: OpaqueStyleAndLayoutData);
fn get_style_and_layout_data(&self) -> Option<OpaqueStyleAndLayoutData>;
- fn rev_children(self) -> ReverseChildrenIterator<Self> {
- ReverseChildrenIterator {
+ fn rev_children(self) -> LayoutIterator<ReverseChildrenIterator<Self>> {
+ LayoutIterator(ReverseChildrenIterator {
current: self.last_child(),
- }
+ })
}
fn traverse_preorder(self) -> TreeIterator<Self> {
@@ -169,7 +169,7 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + NodeInfo + PartialEq + Sized {
fn debug_id(self) -> usize;
/// Returns an iterator over this node's children.
- fn children(&self) -> Self::ChildrenIterator;
+ fn children(&self) -> LayoutIterator<Self::ChildrenIterator>;
/// If this is an element, accesses the element data. Fails if this is not an element node.
#[inline]