From a0e2aeb51c8c59f3aae098526d4b2496dfe62b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 21 Sep 2019 12:18:39 +0000 Subject: [PATCH] style: Let the CSS use counter prefs be independent. * Let layout.css.use-counters.enabled be independent from the unimplemented property counters. * Always count in the style system (that is, always create Document::mStyleUseCounters), so that the warning from bug 1582374 works irrespective of these prefs. * Add a pref check to the SVGElement code path so that the prefs properly reflect whether the histograms end up being recorded or not. * Make the pref checks consistent (check both when reporting telemetry, not earlier). Differential Revision: https://phabricator.services.mozilla.com/D46633 --- components/style/properties/properties.mako.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 59a83c4f6c1..24dfe1c57b6 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -1821,16 +1821,6 @@ impl CountedUnknownProperty { } } -#[cfg(feature = "gecko")] -fn is_counted_unknown_use_counters_enabled() -> bool { - static_prefs::pref!("layout.css.use-counters-unimplemented.enabled") -} - -#[cfg(feature = "servo")] -fn is_counted_unknown_use_counters_enabled() -> bool { - false -} - impl PropertyId { /// Return the longhand id that this property id represents. #[inline] @@ -1890,10 +1880,8 @@ impl PropertyId { StaticId::LonghandAlias(id, alias) => PropertyId::LonghandAlias(id, alias), StaticId::ShorthandAlias(id, alias) => PropertyId::ShorthandAlias(id, alias), StaticId::CountedUnknown(unknown_prop) => { - if is_counted_unknown_use_counters_enabled() { - if let Some(counters) = use_counters { - counters.counted_unknown_properties.record(unknown_prop); - } + if let Some(counters) = use_counters { + counters.counted_unknown_properties.record(unknown_prop); } // Always return Err(()) because these aren't valid custom property names.