Introduce ShadowIncluding enum for tree traversals

This commit is contained in:
Fernando Jiménez Moreno 2019-02-21 13:19:01 +01:00
parent 2674a3e717
commit 3ccd622c9b
14 changed files with 58 additions and 50 deletions

View file

@ -32,7 +32,8 @@ use crate::dom::htmlmapelement::HTMLMapElement;
use crate::dom::htmlpictureelement::HTMLPictureElement;
use crate::dom::htmlsourceelement::HTMLSourceElement;
use crate::dom::mouseevent::MouseEvent;
use crate::dom::node::{document_from_node, window_from_node, Node, NodeDamage, UnbindContext};
use crate::dom::node::UnbindContext;
use crate::dom::node::{document_from_node, window_from_node, Node, NodeDamage, ShadowIncluding};
use crate::dom::performanceresourcetiming::InitiatorType;
use crate::dom::progressevent::ProgressEvent;
use crate::dom::values::UNSIGNED_LONG_MAX;
@ -1259,7 +1260,7 @@ impl HTMLImageElement {
let useMapElements = document_from_node(self)
.upcast::<Node>()
.traverse_preorder(/* shadow including */ false)
.traverse_preorder(ShadowIncluding::No)
.filter_map(DomRoot::downcast::<HTMLMapElement>)
.find(|n| {
n.upcast::<Element>()