|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
4 * You can obtain one at http://mozilla.org/MPL/2.0/. |
|
5 * |
|
6 * The origin of this IDL file is |
|
7 * http://dom.spec.whatwg.org |
|
8 */ |
|
9 |
|
10 interface MutationRecord { |
|
11 [Constant] |
|
12 readonly attribute DOMString type; |
|
13 // .target is not nullable per the spec, but in order to prevent crashes, |
|
14 // if there are GC/CC bugs in Gecko, we let the property to be null. |
|
15 [Constant] |
|
16 readonly attribute Node? target; |
|
17 [Constant] |
|
18 readonly attribute NodeList addedNodes; |
|
19 [Constant] |
|
20 readonly attribute NodeList removedNodes; |
|
21 [Constant] |
|
22 readonly attribute Node? previousSibling; |
|
23 [Constant] |
|
24 readonly attribute Node? nextSibling; |
|
25 [Constant] |
|
26 readonly attribute DOMString? attributeName; |
|
27 [Constant] |
|
28 readonly attribute DOMString? attributeNamespace; |
|
29 [Constant] |
|
30 readonly attribute DOMString? oldValue; |
|
31 }; |
|
32 |
|
33 [Constructor(MutationCallback mutationCallback)] |
|
34 interface MutationObserver { |
|
35 [Throws] |
|
36 void observe(Node target, optional MutationObserverInit options); |
|
37 void disconnect(); |
|
38 sequence<MutationRecord> takeRecords(); |
|
39 |
|
40 [ChromeOnly] |
|
41 sequence<MutationObservingInfo?> getObservingInfo(); |
|
42 [ChromeOnly] |
|
43 readonly attribute MutationCallback mutationCallback; |
|
44 }; |
|
45 |
|
46 callback MutationCallback = void (sequence<MutationRecord> mutations, MutationObserver observer); |
|
47 |
|
48 dictionary MutationObserverInit { |
|
49 boolean childList = false; |
|
50 boolean attributes = false; |
|
51 boolean characterData = false; |
|
52 boolean subtree = false; |
|
53 boolean attributeOldValue = false; |
|
54 boolean characterDataOldValue = false; |
|
55 sequence<DOMString> attributeFilter; |
|
56 }; |
|
57 |
|
58 dictionary MutationObservingInfo : MutationObserverInit |
|
59 { |
|
60 Node? observedNode = null; |
|
61 }; |