Bug 1688354 [wpt PR 27298] - Treat 'rem' as an absolute unit for font size, a=testonly
[gecko.git] / dom / events / CustomEvent.h
blob31abf33dc32faed3eaf9ed99c642beb9cae57837
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/. */
7 #ifndef CustomEvent_h__
8 #define CustomEvent_h__
10 #include "js/Value.h"
11 #include "mozilla/dom/Event.h"
13 namespace mozilla {
14 namespace dom {
16 struct CustomEventInit;
18 class CustomEvent final : public Event {
19 private:
20 virtual ~CustomEvent();
22 JS::Heap<JS::Value> mDetail;
24 public:
25 explicit CustomEvent(mozilla::dom::EventTarget* aOwner,
26 nsPresContext* aPresContext = nullptr,
27 mozilla::WidgetEvent* aEvent = nullptr);
29 NS_DECL_ISUPPORTS_INHERITED
30 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(CustomEvent, Event)
32 static already_AddRefed<CustomEvent> Constructor(
33 const GlobalObject& aGlobal, const nsAString& aType,
34 const CustomEventInit& aParam);
36 virtual JSObject* WrapObjectInternal(
37 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
39 CustomEvent* AsCustomEvent() override { return this; }
41 void GetDetail(JSContext* aCx, JS::MutableHandle<JS::Value> aRetval);
43 void InitCustomEvent(JSContext* aCx, const nsAString& aType, bool aCanBubble,
44 bool aCancelable, JS::Handle<JS::Value> aDetail);
47 } // namespace dom
48 } // namespace mozilla
50 already_AddRefed<mozilla::dom::CustomEvent> NS_NewDOMCustomEvent(
51 mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
52 mozilla::WidgetEvent* aEvent);
54 #endif // CustomEvent_h__