style: Hook the use counters into StyleSheet parsing.

Still not hooked into telemetry, I talked with :janerik and :gfritzsche about
that, but test incoming!

This intentionally doesn't handle CSSOM and such for now, will file followups
for those, though should be trivial.

I want to unify / clean up how we do the use counters and the error reporting
stuff for CSSOM, since the current function call still shows up in profiles,
but that should be a follow-up.

Differential Revision: https://phabricator.services.mozilla.com/D3828
This commit is contained in:
Emilio Cobos Álvarez 2018-08-20 19:03:11 +02:00
parent c8e5b7f1b0
commit 89b8f30737
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
8 changed files with 25 additions and 1 deletions

View file

@ -68,6 +68,7 @@ impl<'a> ParserContext<'a> {
parsing_mode: ParsingMode,
quirks_mode: QuirksMode,
error_reporter: Option<&'a ParseErrorReporter>,
use_counters: Option<&'a UseCounters>,
) -> Self {
Self {
stylesheet_origin,
@ -77,7 +78,7 @@ impl<'a> ParserContext<'a> {
quirks_mode,
error_reporter,
namespaces: None,
use_counters: None,
use_counters,
}
}
@ -89,6 +90,7 @@ impl<'a> ParserContext<'a> {
parsing_mode: ParsingMode,
quirks_mode: QuirksMode,
error_reporter: Option<&'a ParseErrorReporter>,
use_counters: Option<&'a UseCounters>,
) -> Self {
Self::new(
Origin::Author,
@ -97,6 +99,7 @@ impl<'a> ParserContext<'a> {
parsing_mode,
quirks_mode,
error_reporter,
use_counters,
)
}