style: Use the flattened tree parent to find the closest non-nac ancestor of an element.

This only matters for document level NAC like canvas custom content, in which
case otherwise we inherit from the document element (which is wrong).

Bug: 1405635
This commit is contained in:
Emilio Cobos Álvarez 2017-10-05 01:04:39 +02:00
parent 3f07cfec7c
commit 6f836bed5a
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -930,7 +930,7 @@ impl<'le> TElement for GeckoElement<'le> {
fn closest_non_native_anonymous_ancestor(&self) -> Option<Self> {
debug_assert!(self.is_native_anonymous());
let mut parent = match self.parent_element() {
let mut parent = match self.traversal_parent() {
Some(e) => e,
None => return None,
};
@ -940,7 +940,7 @@ impl<'le> TElement for GeckoElement<'le> {
return Some(parent);
}
parent = match parent.parent_element() {
parent = match parent.traversal_parent() {
Some(p) => p,
None => return None,
};