Drop style data from descendants on display:none.

MozReview-Commit-ID: 8ls43oAGWRg
This commit is contained in:
Bobby Holley 2016-10-28 15:37:22 -07:00
parent 1a5e2b4673
commit fb70ee2c0c
8 changed files with 66 additions and 18 deletions

View file

@ -28,6 +28,7 @@ pub struct RecalcStyleAndConstructFlows<'lc> {
root: OpaqueNode,
}
#[allow(unsafe_code)]
impl<'lc, N> DomTraversalContext<N> for RecalcStyleAndConstructFlows<'lc>
where N: LayoutNode + TNode,
N::ConcreteElement: LayoutElement
@ -133,12 +134,15 @@ impl<'lc, N> DomTraversalContext<N> for RecalcStyleAndConstructFlows<'lc>
}
}
#[allow(unsafe_code)]
unsafe fn ensure_element_data(element: &N::ConcreteElement) -> &AtomicRefCell<ElementData> {
element.as_node().initialize_data();
element.get_data().unwrap()
}
unsafe fn clear_element_data(element: &N::ConcreteElement) {
element.as_node().clear_data();
}
fn local_context(&self) -> &LocalStyleContext {
self.context.local_context()
}