aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/element.rs
diff options
context:
space:
mode:
authorFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-03-07 18:46:08 +0100
committerFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-04-26 11:42:38 +0200
commit8eba5875471c9ddef95e0e4d4207ee6d6e70bbfd (patch)
treec38362ef9a1b32e5ac714d6bc2a6353954ac36a0 /components/script/dom/element.rs
parent0ca4792dc622029b807b40eee47cc38dd5d24e9a (diff)
downloadservo-8eba5875471c9ddef95e0e4d4207ee6d6e70bbfd.tar.gz
servo-8eba5875471c9ddef95e0e4d4207ee6d6e70bbfd.zip
Merge Node::shadow_including_inclusive_ancestors into inclusive_ancestors
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r--components/script/dom/element.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 0d320b833b8..169fb7b9013 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -73,7 +73,7 @@ use crate::dom::mutationobserver::{Mutation, MutationObserver};
use crate::dom::namednodemap::NamedNodeMap;
use crate::dom::node::{document_from_node, window_from_node};
use crate::dom::node::{BindContext, NodeDamage, NodeFlags, UnbindContext};
-use crate::dom::node::{ChildrenMutation, LayoutNodeHelpers, Node};
+use crate::dom::node::{ChildrenMutation, LayoutNodeHelpers, Node, ShadowIncluding};
use crate::dom::nodelist::NodeList;
use crate::dom::promise::Promise;
use crate::dom::raredata::ElementRareData;
@@ -1111,7 +1111,7 @@ impl Element {
let inclusive_ancestor_elements = self
.upcast::<Node>()
- .inclusive_ancestors()
+ .inclusive_ancestors(ShadowIncluding::No)
.filter_map(DomRoot::downcast::<Self>);
// Steps 3-4.
@@ -1227,7 +1227,7 @@ impl Element {
.unwrap()
} else {
self.upcast::<Node>()
- .inclusive_ancestors()
+ .inclusive_ancestors(ShadowIncluding::No)
.filter_map(DomRoot::downcast)
.last()
.expect("We know inclusive_ancestors will return `self` which is an element")
@@ -1236,7 +1236,10 @@ impl Element {
// https://dom.spec.whatwg.org/#locate-a-namespace-prefix
pub fn lookup_prefix(&self, namespace: Namespace) -> Option<DOMString> {
- for node in self.upcast::<Node>().inclusive_ancestors() {
+ for node in self
+ .upcast::<Node>()
+ .inclusive_ancestors(ShadowIncluding::No)
+ {
let element = node.downcast::<Element>()?;
// Step 1.
if *element.namespace() == namespace {
@@ -3235,7 +3238,7 @@ impl Element {
// https://html.spec.whatwg.org/multipage/#language
pub fn get_lang(&self) -> String {
self.upcast::<Node>()
- .inclusive_ancestors()
+ .inclusive_ancestors(ShadowIncluding::No)
.filter_map(|node| {
node.downcast::<Element>().and_then(|el| {
el.get_attribute(&ns!(xml), &local_name!("lang"))