mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Do not care about shadow roots when getting root element
This commit is contained in:
parent
c48ad0ff7e
commit
d6ddb08e23
1 changed files with 1 additions and 8 deletions
|
@ -9,7 +9,6 @@ use crate::dom::attr::{Attr, AttrHelpersForLayout};
|
|||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::DocumentFragmentBinding::DocumentFragmentBinding::DocumentFragmentMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::ElementBinding;
|
||||
use crate::dom::bindings::codegen::Bindings::ElementBinding::ElementMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::EventBinding::EventMethods;
|
||||
|
@ -1203,13 +1202,7 @@ impl Element {
|
|||
}
|
||||
|
||||
pub fn root_element(&self) -> DomRoot<Element> {
|
||||
if self.node.is_in_shadow_tree() {
|
||||
self.upcast::<Node>()
|
||||
.owner_shadow_root()
|
||||
.upcast::<DocumentFragment>()
|
||||
.GetFirstElementChild()
|
||||
.unwrap()
|
||||
} else if self.node.is_in_doc() {
|
||||
if self.node.is_in_doc() {
|
||||
self.upcast::<Node>()
|
||||
.owner_doc()
|
||||
.GetDocumentElement()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue