darin@apple.com | 48ac3c4 | 2008-06-14 08:46:51 +0000 | [diff] [blame] | 1 | /* |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 2 | * 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.com | 48ac3c4 | 2008-06-14 08:46:51 +0000 | [diff] [blame] | 5 | * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 6 | * |
| 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 |
ddkilzer | c8eccec | 2007-09-26 02:29:57 +0000 | [diff] [blame] | 19 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 | * Boston, MA 02110-1301, USA. |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 21 | */ |
| 22 | |
| 23 | #include "config.h" |
| 24 | #include "MutationEvent.h" |
| 25 | |
ysuzuki@apple.com | e407070 | 2019-09-18 22:10:00 +0000 | [diff] [blame] | 26 | #include <wtf/IsoMallocInlines.h> |
| 27 | |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 28 | namespace WebCore { |
| 29 | |
ysuzuki@apple.com | e407070 | 2019-09-18 22:10:00 +0000 | [diff] [blame] | 30 | WTF_MAKE_ISO_ALLOCATED_IMPL(MutationEvent); |
| 31 | |
darin@apple.com | 0ce67df | 2019-06-17 01:48:13 +0000 | [diff] [blame] | 32 | MutationEvent::MutationEvent(const AtomString& type, CanBubble canBubble, IsCancelable cancelable, Node* relatedNode, const String& prevValue, const String& newValue) |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 33 | : Event(type, canBubble, cancelable) |
| 34 | , m_relatedNode(relatedNode) |
andersca | 1326dc0 | 2006-10-08 00:44:23 +0000 | [diff] [blame] | 35 | , m_prevValue(prevValue) |
| 36 | , m_newValue(newValue) |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 37 | { |
| 38 | } |
| 39 | |
darin@apple.com | 0ce67df | 2019-06-17 01:48:13 +0000 | [diff] [blame] | 40 | void MutationEvent::initMutationEvent(const AtomString& type, bool canBubble, bool cancelable, Node* relatedNode, const String& prevValue, const String& newValue, const String& attrName, unsigned short attrChange) |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 41 | { |
cdumez@apple.com | 963f3bc | 2016-08-10 14:49:20 +0000 | [diff] [blame] | 42 | if (isBeingDispatched()) |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 43 | return; |
| 44 | |
| 45 | initEvent(type, canBubble, cancelable); |
| 46 | |
| 47 | m_relatedNode = relatedNode; |
andersca | 1326dc0 | 2006-10-08 00:44:23 +0000 | [diff] [blame] | 48 | m_prevValue = prevValue; |
| 49 | m_newValue = newValue; |
| 50 | m_attrName = attrName; |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 51 | m_attrChange = attrChange; |
| 52 | } |
| 53 | |
weinig@apple.com | d2bf649 | 2013-09-22 04:15:10 +0000 | [diff] [blame] | 54 | EventInterface MutationEvent::eventInterface() const |
abarth@webkit.org | 090fa4b | 2011-10-21 00:00:37 +0000 | [diff] [blame] | 55 | { |
weinig@apple.com | d2bf649 | 2013-09-22 04:15:10 +0000 | [diff] [blame] | 56 | return MutationEventInterfaceType; |
abarth@webkit.org | 090fa4b | 2011-10-21 00:00:37 +0000 | [diff] [blame] | 57 | } |
| 58 | |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 59 | } // namespace WebCore |