mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00
Bug 1578661 - Fix use counter test. r=boris
By reporting the properties in MappedAttrParser that we used to (the test relies on counting those), and by adjusting the histogram name to the new thing. Differential Revision: https://phabricator.services.mozilla.com/D44697 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
9c8ffa9e68
commit
1e858d2a04
@ -76,18 +76,18 @@ add_task(async function() {
|
||||
// check for properties here.
|
||||
await check_use_counter_img(
|
||||
"file_use_counter_svg_getElementById.svg",
|
||||
"PROPERTY_FILL"
|
||||
"CSS_PROPERTY_Fill"
|
||||
);
|
||||
await check_use_counter_img(
|
||||
"file_use_counter_svg_currentScale.svg",
|
||||
"PROPERTY_FILL"
|
||||
"CSS_PROPERTY_Fill"
|
||||
);
|
||||
|
||||
// Check that use counters are incremented by directly loading SVGs
|
||||
// that reference patterns defined in another SVG file.
|
||||
await check_use_counter_direct(
|
||||
"file_use_counter_svg_fill_pattern.svg",
|
||||
"PROPERTY_FILLOPACITY",
|
||||
"CSS_PROPERTY_FillOpacity",
|
||||
/*xfail=*/ true
|
||||
);
|
||||
|
||||
@ -95,7 +95,7 @@ add_task(async function() {
|
||||
// that reference patterns defined in the same file or in data: URLs.
|
||||
await check_use_counter_direct(
|
||||
"file_use_counter_svg_fill_pattern_internal.svg",
|
||||
"PROPERTY_FILLOPACITY"
|
||||
"CSS_PROPERTY_FillOpacity",
|
||||
);
|
||||
// data: URLs don't correctly propagate to their referring document yet.
|
||||
//yield check_use_counter_direct("file_use_counter_svg_fill_pattern_data.svg",
|
||||
|
@ -1126,6 +1126,15 @@ void MappedAttrParser::ParseMappedAttrValue(nsAtom* aMappedAttrName,
|
||||
mDecl->Raw(), propertyID, &value, false, data,
|
||||
ParsingMode::AllowUnitlessLength,
|
||||
mElement->OwnerDoc()->GetCompatibilityMode(), mLoader, {});
|
||||
|
||||
// TODO(emilio): If we want to record these from CSSOM more generally, we
|
||||
// can pass the document use counters down the FFI call. For now manually
|
||||
// count them for compat with the old code, which is used for testing.
|
||||
if (changed) {
|
||||
UseCounter useCounter = nsCSSProps::UseCounterFor(propertyID);
|
||||
MOZ_ASSERT(useCounter != eUseCounter_UNKNOWN);
|
||||
mElement->OwnerDoc()->SetUseCounter(useCounter);
|
||||
}
|
||||
return;
|
||||
}
|
||||
MOZ_ASSERT(aMappedAttrName == nsGkAtoms::lang,
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "nsCSSPropertyID.h"
|
||||
#include "nsStyleStructFwd.h"
|
||||
#include "nsCSSKeywords.h"
|
||||
#include "mozilla/UseCounter.h"
|
||||
#include "mozilla/CSSEnabledState.h"
|
||||
#include "mozilla/CSSPropFlags.h"
|
||||
#include "mozilla/EnumTypeTraits.h"
|
||||
@ -110,6 +111,14 @@ class nsCSSProps {
|
||||
// Same but for @font-face descriptors
|
||||
static nsCSSFontDesc LookupFontDesc(const nsAString& aProperty);
|
||||
|
||||
// The relevant invariants are asserted in Document.cpp
|
||||
static mozilla::UseCounter UseCounterFor(nsCSSPropertyID aProperty) {
|
||||
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_with_aliases,
|
||||
"out of range");
|
||||
return mozilla::UseCounter(size_t(mozilla::eUseCounter_FirstCSSProperty) +
|
||||
size_t(aProperty));
|
||||
}
|
||||
|
||||
// Given a property enum, get the string value
|
||||
//
|
||||
// This string is static.
|
||||
|
Loading…
x
Reference in New Issue
Block a user