From bea79aabff861c8eddc43a3e505e6097cf373ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 30 Oct 2017 12:37:49 +0100 Subject: [PATCH 1/2] style: Implement ElementWrapper::pseudo_element_originating_element in terms of its TElement implementation. This matches right now, but it may not in the future. --- components/style/invalidation/element/element_wrapper.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/style/invalidation/element/element_wrapper.rs b/components/style/invalidation/element/element_wrapper.rs index 5cedff38fa3..2cbe56bf955 100644 --- a/components/style/invalidation/element/element_wrapper.rs +++ b/components/style/invalidation/element/element_wrapper.rs @@ -348,7 +348,7 @@ impl<'a, E> Element for ElementWrapper<'a, E> } fn pseudo_element_originating_element(&self) -> Option { - self.element.closest_non_native_anonymous_ancestor() + self.element.pseudo_element_originating_element() .map(|e| ElementWrapper::new(e, self.snapshot_map)) } } From f060cbb38c82a29d791f44c41b5b880b56c2ed93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 30 Oct 2017 12:38:55 +0100 Subject: [PATCH 2/2] style: Properly forward ElementWrapper::blocks_ancestor_combinators. Not doing it is buggy. I think the only outcome of it is that we may over-invalidate, so it's probably not a huge deal, but worth doing it. --- components/style/invalidation/element/element_wrapper.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/style/invalidation/element/element_wrapper.rs b/components/style/invalidation/element/element_wrapper.rs index 2cbe56bf955..8b3fb0385bb 100644 --- a/components/style/invalidation/element/element_wrapper.rs +++ b/components/style/invalidation/element/element_wrapper.rs @@ -351,4 +351,8 @@ impl<'a, E> Element for ElementWrapper<'a, E> self.element.pseudo_element_originating_element() .map(|e| ElementWrapper::new(e, self.snapshot_map)) } + + fn blocks_ancestor_combinators(&self) -> bool { + self.element.blocks_ancestor_combinators() + } }