View Javadoc
1   /*
2    * Copyright (c) 2002-2025 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * https://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.htmlunit.javascript.host.event;
16  
17  import static org.htmlunit.javascript.configuration.SupportedBrowser.FF_ESR;
18  
19  import org.htmlunit.corejs.javascript.ScriptableObject;
20  import org.htmlunit.javascript.JavaScriptEngine;
21  import org.htmlunit.javascript.configuration.JsxClass;
22  import org.htmlunit.javascript.configuration.JsxConstant;
23  import org.htmlunit.javascript.configuration.JsxConstructor;
24  
25  /**
26   * JavaScript object representing a Mutation Event.
27   * For general information on which properties and functions should be supported, see
28   * <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MutationEvent">
29   * DOM Level 2 Events</a>.
30   *
31   * @author Ahmed Ashour
32   * @author Ronald Brill
33   */
34  @JsxClass(value = FF_ESR, isJSObject = false)
35  public class MutationEvent extends Event {
36  
37      /** Modification. */
38      @JsxConstant
39      public static final int MODIFICATION = 1;
40  
41      /** Addition. */
42      @JsxConstant
43      public static final int ADDITION = 2;
44  
45      /** Removal. */
46      @JsxConstant
47      public static final int REMOVAL = 3;
48  
49      /**
50       * JavaScript constructor.
51       *
52       * @param type the event type
53       * @param details the event details (optional)
54       */
55      @Override
56      @JsxConstructor
57      public void jsConstructor(final String type, final ScriptableObject details) {
58          throw JavaScriptEngine.typeError("Illegal constructor call for MutationEvent");
59      }
60  }