Implementation:SeleniumHQ Selenium Closure Dom TagIterator
| Knowledge Sources | |
|---|---|
| Domains | JavaScript_Atoms, Vendored_Library |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Vendored Google Closure Library module providing a DOM tree traversal iterator used by Selenium JavaScript atoms.
Description
goog.dom.TagIterator is a vendored copy of the Google Closure Library module. It provides an iterator subclass for DOM tree traversal that walks the DOM in order, reporting events for the start and end of Elements and the presence of text nodes. It defines TagWalkType (START_TAG, OTHER, END_TAG) to classify each position in the traversal. The iterator supports forward and reverse traversal, constrained and unconstrained modes, and tracks traversal depth. Selenium uses this as part of its JavaScript atom infrastructure for browser automation commands.
Usage
This module is consumed internally by Selenium's JavaScript atoms build system. It is not imported directly by end users.
Code Reference
Source Location
- Repository: SeleniumHQ_Selenium
- File: third_party/closure/goog/dom/tagiterator.js
- Lines: 1-364
Key Exports
goog.provide('goog.dom.TagIterator');
goog.provide('goog.dom.TagWalkType');
// TagWalkType enum:
goog.dom.TagWalkType = {
START_TAG: 1,
OTHER: 0,
END_TAG: -1
};
// TagIterator constructor:
goog.dom.TagIterator(opt_node, opt_reversed, opt_unconstrained, opt_tagType, opt_depth)
// Extends goog.iter.Iterator