Skip to content
Permalink
Browse files

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
  • Loading branch information...
emilio committed Sep 21, 2019
1 parent 7d23cfb commit a0e2aeb51c8c59f3aae098526d4b2496dfe62b14
Showing with 2 additions and 14 deletions.
  1. +2 −14 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.

0 comments on commit a0e2aeb

Please sign in to comment.
You can’t perform that action at this time.