Revert "Issue #21 - Remove use counters telemetry"

This reverts commit 8ca9db6b65.
This commit is contained in:
roytam1 2022-04-27 16:25:00 +08:00
commit 92a1cc3139
45 changed files with 1128 additions and 36 deletions

View file

@ -681,12 +681,14 @@ nsCSSExpandedDataBlock::TransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
bool aIsImportant,
bool aOverrideImportant,
bool aMustCallValueAppended,
css::Declaration* aDeclaration)
css::Declaration* aDeclaration,
nsIDocument* aSheetDocument)
{
if (!nsCSSProps::IsShorthand(aPropID)) {
return DoTransferFromBlock(aFromBlock, aPropID,
aIsImportant, aOverrideImportant,
aMustCallValueAppended, aDeclaration);
aMustCallValueAppended, aDeclaration,
aSheetDocument);
}
// We can pass CSSEnabledState::eIgnore (here, and in ClearProperty
@ -698,7 +700,8 @@ nsCSSExpandedDataBlock::TransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aPropID, aEnabledState) {
changed |= DoTransferFromBlock(aFromBlock, *p,
aIsImportant, aOverrideImportant,
aMustCallValueAppended, aDeclaration);
aMustCallValueAppended, aDeclaration,
aSheetDocument);
}
return changed;
}
@ -709,7 +712,8 @@ nsCSSExpandedDataBlock::DoTransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
bool aIsImportant,
bool aOverrideImportant,
bool aMustCallValueAppended,
css::Declaration* aDeclaration)
css::Declaration* aDeclaration,
nsIDocument* aSheetDocument)
{
bool changed = false;
MOZ_ASSERT(aFromBlock.HasPropertyBit(aPropID), "oops");
@ -737,6 +741,13 @@ nsCSSExpandedDataBlock::DoTransferFromBlock(nsCSSExpandedDataBlock& aFromBlock,
aDeclaration->ValueAppended(aPropID);
}
if (aSheetDocument) {
UseCounter useCounter = nsCSSProps::UseCounterFor(aPropID);
if (useCounter != eUseCounter_UNKNOWN) {
aSheetDocument->SetDocumentAndPageUseCounter(useCounter);
}
}
SetPropertyBit(aPropID);
aFromBlock.ClearPropertyBit(aPropID);