mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -15,7 +15,7 @@ use crate::dom::event::Event;
|
|||
use crate::dom::eventtarget::EventTarget;
|
||||
use crate::dom::htmlelement::HTMLElement;
|
||||
use crate::dom::htmlformelement::{FormControl, FormControlElementHelpers, HTMLFormElement};
|
||||
use crate::dom::node::{document_from_node, Node};
|
||||
use crate::dom::node::{document_from_node, Node, ShadowIncluding};
|
||||
use crate::dom::virtualmethods::VirtualMethods;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{LocalName, Prefix};
|
||||
|
@ -162,7 +162,7 @@ impl VirtualMethods for HTMLLabelElement {
|
|||
impl HTMLLabelElement {
|
||||
pub fn first_labelable_descendant(&self) -> Option<DomRoot<HTMLElement>> {
|
||||
self.upcast::<Node>()
|
||||
.traverse_preorder(/* shadow including */ false)
|
||||
.traverse_preorder(ShadowIncluding::No)
|
||||
.filter_map(DomRoot::downcast::<HTMLElement>)
|
||||
.filter(|elem| elem.is_labelable_element())
|
||||
.next()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue