From b8873f44aa0801e3b45e2664ac6f8b666036ed74 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Thu, 27 Jun 2019 07:22:22 +0000 Subject: [PATCH] style: Cache computed styles of scrollbar part anonymous content. Differential Revision: https://phabricator.services.mozilla.com/D33123 --- components/style/properties/properties.mako.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 72a194b0c2c..c4b0d9ece78 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -2836,6 +2836,19 @@ impl ComputedValues { pub fn resolve_color(&self, color: computed::Color) -> RGBA { color.to_rgba(self.get_inherited_text().clone_color()) } + + /// Returns which longhand properties have different values in the two + /// ComputedValues. + #[cfg(feature = "gecko_debug")] + pub fn differing_properties(&self, other: &ComputedValues) -> LonghandIdSet { + let mut set = LonghandIdSet::new(); + % for prop in data.longhands: + if self.clone_${prop.ident}() != other.clone_${prop.ident}() { + set.insert(LonghandId::${prop.camel_case}); + } + % endfor + set + } } #[cfg(feature = "servo")]