From 6f836bed5aa0cae75771a05db75a8d0f90010643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 5 Oct 2017 01:04:39 +0200 Subject: [PATCH] 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 --- components/style/gecko/wrapper.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index a32d86bb3b1..7d82c6dddbc 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -930,7 +930,7 @@ impl<'le> TElement for GeckoElement<'le> { fn closest_non_native_anonymous_ancestor(&self) -> Option { 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, };