inIDeepTreeWalker.idl (1683B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #include "nsISupports.idl" 6 7 webidl Node; 8 9 // Note: the iterator does not handle DOM mutations gracefully. So if 10 // the underlying DOM we are iterating over is changed, the behavior 11 // of the walker is undefined. (With the current implementation we 12 // cache the siblings of the current node and this list is not updated 13 // when a mutation occurs). 14 15 [scriptable, uuid(6657e8eb-b646-48e7-993e-cfa6e96415b4)] 16 interface inIDeepTreeWalker : nsISupports 17 { 18 attribute boolean showAnonymousContent; 19 attribute boolean showSubDocuments; 20 21 // By default the walker skips document nodes from the iteration, 22 // by setting this flag to true this behavior can be altered. 23 attribute boolean showDocumentsAsNodes; 24 25 void init(in Node aRoot); 26 27 // Methods and attributes that look like TreeWalker. 28 // Note: normally parentNode cannot go further up on the tree once it reached 29 // the root, but setting currentNode does not have this limitation. If currentNode 30 // is set to a node that does not have the root as its ancestor the walk can be 31 // continued from there, and once we reach a node that is 'under' the root, the 32 // limitation for the parentNode will work again. 33 readonly attribute Node root; 34 attribute Node currentNode; 35 36 Node parentNode(); 37 Node firstChild(); 38 Node lastChild(); 39 Node previousSibling(); 40 Node nextSibling(); 41 Node previousNode(); 42 Node nextNode(); 43 };