mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Introduce ShadowIncluding enum for tree traversals
This commit is contained in:
parent
2674a3e717
commit
3ccd622c9b
14 changed files with 58 additions and 50 deletions
|
@ -13,7 +13,7 @@ use crate::dom::bindings::str::DOMString;
|
|||
use crate::dom::document::Document;
|
||||
use crate::dom::element::Element;
|
||||
use crate::dom::htmlcollection::HTMLCollection;
|
||||
use crate::dom::node::{window_from_node, Node};
|
||||
use crate::dom::node::{window_from_node, Node, ShadowIncluding};
|
||||
use crate::dom::nodelist::NodeList;
|
||||
use crate::dom::window::Window;
|
||||
use dom_struct::dom_struct;
|
||||
|
@ -59,7 +59,7 @@ impl DocumentFragmentMethods for DocumentFragment {
|
|||
fn GetElementById(&self, id: DOMString) -> Option<DomRoot<Element>> {
|
||||
let node = self.upcast::<Node>();
|
||||
let id = Atom::from(id);
|
||||
node.traverse_preorder(/* shadow including */ false)
|
||||
node.traverse_preorder(ShadowIncluding::No)
|
||||
.filter_map(DomRoot::downcast::<Element>)
|
||||
.find(
|
||||
|descendant| match descendant.get_attribute(&ns!(), &local_name!("id")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue