1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/MutationObserver.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,61 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + * 1.9 + * The origin of this IDL file is 1.10 + * http://dom.spec.whatwg.org 1.11 + */ 1.12 + 1.13 +interface MutationRecord { 1.14 + [Constant] 1.15 + readonly attribute DOMString type; 1.16 + // .target is not nullable per the spec, but in order to prevent crashes, 1.17 + // if there are GC/CC bugs in Gecko, we let the property to be null. 1.18 + [Constant] 1.19 + readonly attribute Node? target; 1.20 + [Constant] 1.21 + readonly attribute NodeList addedNodes; 1.22 + [Constant] 1.23 + readonly attribute NodeList removedNodes; 1.24 + [Constant] 1.25 + readonly attribute Node? previousSibling; 1.26 + [Constant] 1.27 + readonly attribute Node? nextSibling; 1.28 + [Constant] 1.29 + readonly attribute DOMString? attributeName; 1.30 + [Constant] 1.31 + readonly attribute DOMString? attributeNamespace; 1.32 + [Constant] 1.33 + readonly attribute DOMString? oldValue; 1.34 +}; 1.35 + 1.36 +[Constructor(MutationCallback mutationCallback)] 1.37 +interface MutationObserver { 1.38 + [Throws] 1.39 + void observe(Node target, optional MutationObserverInit options); 1.40 + void disconnect(); 1.41 + sequence<MutationRecord> takeRecords(); 1.42 + 1.43 + [ChromeOnly] 1.44 + sequence<MutationObservingInfo?> getObservingInfo(); 1.45 + [ChromeOnly] 1.46 + readonly attribute MutationCallback mutationCallback; 1.47 +}; 1.48 + 1.49 +callback MutationCallback = void (sequence<MutationRecord> mutations, MutationObserver observer); 1.50 + 1.51 +dictionary MutationObserverInit { 1.52 + boolean childList = false; 1.53 + boolean attributes = false; 1.54 + boolean characterData = false; 1.55 + boolean subtree = false; 1.56 + boolean attributeOldValue = false; 1.57 + boolean characterDataOldValue = false; 1.58 + sequence<DOMString> attributeFilter; 1.59 +}; 1.60 + 1.61 +dictionary MutationObservingInfo : MutationObserverInit 1.62 +{ 1.63 + Node? observedNode = null; 1.64 +};