Spec-Zone.ru › Haxe JavaScript

NodeIterator

package js.html

Доступно в js

Интерфейс NodeIterator представляет собой итератор по элементам списка узлов в поддереве DOM. Узлы будут возвращаться в порядке документа.

Документация NodeIterator от Mozilla Contributors, лицензирована по CC-BY-SA 2.5.

См. также:

  • https://developer.mozilla.org/en-US/docs/Web/API/NodeIterator

Переменные

read onlyfilter:EitherType<Node ‑> Int, NodeFilter>

Возвращает NodeFilter для выбора соответствующих узлов.

read onlypointerBeforeReferenceNode:Bool

Возвращает Boolean флаг, указывающий, привязан ли NodeIterator перед узлом-якорем (флаг true) или после него (флаг false).

read onlyreferenceNode:Node

Возвращает узел-якорь, к которому привязан итератор.

read onlyroot:Node

Возвращает Node корневой узел, указанный при создании NodeIterator.

read onlywhatToShow:Int

Возвращает unsigned long, являющийся маской битов, состоящей из констант, описывающих типы Node, которые должны быть представлены. Несоответствующие узлы пропускаются, но их дочерние элементы могут быть включены, если это необходимо. Возможные значения:

	<tr>
		<td class="header">Constant</td>
		<td class="header">Numerical value</td>
		<td class="header">Description</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_ALL</code></td>
		<td><code>-1</code> (that is the max value of <code>unsigned long</code>)</td>
		<td>Shows all nodes.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_ATTRIBUTE</code> <em>(deprecated)</em></td>
		<td><code>2</code></td>
		<td>Shows attribute <code>Attr</code> nodes. This is meaningful only when creating a <code>NodeIterator</code> with an <code>Attr</code> node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. Since attributes are never children of other nodes, they do not appear when traversing over the document tree.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_CDATA_SECTION</code> <em>(deprecated)</em></td>
		<td><code>8</code></td>
		<td>Shows <code>CDATASection</code> nodes.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_COMMENT</code></td>
		<td><code>128</code></td>
		<td>Shows <code>Comment</code> nodes.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_DOCUMENT</code></td>
		<td><code>256</code></td>
		<td>Shows <code>Document</code> nodes.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_DOCUMENT_FRAGMENT</code></td>
		<td><code>1024</code></td>
		<td>Shows <code>DocumentFragment</code> nodes.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_DOCUMENT_TYPE</code></td>
		<td><code>512</code></td>
		<td>Shows <code>DocumentType</code> nodes.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_ELEMENT</code></td>
		<td><code>1</code></td>
		<td>Shows <code>Element</code> nodes.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_ENTITY</code> <em>(deprecated)</em></td>
		<td><code>32</code></td>
		<td>Shows <code>Entity</code> nodes. This is meaningful only when creating a <code>NodeIterator</code> with an <code>Entity</code> node as its root; in this case, it means that the <code>Entity</code> node will appear in the first position of the traversal. Since entities are not part of the document tree, they do not appear when traversing over the document tree.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_ENTITY_REFERENCE</code> <em>(deprecated)</em></td>
		<td><code>16</code></td>
		<td>Shows <code>EntityReference</code> nodes.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_NOTATION</code> <em>(deprecated)</em></td>
		<td><code>2048</code></td>
		<td>Shows <code>Notation</code> nodes. This is meaningful only when creating a <code>NodeIterator</code> with a <code>Notation</code> node as its root; in this case, it means that the <code>Notation</code> node will appear in the first position of the traversal. Since entities are not part of the document tree, they do not appear when traversing over the document tree.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_PROCESSING_INSTRUCTION</code></td>
		<td><code>64</code></td>
		<td>Shows <code>ProcessingInstruction</code> nodes.</td>
	</tr>
	<tr>
		<td><code>NodeFilter.SHOW_TEXT</code></td>
		<td><code>4</code></td>
		<td>Shows <code>Text</code> nodes.</td>
	</tr>

Методы

detach():Void

Эта операция является пустой. Она ничего не делает. Раньше она сообщала движку, что NodeIterator больше не используется, но теперь это бесполезно.

nextNode():Node

Возвращает следующий Node в документе или null, если их нет.

Выбрасывает:

null

DOMError

previousNode():Node

Возвращает предыдущий Node в документе или null, если их нет.

Выбрасывает:

null

DOMError

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/NodeIterator.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API