style: [css-properties-values-api] Share PropertyRule instance when cloning CssRule::Property

Differential Revision: https://phabricator.services.mozilla.com/D178892
This commit is contained in:
Zach Hoffman 2023-05-25 08:32:41 +00:00 committed by Martin Robinson
parent 48f2f475c6
commit 5c0897c8eb

View file

@ -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);