From 76c0ae565eef1408fc3f1c99d99fa532172793cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 28 Mar 2019 13:50:13 +0000 Subject: [PATCH] style: Fix ::marker invalidation when we need to potentially insert a marker as a result of a style change. Differential Revision: https://phabricator.services.mozilla.com/D24888 --- .../style/invalidation/element/invalidator.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/components/style/invalidation/element/invalidator.rs b/components/style/invalidation/element/invalidator.rs index 7ed97c0b197..371c0771183 100644 --- a/components/style/invalidation/element/invalidator.rs +++ b/components/style/invalidation/element/invalidator.rs @@ -750,8 +750,19 @@ where // // Note that we'll also restyle the pseudo-element because // it would match this invalidation. - if self.processor.invalidates_on_eager_pseudo_element() && pseudo.is_eager() { - invalidated_self = true; + if self.processor.invalidates_on_eager_pseudo_element() { + if pseudo.is_eager() { + invalidated_self = true; + } + // If we start or stop matching some marker rules, and + // don't have a marker, then we need to restyle the + // element to potentially create one. + // + // Same caveats as for other eager pseudos apply, this + // could be more fine-grained. + if pseudo.is_marker() && self.element.marker_pseudo_element().is_none() { + invalidated_self = true; + } } }