Bug 909154. Remove the prefixed mozRequestAnimationFrame and its accoutrements. r=bkelly

This commit is contained in:
Boris Zbarsky 2015-07-20 10:14:24 -04:00
parent 5487ec884b
commit a435429163
16 changed files with 17 additions and 178 deletions

View File

@ -22,7 +22,6 @@ DEPRECATED_OPERATION(NodeValue)
DEPRECATED_OPERATION(TextContent)
DEPRECATED_OPERATION(EnablePrivilege)
DEPRECATED_OPERATION(InputEncoding)
DEPRECATED_OPERATION(MozBeforePaint)
DEPRECATED_OPERATION(DOMExceptionCode)
DEPRECATED_OPERATION(NoExposedProps)
DEPRECATED_OPERATION(MutationEvent)

View File

@ -1519,15 +1519,15 @@ void nsIDocument::SelectorCache::NotifyExpired(SelectorCacheKey* aSelector)
struct nsIDocument::FrameRequest
{
FrameRequest(const FrameRequestCallbackHolder& aCallback,
FrameRequest(FrameRequestCallback& aCallback,
int32_t aHandle) :
mCallback(aCallback),
mCallback(&aCallback),
mHandle(aHandle)
{}
// Conversion operator so that we can append these to a
// FrameRequestCallbackList
operator const FrameRequestCallbackHolder& () const {
operator const nsRefPtr<FrameRequestCallback>& () const {
return mCallback;
}
@ -1540,7 +1540,7 @@ struct nsIDocument::FrameRequest
return mHandle < aHandle;
}
FrameRequestCallbackHolder mCallback;
nsRefPtr<FrameRequestCallback> mCallback;
int32_t mHandle;
};
@ -2006,7 +2006,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
for (uint32_t i = 0; i < tmp->mFrameRequestCallbacks.Length(); ++i) {
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mFrameRequestCallbacks[i]");
cb.NoteXPCOMChild(tmp->mFrameRequestCallbacks[i].mCallback.GetISupports());
cb.NoteXPCOMChild(tmp->mFrameRequestCallbacks[i].mCallback);
}
// Traverse animation components
@ -10335,7 +10335,7 @@ nsIDocument::UnlinkOriginalDocumentIfStatic()
}
nsresult
nsIDocument::ScheduleFrameRequestCallback(const FrameRequestCallbackHolder& aCallback,
nsIDocument::ScheduleFrameRequestCallback(FrameRequestCallback& aCallback,
int32_t *aHandle)
{
if (mFrameRequestCallbackCounter == INT32_MAX) {

View File

@ -144,7 +144,6 @@
#include "nsMenuPopupFrame.h"
#endif
#include "mozilla/dom/CustomEvent.h"
#include "nsIFrameRequestCallback.h"
#include "nsIJARChannel.h"
#include "xpcprivate.h"
@ -5485,51 +5484,12 @@ nsGlobalWindow::GetMozPaintCount(uint64_t* aResult)
return rv.StealNSResult();
}
NS_IMETHODIMP
nsGlobalWindow::MozRequestAnimationFrame(nsIFrameRequestCallback* aCallback,
int32_t *aHandle)
{
FORWARD_TO_INNER(MozRequestAnimationFrame, (aCallback, aHandle), NS_ERROR_UNEXPECTED);
if (!aCallback) {
if (mDoc) {
mDoc->WarnOnceAbout(nsIDocument::eMozBeforePaint);
}
return NS_ERROR_XPC_BAD_CONVERT_JS;
}
ErrorResult rv;
nsIDocument::FrameRequestCallbackHolder holder(aCallback);
*aHandle = RequestAnimationFrame(holder, rv);
return rv.StealNSResult();
}
int32_t
nsGlobalWindow::RequestAnimationFrame(FrameRequestCallback& aCallback,
ErrorResult& aError)
{
MOZ_RELEASE_ASSERT(IsInnerWindow());
nsIDocument::FrameRequestCallbackHolder holder(&aCallback);
return RequestAnimationFrame(holder, aError);
}
int32_t
nsGlobalWindow::MozRequestAnimationFrame(nsIFrameRequestCallback* aCallback,
ErrorResult& aError)
{
MOZ_RELEASE_ASSERT(IsInnerWindow());
nsIDocument::FrameRequestCallbackHolder holder(aCallback);
return RequestAnimationFrame(holder, aError);
}
int32_t
nsGlobalWindow::RequestAnimationFrame(const nsIDocument::FrameRequestCallbackHolder& aCallback,
ErrorResult& aError)
{
MOZ_RELEASE_ASSERT(IsInnerWindow());
if (!mDoc) {
return 0;
}
@ -5563,20 +5523,6 @@ nsGlobalWindow::RequestAnimationFrame(JS::Handle<JS::Value> aCallback,
return rv.StealNSResult();
}
NS_IMETHODIMP
nsGlobalWindow::MozCancelRequestAnimationFrame(int32_t aHandle)
{
FORWARD_TO_INNER(MozCancelRequestAnimationFrame, (aHandle), NS_ERROR_UNEXPECTED);
return CancelAnimationFrame(aHandle);
}
NS_IMETHODIMP
nsGlobalWindow::MozCancelAnimationFrame(int32_t aHandle)
{
FORWARD_TO_INNER(MozCancelAnimationFrame, (aHandle), NS_ERROR_UNEXPECTED);
return CancelAnimationFrame(aHandle);
}
void
nsGlobalWindow::CancelAnimationFrame(int32_t aHandle, ErrorResult& aError)
{
@ -5600,34 +5546,6 @@ nsGlobalWindow::CancelAnimationFrame(int32_t aHandle)
return rv.StealNSResult();
}
int64_t
nsGlobalWindow::GetMozAnimationStartTime(ErrorResult& aError)
{
MOZ_RELEASE_ASSERT(IsInnerWindow());
if (mDoc) {
nsIPresShell* presShell = mDoc->GetShell();
if (presShell) {
return presShell->GetPresContext()->RefreshDriver()->
MostRecentRefreshEpochTime() / PR_USEC_PER_MSEC;
}
}
// If all else fails, just be compatible with Date.now()
return JS_Now() / PR_USEC_PER_MSEC;
}
NS_IMETHODIMP
nsGlobalWindow::GetMozAnimationStartTime(int64_t *aTime)
{
FORWARD_TO_INNER(GetMozAnimationStartTime, (aTime), NS_ERROR_UNEXPECTED);
ErrorResult rv;
*aTime = GetMozAnimationStartTime(rv);
return rv.StealNSResult();
}
already_AddRefed<MediaQueryList>
nsGlobalWindow::MatchMediaOuter(const nsAString& aMediaQueryList)
{

View File

@ -1066,18 +1066,6 @@ public:
GetDefaultComputedStyle(mozilla::dom::Element& aElt,
const nsAString& aPseudoElt,
mozilla::ErrorResult& aError);
int32_t MozRequestAnimationFrame(nsIFrameRequestCallback* aRequestCallback,
mozilla::ErrorResult& aError);
void MozCancelAnimationFrame(int32_t aHandle, mozilla::ErrorResult& aError)
{
return CancelAnimationFrame(aHandle, aError);
}
void MozCancelRequestAnimationFrame(int32_t aHandle,
mozilla::ErrorResult& aError)
{
return CancelAnimationFrame(aHandle, aError);
}
int64_t GetMozAnimationStartTime(mozilla::ErrorResult& aError);
void SizeToContentOuter(mozilla::ErrorResult& aError);
void SizeToContent(mozilla::ErrorResult& aError);
mozilla::dom::Crypto* GetCrypto(mozilla::ErrorResult& aError);
@ -1598,9 +1586,6 @@ protected:
// Returns device pixels. Outer windows only.
nsIntPoint GetScreenXY(mozilla::ErrorResult& aError);
int32_t RequestAnimationFrame(const nsIDocument::FrameRequestCallbackHolder& aCallback,
mozilla::ErrorResult& aError);
nsGlobalWindow* InnerForSetTimeoutOrInterval(mozilla::ErrorResult& aError);
void PostMessageMozOuter(JSContext* aCx, JS::Handle<JS::Value> aMessage,

View File

@ -2122,14 +2122,11 @@ public:
virtual mozilla::dom::DocumentTimeline* Timeline() = 0;
typedef mozilla::dom::CallbackObjectHolder<
mozilla::dom::FrameRequestCallback,
nsIFrameRequestCallback> FrameRequestCallbackHolder;
nsresult ScheduleFrameRequestCallback(const FrameRequestCallbackHolder& aCallback,
nsresult ScheduleFrameRequestCallback(mozilla::dom::FrameRequestCallback& aCallback,
int32_t *aHandle);
void CancelFrameRequestCallback(int32_t aHandle);
typedef nsTArray<FrameRequestCallbackHolder> FrameRequestCallbackList;
typedef nsTArray<nsRefPtr<mozilla::dom::FrameRequestCallback>> FrameRequestCallbackList;
/**
* Put this document's frame request callbacks into the provided
* list, and forget about them.

View File

@ -1923,8 +1923,6 @@ addExternalIface('imgIRequest', nativeType='imgIRequest', notflattened=True)
addExternalIface('MenuBuilder', nativeType='nsIMenuBuilder', notflattened=True)
addExternalIface('MozControllers', nativeType='nsIControllers')
addExternalIface('MozFrameLoader', nativeType='nsIFrameLoader', notflattened=True)
addExternalIface('MozFrameRequestCallback', nativeType='nsIFrameRequestCallback',
notflattened=True)
addExternalIface('MozMmsMessage')
addExternalIface('MozObserver', nativeType='nsIObserver', notflattened=True)
addExternalIface('MozRDFCompositeDataSource', nativeType='nsIRDFCompositeDataSource',

View File

@ -26,7 +26,6 @@ XPIDL_SOURCES += [
'nsIDOMWindowCollection.idl',
'nsIDOMWindowUtils.idl',
'nsIFocusManager.idl',
'nsIFrameRequestCallback.idl',
'nsIIdleObserver.idl',
'nsIQueryContentEventResult.idl',
'nsIRemoteBrowser.idl',

View File

@ -5,7 +5,6 @@
#include "domstubs.idl"
interface nsIFrameRequestCallback;
interface nsIControllers;
interface nsIDOMBlob;
interface nsIDOMLocation;
@ -23,7 +22,7 @@ interface nsIVariant;
* @see <http://www.whatwg.org/html/#window>
*/
[scriptable, uuid(8146f3fc-9fc1-47c5-85ef-95d686e4ca6d)]
[scriptable, uuid(7e26f1bd-a694-4b65-8d9d-9eead0645fe3)]
interface nsIDOMWindow : nsISupports
{
// the current browsing context
@ -457,9 +456,6 @@ 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([optional] in nsIFrameRequestCallback aCallback);
// jsval because we want a WebIDL callback here
[implicit_jscontext]
long requestAnimationFrame(in jsval aCallback);
@ -467,16 +463,8 @@ interface nsIDOMWindow : nsISupports
/**
* Cancel a refresh callback.
*/
void mozCancelAnimationFrame(in long aHandle);
// Backwards-compat shim for now to make Google maps work
void mozCancelRequestAnimationFrame(in long aHandle);
void cancelAnimationFrame(in long aHandle);
/**
* The current animation start time in milliseconds since the epoch.
*/
readonly attribute long long mozAnimationStartTime;
/**
* Console API
*/

View File

@ -1,18 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Interface that represents a callback to be passed to requestAnimationFrame
*/
#include "domstubs.idl"
[scriptable, function, uuid(e8d887f0-2ed7-406f-9f1d-edeb2c54c0a2)]
interface nsIFrameRequestCallback : nsISupports
{
/**
* The timestamp is the time to be used for the animation sample.
*/
void sample(in DOMTimeStamp timeStamp);
};

View File

@ -65,8 +65,6 @@ nsIJSONDecodeDeprecatedWarning=nsIJSON.decode is deprecated. Please use JSON.pa
nsIJSONEncodeDeprecatedWarning=nsIJSON.encode is deprecated. Please use JSON.stringify instead.
nsIDOMWindowInternalWarning=Use of nsIDOMWindowInternal is deprecated. Use nsIDOMWindow instead.
InputEncodingWarning=Use of inputEncoding is deprecated.
# LOCALIZATION NOTE: Do not translate "MozBeforePaint" and "mozRequestAnimationFrame"
MozBeforePaintWarning=MozBeforePaint events are no longer supported. mozRequestAnimationFrame must be passed a non-null callback argument.
FullScreenDeniedBlocked=Request for full-screen was denied because this domain has been blocked from full-screen by user.
FullScreenDeniedDisabled=Request for full-screen was denied because full-screen API is disabled by user preference.
FullScreenDeniedFocusedPlugin=Request for full-screen was denied because a windowed plugin is focused.

View File

@ -17,7 +17,6 @@
interface ApplicationCache;
interface IID;
interface MozFrameRequestCallback;
interface nsIBrowserDOMWindow;
interface nsIMessageBroadcaster;
interface nsIDOMCrypto;
@ -276,20 +275,6 @@ partial interface Window {
//[NewObject, Throws] CSSStyleDeclaration getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
[NewObject, Throws] CSSStyleDeclaration? getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
[Throws] long mozRequestAnimationFrame(MozFrameRequestCallback aCallback);
/**
* Cancel a refresh callback.
*/
[Throws] void mozCancelAnimationFrame(long aHandle);
// Backwards-compat shim for now to make Google maps work
[Throws] void mozCancelRequestAnimationFrame(long aHandle);
/**
* The current animation start time in milliseconds since the epoch.
*/
[Throws] readonly attribute long long mozAnimationStartTime;
// Mozilla extensions
/**
* Method for scrolling this window by a number of lines.

View File

@ -49,7 +49,6 @@
#include "RestyleManager.h"
#include "Layers.h"
#include "imgIContainer.h"
#include "nsIFrameRequestCallback.h"
#include "mozilla/dom/ScriptSettings.h"
#include "nsDocShell.h"
#include "nsISimpleEnumerator.h"
@ -1552,7 +1551,6 @@ nsRefreshDriver::RunFrameRequestCallbacks(int64_t aNowEpoch, TimeStamp aNowTime)
if (!frameRequestCallbacks.IsEmpty()) {
profiler_tracing("Paint", "Scripts", TRACING_INTERVAL_START);
int64_t eventTime = aNowEpoch / PR_USEC_PER_MSEC;
for (const DocumentFrameCallbacks& docCallbacks : frameRequestCallbacks) {
// XXXbz Bug 863140: GetInnerWindow can return the outer
// window in some cases.
@ -1565,15 +1563,10 @@ nsRefreshDriver::RunFrameRequestCallbacks(int64_t aNowEpoch, TimeStamp aNowTime)
}
// else window is partially torn down already
}
for (const nsIDocument::FrameRequestCallbackHolder& holder :
docCallbacks.mCallbacks) {
nsAutoMicroTask mt;
if (holder.HasWebIDLCallback()) {
ErrorResult ignored;
holder.GetWebIDLCallback()->Call(timeStamp, ignored);
} else {
holder.GetXPCOMCallback()->Sample(eventTime);
}
for (auto& callback : docCallbacks.mCallbacks) {
ErrorResult ignored;
callback->Call(timeStamp, ignored);
ignored.SuppressException();
}
}
profiler_tracing("Paint", "Scripts", TRACING_INTERVAL_END);

View File

@ -215,12 +215,12 @@ public:
}
/**
* Add a document for which we have nsIFrameRequestCallbacks
* Add a document for which we have FrameRequestCallbacks
*/
void ScheduleFrameRequestCallbacks(nsIDocument* aDocument);
/**
* Remove a document for which we have nsIFrameRequestCallbacks
* Remove a document for which we have FrameRequestCallbacks
*/
void RevokeFrameRequestCallbacks(nsIDocument* aDocument);

View File

@ -17,7 +17,7 @@
<content clickthrough="never">
<children/>
</content>
<implementation type="application/javascript" implements="nsIObserver, nsIDOMEventListener, nsIFrameRequestCallback, nsIMessageListener">
<implementation type="application/javascript" implements="nsIObserver, nsIDOMEventListener, nsIMessageListener">
<property name="autoscrollEnabled">
<getter>
<![CDATA[

View File

@ -19,8 +19,7 @@ const CANVAS_CONTEXTS = [
];
const ANIMATION_GENERATORS = [
"requestAnimationFrame",
"mozRequestAnimationFrame"
"requestAnimationFrame"
];
const LOOP_GENERATORS = [

View File

@ -65,8 +65,6 @@ nsIJSONDecodeDeprecatedWarning=nsIJSON.decode is deprecated. Please use JSON.par
nsIJSONEncodeDeprecatedWarning=nsIJSON.encode is deprecated. Please use JSON.stringify instead.
nsIDOMWindowInternalWarning=Use of nsIDOMWindowInternal is deprecated. Use nsIDOMWindow instead.
InputEncodingWarning=Use of inputEncoding is deprecated.
# LOCALIZATION NOTE: Do not translate "MozBeforePaint" and "mozRequestAnimationFrame"
MozBeforePaintWarning=MozBeforePaint events are no longer supported. mozRequestAnimationFrame must be passed a non-null callback argument.
FullScreenDeniedBlocked=Request for full-screen was denied because this domain has been blocked from full-screen by user.
FullScreenDeniedDisabled=Request for full-screen was denied because full-screen API is disabled by user preference.
FullScreenDeniedFocusedPlugin=Request for full-screen was denied because a windowed plugin is focused.