diff options
Diffstat (limited to 'Source/WebCore/dom/CompositionEvent.h')
-rw-r--r-- | Source/WebCore/dom/CompositionEvent.h | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/Source/WebCore/dom/CompositionEvent.h b/Source/WebCore/dom/CompositionEvent.h index 89f69703b..8ff02ec96 100644 --- a/Source/WebCore/dom/CompositionEvent.h +++ b/Source/WebCore/dom/CompositionEvent.h @@ -10,10 +10,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR @@ -24,52 +24,51 @@ * */ -#ifndef CompositionEvent_h -#define CompositionEvent_h +#pragma once #include "UIEvent.h" namespace WebCore { -struct CompositionEventInit : UIEventInit { - CompositionEventInit(); - - String data; -}; - -class CompositionEvent : public UIEvent { +class CompositionEvent final : public UIEvent { public: - static PassRefPtr<CompositionEvent> create() + static Ref<CompositionEvent> create(const AtomicString& type, DOMWindow* view, const String& data) { - return adoptRef(new CompositionEvent); + return adoptRef(*new CompositionEvent(type, view, data)); } - static PassRefPtr<CompositionEvent> create(const AtomicString& type, PassRefPtr<AbstractView> view, const String& data) + static Ref<CompositionEvent> createForBindings() { - return adoptRef(new CompositionEvent(type, view, data)); + return adoptRef(*new CompositionEvent); } - static PassRefPtr<CompositionEvent> create(const AtomicString& type, const CompositionEventInit& initializer) + struct Init : UIEventInit { + String data; + }; + + static Ref<CompositionEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No) { - return adoptRef(new CompositionEvent(type, initializer)); + return adoptRef(*new CompositionEvent(type, initializer, isTrusted)); } virtual ~CompositionEvent(); - void initCompositionEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, const String& data); + void initCompositionEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*, const String& data); String data() const { return m_data; } - virtual EventInterface eventInterface() const override; + EventInterface eventInterface() const override; private: CompositionEvent(); - CompositionEvent(const AtomicString& type, PassRefPtr<AbstractView>, const String&); - CompositionEvent(const AtomicString& type, const CompositionEventInit&); + CompositionEvent(const AtomicString& type, DOMWindow*, const String&); + CompositionEvent(const AtomicString& type, const Init&, IsTrusted); + + bool isCompositionEvent() const override; String m_data; }; } // namespace WebCore -#endif // CompositionEvent_h +SPECIALIZE_TYPE_TRAITS_EVENT(CompositionEvent) |