/*
 * Copyright (C) 2006 Apple Computer, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

// Introduced in DOM Level 2:
interface MutationEvent : Event {

    // attrChangeType
    const unsigned short MODIFICATION = 1;
    const unsigned short ADDITION     = 2;
    const unsigned short REMOVAL      = 3;

    readonly attribute Node           relatedNode;
    readonly attribute DOMString      prevValue;
    readonly attribute DOMString      newValue;
    readonly attribute DOMString      attrName;
    readonly attribute unsigned short attrChange;

    [ObjCLegacyUnnamedParameters] void initMutationEvent([Default=Undefined] optional DOMString type, 
                                          [Default=Undefined] optional boolean canBubble, 
                                          [Default=Undefined] optional boolean cancelable, 
                                          [Default=Undefined] optional Node relatedNode, 
                                          [Default=Undefined] optional DOMString prevValue, 
                                          [Default=Undefined] optional DOMString newValue, 
                                          [Default=Undefined] optional DOMString attrName, 
                                          [Default=Undefined] optional unsigned short attrChange);

};

