Use the passed-in reflow root rather than the one stored in the SharedLayoutContext.

This commit is contained in:
Ms2ger 2015-07-09 13:08:56 +02:00 committed by Ms2ger
parent f6e3146de2
commit 9f91984415
4 changed files with 47 additions and 35 deletions

View file

@ -30,7 +30,6 @@
#![allow(unsafe_code)]
use context::SharedLayoutContext;
use data::{LayoutDataFlags, LayoutDataWrapper, PrivateLayoutData};
use gfx::display_list::OpaqueNode;
use gfx::text::glyph::CharIndex;
@ -183,16 +182,11 @@ impl<'ln> LayoutNode<'ln> {
/// While doing a reflow, the node at the root has no parent, as far as we're
/// concerned. This method returns `None` at the reflow root.
pub fn layout_parent_node(self, shared: &SharedLayoutContext) -> Option<LayoutNode<'ln>> {
match shared.reflow_root {
None => panic!("layout_parent_node(): This layout has no access to the DOM!"),
Some(reflow_root) => {
if self.opaque() == reflow_root {
None
} else {
self.parent_node()
}
}
pub fn layout_parent_node(self, reflow_root: OpaqueNode) -> Option<LayoutNode<'ln>> {
if self.opaque() == reflow_root {
None
} else {
self.parent_node()
}
}