summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/MutationEvent.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/MutationEvent.h')
-rw-r--r--Source/WebCore/dom/MutationEvent.h74
1 files changed, 32 insertions, 42 deletions
diff --git a/Source/WebCore/dom/MutationEvent.h b/Source/WebCore/dom/MutationEvent.h
index cbd360090..f48e855ad 100644
--- a/Source/WebCore/dom/MutationEvent.h
+++ b/Source/WebCore/dom/MutationEvent.h
@@ -21,60 +21,50 @@
*
*/
-#ifndef MutationEvent_h
-#define MutationEvent_h
+#pragma once
#include "Event.h"
#include "Node.h"
namespace WebCore {
- class MutationEvent : public Event {
- public:
- virtual ~MutationEvent();
-
- enum attrChangeType {
- MODIFICATION = 1,
- ADDITION = 2,
- REMOVAL = 3
- };
+class MutationEvent final : public Event {
+public:
+ enum {
+ MODIFICATION = 1,
+ ADDITION = 2,
+ REMOVAL = 3
+ };
- static PassRefPtr<MutationEvent> create()
- {
- return adoptRef(new MutationEvent);
- }
+ static Ref<MutationEvent> create(const AtomicString& type, bool canBubble, Node* relatedNode = nullptr, const String& prevValue = String(), const String& newValue = String())
+ {
+ return adoptRef(*new MutationEvent(type, canBubble, false, relatedNode, prevValue, newValue));
+ }
- static PassRefPtr<MutationEvent> create(const AtomicString& type, bool canBubble, PassRefPtr<Node> relatedNode = 0,
- const String& prevValue = String(), const String& newValue = String(), const String& attrName = String(), unsigned short attrChange = 0)
- {
- return adoptRef(new MutationEvent(type, canBubble, false, relatedNode, prevValue, newValue, attrName, attrChange));
- }
+ static Ref<MutationEvent> createForBindings()
+ {
+ return adoptRef(*new MutationEvent);
+ }
- void initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
- const String& prevValue, const String& newValue,
- const String& attrName, unsigned short attrChange);
+ WEBCORE_EXPORT void initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode, const String& prevValue, const String& newValue, const String& attrName, unsigned short attrChange);
- Node* relatedNode() const { return m_relatedNode.get(); }
- String prevValue() const { return m_prevValue; }
- String newValue() const { return m_newValue; }
- String attrName() const { return m_attrName; }
- unsigned short attrChange() const { return m_attrChange; }
+ Node* relatedNode() const { return m_relatedNode.get(); }
+ String prevValue() const { return m_prevValue; }
+ String newValue() const { return m_newValue; }
+ String attrName() const { return m_attrName; }
+ unsigned short attrChange() const { return m_attrChange; }
- virtual EventInterface eventInterface() const override;
+private:
+ MutationEvent() = default;
+ MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, Node* relatedNode, const String& prevValue, const String& newValue);
- private:
- MutationEvent();
- MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
- const String& prevValue, const String& newValue,
- const String& attrName, unsigned short attrChange);
+ EventInterface eventInterface() const final;
- RefPtr<Node> m_relatedNode;
- String m_prevValue;
- String m_newValue;
- String m_attrName;
- unsigned short m_attrChange;
- };
+ RefPtr<Node> m_relatedNode;
+ String m_prevValue;
+ String m_newValue;
+ String m_attrName;
+ unsigned short m_attrChange { 0 };
+};
} // namespace WebCore
-
-#endif // MutationEvent_h