Bug 998246 part 3 - Add timeline member to Document interface; r=bz

This commit is contained in:
Brian Birtles 2014-05-13 16:22:12 +09:00
Родитель 497bd0ee3d
Коммит 248c1facd0
4 изменённых файлов: 26 добавлений и 9 удалений

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

@ -92,6 +92,7 @@ class ImageLoader;
} // namespace css
namespace dom {
class AnimationTimeline;
class Attr;
class CDATASection;
class Comment;
@ -1859,6 +1860,8 @@ public:
virtual already_AddRefed<mozilla::dom::UndoManager> GetUndoManager() = 0;
virtual mozilla::dom::AnimationTimeline* Timeline() = 0;
typedef mozilla::dom::CallbackObjectHolder<
mozilla::dom::FrameRequestCallback,
nsIFrameRequestCallback> FrameRequestCallbackHolder;

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

@ -191,6 +191,7 @@
#include "nsWrapperCacheInlines.h"
#include "nsSandboxFlags.h"
#include "nsIAppsService.h"
#include "mozilla/dom/AnimationTimeline.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/DocumentFragment.h"
#include "mozilla/dom/Event.h"
@ -1961,6 +1962,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCachedEncoder)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStateObjectCached)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mUndoManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAnimationTimeline)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTemplateContentsOwner)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChildrenCollection)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRegistry)
@ -2030,6 +2032,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOriginalDocument)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mCachedEncoder)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mUndoManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAnimationTimeline)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTemplateContentsOwner)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mChildrenCollection)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mRegistry)
@ -3131,6 +3134,16 @@ nsDocument::GetUndoManager()
return undoManager.forget();
}
AnimationTimeline*
nsDocument::Timeline()
{
if (!mAnimationTimeline) {
mAnimationTimeline = new AnimationTimeline(this);
}
return mAnimationTimeline;
}
/* Return true if the document is in the focused top-level window, and is an
* ancestor of the focused DOMWindow. */
NS_IMETHODIMP

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

@ -770,6 +770,8 @@ public:
virtual already_AddRefed<mozilla::dom::UndoManager> GetUndoManager() MOZ_OVERRIDE;
virtual mozilla::dom::AnimationTimeline* Timeline() MOZ_OVERRIDE;
virtual nsresult SetSubDocumentFor(Element* aContent,
nsIDocument* aSubDoc) MOZ_OVERRIDE;
virtual nsIDocument* GetSubDocumentFor(nsIContent* aContent) const MOZ_OVERRIDE;
@ -1635,6 +1637,8 @@ private:
nsRefPtr<mozilla::dom::UndoManager> mUndoManager;
nsRefPtr<mozilla::dom::AnimationTimeline> mAnimationTimeline;
enum ViewportType {
DisplayWidthHeight,
DisplayWidthHeightNoZoom,

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

@ -3,15 +3,6 @@
* 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/.
*
* The origin of this IDL file is:
* http://dom.spec.whatwg.org/#interface-document
* http://www.whatwg.org/specs/web-apps/current-work/#the-document-object
* http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#api
* http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions-to-the-document-interface
* http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html#sec-document-interface
* http://dev.w3.org/csswg/cssom/#extensions-to-the-document-interface
* http://dev.w3.org/csswg/cssom-view/#extensions-to-the-document-interface
*
* http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/core/nsIDOMDocument.idl
*/
@ -294,6 +285,12 @@ partial interface Document {
//(Not implemented)NodeList findAll(DOMString selectors, optional (Element or sequence<Node>)? refNodes);
};
// http://dev.w3.org/fxtf/web-animations/#extensions-to-the-document-interface
partial interface Document {
[Pref="dom.animations-api.core.enabled"]
readonly attribute AnimationTimeline timeline;
};
// Mozilla extensions of various sorts
partial interface Document {
// nsIDOMDocumentXBL. Wish we could make these [ChromeOnly], but