diff options
Diffstat (limited to 'components/layout')
-rw-r--r-- | components/layout/parallel.rs | 3 | ||||
-rw-r--r-- | components/layout/wrapper.rs | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/components/layout/parallel.rs b/components/layout/parallel.rs index efe49165850..ad0517b6d1b 100644 --- a/components/layout/parallel.rs +++ b/components/layout/parallel.rs @@ -123,8 +123,7 @@ pub trait ParallelPreorderDomTraversal : PreorderDomTraversal { // Perform the appropriate traversal. self.process(node); - // NB: O(n). - let child_count = node.children().count(); + let child_count = node.children_count(); // Reset the count of children. { diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 26378daf40c..bde6f39970e 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -237,6 +237,10 @@ impl<'ln> LayoutNode<'ln> { self.node.next_sibling_ref().map(|node| self.new_with_this_lifetime(&node)) } } + + pub fn children_count(&self) -> u32 { + unsafe { self.node.children_count() } + } } impl<'ln> LayoutNode<'ln> { |