mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
style: Add telemetry for -moz-appearance usage.
Differential Revision: https://phabricator.services.mozilla.com/D77637
This commit is contained in:
parent
c578a82adc
commit
9b980e2f49
3 changed files with 32 additions and 1 deletions
|
@ -348,6 +348,21 @@ impl PropertyDeclarationBlock {
|
||||||
.find(|(declaration, _)| declaration.id() == property)
|
.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
|
/// Tries to serialize a given shorthand from the declarations in this
|
||||||
/// block.
|
/// block.
|
||||||
pub fn shorthand_to_css(
|
pub fn shorthand_to_css(
|
||||||
|
|
|
@ -627,6 +627,21 @@ ${helpers.predefined_type(
|
||||||
gecko_ffi_name="mAppearance",
|
gecko_ffi_name="mAppearance",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
// A UA-sheet only property that is always set to the same value as
|
||||||
|
// -moz-appearance. Used to record telemetry for when author sheets
|
||||||
|
// override the value of -moz-appearance; see
|
||||||
|
// nsIFrame::RecordAppearanceTelemetry.
|
||||||
|
${helpers.predefined_type(
|
||||||
|
"-moz-default-appearance",
|
||||||
|
"Appearance",
|
||||||
|
"computed::Appearance::None",
|
||||||
|
engines="gecko",
|
||||||
|
animation_value_type="none",
|
||||||
|
spec="Internal (not web-exposed)",
|
||||||
|
enabled_in="ua",
|
||||||
|
gecko_ffi_name="mDefaultAppearance",
|
||||||
|
)}
|
||||||
|
|
||||||
${helpers.single_keyword(
|
${helpers.single_keyword(
|
||||||
"-moz-orient",
|
"-moz-orient",
|
||||||
"inline block horizontal vertical",
|
"inline block horizontal vertical",
|
||||||
|
|
|
@ -2111,7 +2111,8 @@ impl PropertyId {
|
||||||
pub struct WideKeywordDeclaration {
|
pub struct WideKeywordDeclaration {
|
||||||
#[css(skip)]
|
#[css(skip)]
|
||||||
id: LonghandId,
|
id: LonghandId,
|
||||||
keyword: CSSWideKeyword,
|
/// The CSS-wide keyword.
|
||||||
|
pub keyword: CSSWideKeyword,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An unparsed declaration that contains `var()` functions.
|
/// An unparsed declaration that contains `var()` functions.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue