Bug 708169. Warn when null or no argument is passed to mozRequestAnimationFrame. r=roc

This commit is contained in:
Boris Zbarsky 2011-12-15 08:53:06 -05:00
parent d7c7b61b9f
commit 98ad98b225
4 changed files with 6 additions and 1 deletions

View File

@ -75,3 +75,4 @@ DEPRECATED_OPERATION(Position)
DEPRECATED_OPERATION(TotalSize)
DEPRECATED_OPERATION(GlobalStorage)
DEPRECATED_OPERATION(InputEncoding)
DEPRECATED_OPERATION(MozBeforePaint)

View File

@ -3885,6 +3885,7 @@ nsGlobalWindow::MozRequestAnimationFrame(nsIFrameRequestCallback* aCallback,
}
if (!aCallback) {
mDoc->WarnOnceAbout(nsIDocument::eMozBeforePaint);
return NS_ERROR_XPC_BAD_CONVERT_JS;
}

View File

@ -417,8 +417,9 @@ interface nsIDOMWindow : nsISupports
*
* @see <http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html>
*/
// Argument is optional only so we can warn when it's null
long
mozRequestAnimationFrame(in nsIFrameRequestCallback aCallback);
mozRequestAnimationFrame([optional] in nsIFrameRequestCallback aCallback);
/**
* Cancel a refresh callback.

View File

@ -115,6 +115,8 @@ nsIJSONEncodeDeprecatedWarning=nsIJSON.encode is deprecated. Please use JSON.st
nsIDOMWindowInternalWarning=Use of nsIDOMWindowInternal is deprecated. Use nsIDOMWindow instead.
InputEncodingWarning=Use of inputEncoding is deprecated.
GlobalStorageWarning=Use of globalStorage is deprecated. Please use localStorage instead.
# LOCALIZATION NOTE: Do not translate "MozBeforePaint" and "mozRequestAnimationFrame"
MozBeforePaintWarning=MozBeforePaint events are no longer supported. mozRequestAnimationFrame must be passed a non-null callback argument.
FullScreenDeniedDisabled=Request for full-screen was denied because full-screen API is disabled by user preference.
FullScreenDeniedPlugins=Request for full-screen was denied because a document on this page contains a windowed plugin.
FullScreenDeniedHidden=Request for full-screen was denied because the document is no longer visible.