MutationObserver.webidl (2386B)
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 [ProbablyShortLivingWrapper, 11 Exposed=Window] 12 interface MutationRecord { 13 [Constant] 14 readonly attribute DOMString type; 15 // .target is not nullable per the spec, but in order to prevent crashes, 16 // if there are GC/CC bugs in Gecko, we let the property to be null. 17 [Constant] 18 readonly attribute Node? target; 19 [Constant] 20 readonly attribute NodeList addedNodes; 21 [Constant] 22 readonly attribute NodeList removedNodes; 23 [Constant] 24 readonly attribute Node? previousSibling; 25 [Constant] 26 readonly attribute Node? nextSibling; 27 [Constant] 28 readonly attribute DOMString? attributeName; 29 [Constant] 30 readonly attribute DOMString? attributeNamespace; 31 [Constant] 32 readonly attribute DOMString? oldValue; 33 [Constant, Cached, ChromeOnly] 34 readonly attribute sequence<Animation> addedAnimations; 35 [Constant, Cached, ChromeOnly] 36 readonly attribute sequence<Animation> changedAnimations; 37 [Constant, Cached, ChromeOnly] 38 readonly attribute sequence<Animation> removedAnimations; 39 }; 40 41 [Exposed=Window] 42 interface MutationObserver { 43 [Throws] 44 constructor(MutationCallback mutationCallback); 45 46 [Throws, NeedsSubjectPrincipal] 47 undefined observe(Node target, optional MutationObserverInit options = {}); 48 undefined disconnect(); 49 sequence<MutationRecord> takeRecords(); 50 51 [ChromeOnly, Throws] 52 sequence<MutationObservingInfo?> getObservingInfo(); 53 [ChromeOnly] 54 readonly attribute MutationCallback mutationCallback; 55 [ChromeOnly] 56 attribute boolean mergeAttributeRecords; 57 }; 58 59 callback MutationCallback = undefined (sequence<MutationRecord> mutations, MutationObserver observer); 60 61 dictionary MutationObserverInit { 62 boolean childList = false; 63 boolean attributes; 64 boolean characterData; 65 boolean subtree = false; 66 boolean attributeOldValue; 67 boolean characterDataOldValue; 68 [ChromeOnly] 69 boolean chromeOnlyNodes = false; 70 [ChromeOnly] 71 boolean animations = false; 72 sequence<DOMString> attributeFilter; 73 }; 74 75 dictionary MutationObservingInfo : MutationObserverInit 76 { 77 Node? observedNode = null; 78 };