Add box construction for 'inline-block'…

… and other atomic inline-level boxes.
This commit is contained in:
Simon Sapin 2019-12-03 11:01:58 +01:00
parent 303b36f17b
commit da36fcddb0
2 changed files with 38 additions and 29 deletions

View file

@ -188,6 +188,17 @@ fn traverse_pseudo_element_contents<'dom, Node>(
}
}
impl<Node> Contents<Node> {
/// Returns true iff the `try_from` impl below would return `Err(_)`
pub fn is_replaced(&self) -> bool {
match self {
Contents::OfElement(_) |
Contents::OfPseudoElement(_) => false,
Contents::Replaced(_) => true,
}
}
}
impl<Node> std::convert::TryFrom<Contents<Node>> for NonReplacedContents<Node> {
type Error = ReplacedContent;