mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 1266066 - Add a console warning for attempts to preventDefault() from a passive listener. r=smaug
MozReview-Commit-ID: G1nzkUxMEuE
This commit is contained in:
parent
b867e298b4
commit
d671429ba2
@ -11,3 +11,4 @@
|
||||
*/
|
||||
|
||||
DOCUMENT_WARNING(IgnoringWillChangeOverBudget)
|
||||
DOCUMENT_WARNING(PreventDefaultFromPassiveListener)
|
||||
|
@ -521,6 +521,16 @@ Event::PreventDefaultInternal(bool aCalledByDefaultHandler)
|
||||
return;
|
||||
}
|
||||
if (mEvent->mFlags.mInPassiveListener) {
|
||||
nsCOMPtr<nsPIDOMWindowInner> win(do_QueryInterface(mOwner));
|
||||
if (win) {
|
||||
if (nsIDocument* doc = win->GetExtantDoc()) {
|
||||
nsString type;
|
||||
GetType(type);
|
||||
const char16_t* params[] = { type.get() };
|
||||
doc->WarnOnceAbout(nsIDocument::ePreventDefaultFromPassiveListener,
|
||||
false, params, ArrayLength(params));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -224,3 +224,5 @@ RewriteYoutubeEmbed=Rewriting old-style Youtube Flash embed (%S) to iframe embed
|
||||
RewriteYoutubeEmbedInvalidQuery=Rewriting old-style Youtube Flash embed (%S) to iframe embed (%S). Query was invalid and removed from URL. Please update page to use iframe instead of embed/object, if possible.
|
||||
# LOCALIZATION NOTE: Do not translate "ServiceWorker". %1$S is the ServiceWorker scope URL. %2$S is an error string.
|
||||
PushMessageDecryptionFailure=The ServiceWorker for scope ‘%1$S’ encountered an error decrypting a push message: ‘%2$S’. For help with encryption, please see https://developer.mozilla.org/en-US/docs/Web/API/Push_API/Using_the_Push_API#Encryption
|
||||
# LOCALIZATION NOTE: %1$S is the type of a DOM event. 'passive' is a literal parameter from the DOM spec.
|
||||
PreventDefaultFromPassiveListenerWarning=Ignoring ‘preventDefault()’ call on event of type ‘%1$S’ from a listener registered as ‘passive’.
|
||||
|
Loading…
Reference in New Issue
Block a user