inIDeepTreeWalker.idl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #include "nsISupports.idl"
  5. interface nsIDOMNode;
  6. interface nsIDOMNodeFilter;
  7. // Note: the iterator does not handle DOM mutations gracefully. So if
  8. // the underlying DOM we are iterating over is changed, the behavior
  9. // of the walker is undefined. (With the current implementation we
  10. // cache the siblings of the current node and this list is not updated
  11. // when a mutation occurs).
  12. [scriptable, uuid(6657e8eb-b646-48e7-993e-cfa6e96415b4)]
  13. interface inIDeepTreeWalker : nsISupports
  14. {
  15. attribute boolean showAnonymousContent;
  16. attribute boolean showSubDocuments;
  17. // By default the walker skips document nodes from the iteration,
  18. // by setting this flag to true this behavior can be altered.
  19. attribute boolean showDocumentsAsNodes;
  20. void init(in nsIDOMNode aRoot, in unsigned long aWhatToShow);
  21. // Methods and attributes from nsIDOMTreeWalker, which is not scriptable.
  22. // Note: normally parentNode cannot go further up on the tree once it reached
  23. // the root, but setting currentNode does not have this limitation. If currentNode
  24. // is set to a node that does not have the root as its ancestor the walk can be
  25. // continued from there, and once we reach a node that is 'under' the root, the
  26. // limitation for the parentNode will work again.
  27. readonly attribute nsIDOMNode root;
  28. readonly attribute unsigned long whatToShow;
  29. readonly attribute nsIDOMNodeFilter filter;
  30. attribute nsIDOMNode currentNode;
  31. nsIDOMNode parentNode();
  32. nsIDOMNode firstChild();
  33. nsIDOMNode lastChild();
  34. nsIDOMNode previousSibling();
  35. nsIDOMNode nextSibling();
  36. nsIDOMNode previousNode();
  37. nsIDOMNode nextNode();
  38. };