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
This commit is contained in:
Emilio Cobos Álvarez 2019-09-21 12:18:39 +00:00
parent 7d23cfb91e
commit a0e2aeb51c

View file

@ -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.