Skip to content

Commit

Permalink
style: Let the CSS use counter prefs be independent.
Browse files Browse the repository at this point in the history
 * 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 Oct 9, 2019
1 parent 7d23cfb commit a0e2aeb
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions components/style/properties/properties.mako.rs
Expand Up @@ -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]
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a0e2aeb

Please sign in to comment.