Bug 1688354 [wpt PR 27298] - Treat 'rem' as an absolute unit for font size, a=testonly
[gecko.git] / dom / vr / VRDisplayEvent.h
blob3439833b6638007b48378ef9c41c935eb7ec37d7
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_VRDisplayEvent_h_
8 #define mozilla_dom_VRDisplayEvent_h_
10 #include "js/RootingAPI.h"
11 #include "mozilla/AlreadyAddRefed.h"
12 #include "mozilla/Assertions.h"
13 #include "mozilla/Maybe.h"
14 #include "mozilla/RefPtr.h"
15 #include "mozilla/dom/Event.h"
16 #include "mozilla/dom/Nullable.h"
17 #include "mozilla/dom/VRDisplay.h"
18 #include "mozilla/dom/VRDisplayEventBinding.h"
19 #include "nsCycleCollectionParticipant.h"
20 #include "nsISupports.h"
21 #include "nsStringFwd.h"
23 struct JSContext;
25 namespace mozilla {
26 namespace gfx {
27 class VRDisplay;
28 } // namespace gfx
30 namespace dom {
32 class VRDisplayEvent final : public Event {
33 public:
34 NS_DECL_ISUPPORTS_INHERITED
35 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(VRDisplayEvent, Event)
37 VRDisplay* Display();
38 Nullable<VRDisplayEventReason> GetReason() const;
40 protected:
41 virtual ~VRDisplayEvent() = default;
42 explicit VRDisplayEvent(mozilla::dom::EventTarget* aOwner);
43 VRDisplayEvent(EventTarget* aOwner, nsPresContext* aPresContext,
44 InternalClipboardEvent* aEvent);
46 Maybe<VRDisplayEventReason> mReason;
47 RefPtr<VRDisplay> mDisplay;
49 public:
50 virtual JSObject* WrapObjectInternal(
51 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
53 static already_AddRefed<VRDisplayEvent> Constructor(
54 mozilla::dom::EventTarget* aOwner, const nsAString& aType,
55 const VRDisplayEventInit& aEventInitDict);
57 static already_AddRefed<VRDisplayEvent> Constructor(
58 const GlobalObject& aGlobal, const nsAString& aType,
59 const VRDisplayEventInit& aEventInitDict);
62 } // namespace dom
63 } // namespace mozilla
65 #endif