layout: Implement empty-cells per CSS 2.1 § 17.6.1.1.

This commit is contained in:
Patrick Walton 2014-12-16 16:03:08 -08:00
parent 592c93e0c2
commit 5675274c44
8 changed files with 98 additions and 13 deletions

View file

@ -1000,6 +1000,15 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
_ => panic!("no layout data for this node"),
}
}
/// Returns true if this node contributes content. This is used in the implementation of
/// `empty_cells` per CSS 2.1 § 17.6.1.1.
pub fn is_content(&self) -> bool {
match self.type_id() {
Some(NodeTypeId::Element(..)) | Some(NodeTypeId::Text(..)) => true,
_ => false
}
}
}
pub struct ThreadSafeLayoutNodeChildrenIterator<'a> {