1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_TransitionEvent_h_
7 #define mozilla_dom_TransitionEvent_h_
8 
9 #include "mozilla/EventForwards.h"
10 #include "mozilla/dom/Event.h"
11 #include "mozilla/dom/TransitionEventBinding.h"
12 #include "nsStringFwd.h"
13 
14 namespace mozilla {
15 namespace dom {
16 
17 class TransitionEvent : public Event {
18  public:
19   TransitionEvent(EventTarget* aOwner, nsPresContext* aPresContext,
20                   InternalTransitionEvent* aEvent);
21 
22   NS_INLINE_DECL_REFCOUNTING_INHERITED(TransitionEvent, Event)
23 
24   static already_AddRefed<TransitionEvent> Constructor(
25       const GlobalObject& aGlobal, const nsAString& aType,
26       const TransitionEventInit& aParam);
27 
WrapObjectInternal(JSContext * aCx,JS::Handle<JSObject * > aGivenProto)28   virtual JSObject* WrapObjectInternal(
29       JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {
30     return TransitionEvent_Binding::Wrap(aCx, this, aGivenProto);
31   }
32 
33   void GetPropertyName(nsAString& aPropertyName) const;
34   void GetPseudoElement(nsAString& aPreudoElement) const;
35 
36   float ElapsedTime();
37 
38  protected:
39   ~TransitionEvent() = default;
40 };
41 
42 }  // namespace dom
43 }  // namespace mozilla
44 
45 already_AddRefed<mozilla::dom::TransitionEvent> NS_NewDOMTransitionEvent(
46     mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
47     mozilla::InternalTransitionEvent* aEvent);
48 
49 #endif  // mozilla_dom_TransitionEvent_h_
50