Document owner_shadow_root

This commit is contained in:
Fernando Jiménez Moreno 2019-03-04 14:22:52 +01:00
parent ea1fe15dfe
commit ccf8a43649
2 changed files with 10 additions and 7 deletions

View file

@ -44,10 +44,9 @@ impl ShadowRoot {
#[allow(unrooted_must_root)]
fn new_inherited(host: &Element, document: &Document) -> ShadowRoot {
let document_fragment = DocumentFragment::new_inherited(document);
document_fragment
.upcast::<Node>()
.set_flag(NodeFlags::IS_IN_SHADOW_TREE, true);
document_fragment.upcast::<Node>().set_flag(
let node = document_fragment.upcast::<Node>();
node.set_flag(NodeFlags::IS_IN_SHADOW_TREE, true);
node.set_flag(
NodeFlags::IS_CONNECTED,
host.upcast::<Node>().is_connected(),
);