From 5c0897c8eb6ef789dd14918b9b427935a244a847 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Thu, 25 May 2023 08:32:41 +0000 Subject: [PATCH] style: [css-properties-values-api] Share PropertyRule instance when cloning CssRule::Property Differential Revision: https://phabricator.services.mozilla.com/D178892 --- components/style/stylesheets/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/style/stylesheets/mod.rs b/components/style/stylesheets/mod.rs index c5d2ec8b8e8..5230ab63e94 100644 --- a/components/style/stylesheets/mod.rs +++ b/components/style/stylesheets/mod.rs @@ -556,8 +556,9 @@ impl DeepCloneWithLock for CssRule { )) }, CssRule::Property(ref arc) => { - let rule = arc.read_with(guard); - CssRule::Property(Arc::new(lock.wrap(rule.clone()))) + // @property rules are immutable, so we don't need any of the `Locked` + // shenanigans, actually, and can just share the rule. + CssRule::Property(arc.clone()) }, CssRule::Document(ref arc) => { let rule = arc.read_with(guard);