From 5b184f448b6da5b9ae00c0df6559f48849f6fa15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 14 Jun 2023 20:50:16 +0000 Subject: [PATCH] style: Fix style invalidation on layer rule insertion Layer insertion may change the order of styles, so we may need to fully invalidate. Without this change, bug 1838045 makes layer-statement-before-import.html fail. Differential Revision: https://phabricator.services.mozilla.com/D180929 --- components/style/invalidation/stylesheets.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/style/invalidation/stylesheets.rs b/components/style/invalidation/stylesheets.rs index 6326a15e61a..6ae67452dbd 100644 --- a/components/style/invalidation/stylesheets.rs +++ b/components/style/invalidation/stylesheets.rs @@ -548,12 +548,16 @@ impl StylesheetInvalidationSet { // It's not clear what handling changes for this correctly would // look like. }, + LayerStatement(..) => { + // Layer statement insertions might alter styling order, so we need to always + // invalidate fully. + return self.invalidate_fully(); + }, CounterStyle(..) | Page(..) | Property(..) | FontFeatureValues(..) | FontPaletteValues(..) | - LayerStatement(..) | FontFace(..) | Keyframes(..) | Container(..) |