style: Add telemetry for -moz-appearance usage.

Differential Revision: https://phabricator.services.mozilla.com/D77637
This commit is contained in:
Cameron McCormack 2020-06-05 00:39:50 +00:00 committed by Emilio Cobos Álvarez
parent c578a82adc
commit 9b980e2f49
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
3 changed files with 32 additions and 1 deletions

View file

@ -348,6 +348,21 @@ impl PropertyDeclarationBlock {
.find(|(declaration, _)| declaration.id() == property)
}
/// Get a declaration for a given property with the specified importance.
#[inline]
pub fn get_at_importance(
&self,
property: PropertyDeclarationId,
importance: Importance,
) -> Option<&PropertyDeclaration> {
let (declaration, i) = self.get(property)?;
if i == importance {
Some(declaration)
} else {
None
}
}
/// Tries to serialize a given shorthand from the declarations in this
/// block.
pub fn shorthand_to_css(