summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/OverflowEvent.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/OverflowEvent.h')
-rw-r--r--Source/WebCore/dom/OverflowEvent.h47
1 files changed, 22 insertions, 25 deletions
diff --git a/Source/WebCore/dom/OverflowEvent.h b/Source/WebCore/dom/OverflowEvent.h
index ab6ca4585..f2da99578 100644
--- a/Source/WebCore/dom/OverflowEvent.h
+++ b/Source/WebCore/dom/OverflowEvent.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
@@ -23,22 +23,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef OverflowEvent_h
-#define OverflowEvent_h
+#pragma once
#include "Event.h"
namespace WebCore {
-struct OverflowEventInit : public EventInit {
- OverflowEventInit();
-
- unsigned short orient;
- bool horizontalOverflow;
- bool verticalOverflow;
-};
-
-class OverflowEvent : public Event {
+class OverflowEvent final : public Event {
public:
enum orientType {
HORIZONTAL = 0,
@@ -46,37 +37,43 @@ public:
BOTH = 2
};
- static PassRefPtr<OverflowEvent> create()
+ static Ref<OverflowEvent> create(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow)
{
- return adoptRef(new OverflowEvent);
+ return adoptRef(*new OverflowEvent(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow));
}
- static PassRefPtr<OverflowEvent> create(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow)
+
+ static Ref<OverflowEvent> createForBindings()
{
- return adoptRef(new OverflowEvent(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow));
+ return adoptRef(*new OverflowEvent);
}
- static PassRefPtr<OverflowEvent> create(const AtomicString& type, const OverflowEventInit& initializer)
+
+ struct Init : EventInit {
+ unsigned short orient { 0 };
+ bool horizontalOverflow { false };
+ bool verticalOverflow { false };
+ };
+
+ static Ref<OverflowEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
{
- return adoptRef(new OverflowEvent(type, initializer));
+ return adoptRef(*new OverflowEvent(type, initializer, isTrusted));
}
- void initOverflowEvent(unsigned short orient, bool horizontalOverflow, bool verticalOverflow);
+ WEBCORE_EXPORT void initOverflowEvent(unsigned short orient, bool horizontalOverflow, bool verticalOverflow);
unsigned short orient() const { return m_orient; }
bool horizontalOverflow() const { return m_horizontalOverflow; }
bool verticalOverflow() const { return m_verticalOverflow; }
- virtual EventInterface eventInterface() const override;
+ EventInterface eventInterface() const override;
private:
OverflowEvent();
OverflowEvent(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow);
- OverflowEvent(const AtomicString&, const OverflowEventInit&);
+ OverflowEvent(const AtomicString&, const Init&, IsTrusted);
unsigned short m_orient;
bool m_horizontalOverflow;
bool m_verticalOverflow;
};
-}
-
-#endif // OverflowEvent_h
+} // namespace WebCore