layout: Don't force to overwrite display for pseudo-elements.

This commit is contained in:
Emilio Cobos Álvarez 2016-04-24 19:12:40 +02:00
parent 2a499d5a0b
commit cf5c090576
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 42 additions and 43 deletions

View file

@ -1507,11 +1507,13 @@ impl<'a, ConcreteThreadSafeLayoutNode> PostorderNodeMutTraversal<ConcreteThreadS
// Pseudo-element.
let style = node.style(self.style_context());
let display = match node.get_pseudo_element_type() {
PseudoElementType::Normal => display::T::inline,
PseudoElementType::Before(display) => display,
PseudoElementType::After(display) => display,
PseudoElementType::DetailsContent(display) => display,
PseudoElementType::DetailsSummary(display) => display,
PseudoElementType::Normal
=> display::T::inline,
PseudoElementType::Before(maybe_display) |
PseudoElementType::After(maybe_display) |
PseudoElementType::DetailsContent(maybe_display) |
PseudoElementType::DetailsSummary(maybe_display)
=> maybe_display.unwrap_or(style.get_box().display),
};
(display, style.get_box().float, style.get_box().position)
}