Bug 1688089 - Add use counters for 'overflow'/'underflow' event listeners. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D102646
This commit is contained in:
Mats Palmgren 2021-01-22 11:12:11 +00:00
Родитель 9ff5a5feb0
Коммит 3d6a897e41
2 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -78,6 +78,10 @@ custom onstart sets a <marquee> onstart event listener
custom onbounce sets a <marquee> onbounce event listener
custom onfinish sets a <marquee> onfinish event listener
// Element non-standard events
custom onoverflow sets an element onoverflow event listener
custom onunderflow sets an element onunderflow event listener
// JavaScript feature usage
custom JS_asmjs uses asm.js
custom JS_wasm uses WebAssembly

Просмотреть файл

@ -401,6 +401,18 @@ void EventListenerManager::AddEventListenerInternal(
if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
window->SetHasBeforeInputEventListenersForTelemetry();
}
} else if (aTypeAtom == nsGkAtoms::onoverflow) {
if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
if (Document* doc = window->GetExtantDoc()) {
doc->SetUseCounter(eUseCounter_custom_onoverflow);
}
}
} else if (aTypeAtom == nsGkAtoms::onunderflow) {
if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
if (Document* doc = window->GetExtantDoc()) {
doc->SetUseCounter(eUseCounter_custom_onunderflow);
}
}
}
if (IsApzAwareListener(listener)) {