blob: 43500fdb56722eb7e3776fc8177f711447b25ac7 [file] [log] [blame]
darin@apple.com48ac3c42008-06-14 08:46:51 +00001/*
weinig681a5172006-06-19 22:58:36 +00002 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
darin@apple.com48ac3c42008-06-14 08:46:51 +00005 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved.
weinig681a5172006-06-19 22:58:36 +00006 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
ddkilzerc8eccec2007-09-26 02:29:57 +000019 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
weinig681a5172006-06-19 22:58:36 +000021 */
22
23#include "config.h"
24#include "MutationEvent.h"
25
ysuzuki@apple.come4070702019-09-18 22:10:00 +000026#include <wtf/IsoMallocInlines.h>
27
weinig681a5172006-06-19 22:58:36 +000028namespace WebCore {
29
ysuzuki@apple.come4070702019-09-18 22:10:00 +000030WTF_MAKE_ISO_ALLOCATED_IMPL(MutationEvent);
31
darin@apple.com0ce67df2019-06-17 01:48:13 +000032MutationEvent::MutationEvent(const AtomString& type, CanBubble canBubble, IsCancelable cancelable, Node* relatedNode, const String& prevValue, const String& newValue)
weinig681a5172006-06-19 22:58:36 +000033 : Event(type, canBubble, cancelable)
34 , m_relatedNode(relatedNode)
andersca1326dc02006-10-08 00:44:23 +000035 , m_prevValue(prevValue)
36 , m_newValue(newValue)
weinig681a5172006-06-19 22:58:36 +000037{
38}
39
darin@apple.com0ce67df2019-06-17 01:48:13 +000040void MutationEvent::initMutationEvent(const AtomString& type, bool canBubble, bool cancelable, Node* relatedNode, const String& prevValue, const String& newValue, const String& attrName, unsigned short attrChange)
weinig681a5172006-06-19 22:58:36 +000041{
cdumez@apple.com963f3bc2016-08-10 14:49:20 +000042 if (isBeingDispatched())
weinig681a5172006-06-19 22:58:36 +000043 return;
44
45 initEvent(type, canBubble, cancelable);
46
47 m_relatedNode = relatedNode;
andersca1326dc02006-10-08 00:44:23 +000048 m_prevValue = prevValue;
49 m_newValue = newValue;
50 m_attrName = attrName;
weinig681a5172006-06-19 22:58:36 +000051 m_attrChange = attrChange;
52}
53
weinig@apple.comd2bf6492013-09-22 04:15:10 +000054EventInterface MutationEvent::eventInterface() const
abarth@webkit.org090fa4b2011-10-21 00:00:37 +000055{
weinig@apple.comd2bf6492013-09-22 04:15:10 +000056 return MutationEventInterfaceType;
abarth@webkit.org090fa4b2011-10-21 00:00:37 +000057}
58
weinig681a5172006-06-19 22:58:36 +000059} // namespace WebCore