layout: Stop overriding display of the ::-servo-details-content pseudo-element.

We only override it when there's no "open" attribute. But a display: none
pseudo-element is the same as no pseudo-element at all.

This should get the same behavior when iterating children in dom_wrapper.rs
This commit is contained in:
Emilio Cobos Álvarez 2018-01-14 21:06:24 +01:00
parent 1b46e2e759
commit 55174991b6
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -358,13 +358,9 @@ pub trait ThreadSafeLayoutElement
#[inline]
fn get_details_content_pseudo(&self) -> Option<Self> {
if self.get_local_name() == &local_name!("details") &&
self.get_namespace() == &ns!(html) {
let display = if self.get_attr(&ns!(), &local_name!("open")).is_some() {
None // Specified by the stylesheet
} else {
Some(Display::None)
};
Some(self.with_pseudo(PseudoElementType::DetailsContent(display)))
self.get_namespace() == &ns!(html) &&
self.get_attr(&ns!(), &local_name!("open")).is_some() {
Some(self.with_pseudo(PseudoElementType::DetailsContent(None)))
} else {
None
}