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