pseudo-dom
    Preparing search index...

    Class AttrService

    Simulate the behaviour of the Attr Class when there is no DOM available.

    Hierarchy (View Summary)

    Implements

    Index
    • Parameters

      • name: string = ''

        The name of the attribute

      • value: string = ''

        The value of the attribute

      • ownerElement: PseudoElement = null

        The element which has this attribute

      • namespaceURI: string = ''

        The namespace of the attribute

      • prefix: string = null

        The namespace prefix of the attribute

      Returns AttrService

    childList: PseudoNodeList | LinkedTreeList

    The raw list of every child node (all types), used to implement childNodes/firstChild/lastChild/insertBefore/removeChild. Not the same thing as Element.children (an HTMLCollection of just the element children).

    listLinker: TreeLinker

    The linker which holds this node in the children list of its parent, from which its siblings are found (null while it has no parent).

    nodeNameValue: string
    ownerDocumentStore: PseudoDocument

    The document which made this node (createElement and the like), for when it is not in a tree yet.

    parent: PseudoNode
    value: string
    ATTRIBUTE_NODE: 2
    CDATA_SECTION_NODE: 4
    COMMENT_NODE: 8
    DEFAULT_NODE: 0
    DOCUMENT_FRAGMENT_NODE: 11
    DOCUMENT_NODE: 9
    DOCUMENT_POSITION_CONTAINED_BY: 16
    DOCUMENT_POSITION_CONTAINS: 8
    DOCUMENT_POSITION_DISCONNECTED: 1
    DOCUMENT_POSITION_FOLLOWING: 4
    DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32
    DOCUMENT_POSITION_PRECEDING: 2
    DOCUMENT_TYPE_NODE: 10
    ELEMENT_NODE: 1
    ENTITY_NODE: 6
    ENTITY_REFERENCE_NODE: 5
    NOTATION_NODE: 12
    PROCESSING_INSTRUCTION_NODE: 7
    TEXT_NODE: 3
    • get acceptsChildren(): boolean

      Whether this kind of node can have children (text, comments and attributes cannot).

      Returns boolean

    • get baseURI(): string | Location

      Returns a string representing the base URL of the document containing the Node.

      Returns string | Location

    • get childNodes(): PseudoNodeList | LinkedTreeList

      Returns a live NodeList containing all the children of this node (including elements, text and comments). NodeList being live means that if the children of the Node change, the NodeList object is automatically updated.

      Returns PseudoNodeList | LinkedTreeList

    • get firstChild(): PseudoNode

      Returns a Node representing the first direct child node of the node, or null if the node has no child.

      Returns PseudoNode

    • get isConnected(): boolean

      A boolean indicating whether or not the Node is connected (directly or indirectly) to the context object, e.g. the Document object in the case of the normal DOM, or the ShadowRoot in the case of a shadow DOM.

      Returns boolean

    • get lastChild(): PseudoNode

      Returns a Node representing the last direct child node of the node, or null if the node has no child.

      Returns PseudoNode

    • get nextSibling(): PseudoNode

      Returns a Node representing the next node in the tree, or null if there isn't such node.

      Returns PseudoNode

    • get nodeName(): string

      Returns a string containing the name of the Node. The structure of the name will differ with the node type. E.g. An HTMLElement will contain the name of the corresponding tag, like 'audio' for an HTMLAudioElement, a Text node will have the '#text' string, or a Document node will have the '#document' string.

      Returns string

    • get nodeType(): number

      Returns an unsigned short representing the type of the node. Possible values are:


      | Name | Value | |---------------------------------------- | ELEMENT_NODE | 1 | | ATTRIBUTE_NODE | 2 | | TEXT_NODE | 3 | | CDATA_SECTION_NODE | 4 | | PROCESSING_INSTRUCTION_NODE | 7 | | COMMENT_NODE | 8 | | DOCUMENT_NODE | 9 | | DOCUMENT_TYPE_NODE | 10 | | DOCUMENT_FRAGMENT_NODE | 11 |

      Returns number

    • get nodeValue(): string

      Returns the value of the current node.

      Returns string

    • set nodeValue(value: string): void

      Sets the value of the current node.

      Parameters

      • value: string

      Returns void

    • get parentElement(): PseudoElement

      Returns an Element that is the parent of this node. If the node has no parent, or if that parent is not an Element, this property returns null.

      Returns PseudoElement

    • get parentNode(): PseudoNode

      Returns a Node that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns null.

      Returns PseudoNode

    • get previousSibling(): PseudoNode

      Returns a Node representing the previous node in the tree, or null if there isn't such node.

      Returns PseudoNode

    • get textContent(): string

      Returns the textual content of an element and all its descendants.

      Returns string

    • set textContent(text: string): void

      Sets the textual content of an element and all its descendants.

      Parameters

      • text: string

      Returns void

    • Registers an event handler of a specific event type. Adding the same handler again for the same type and phase does nothing, like the DOM.

      Parameters

      • type: string

        The type of event to listen for

      • callback: any

        The function to call (or an object with a handleEvent function)

      • useCapture: boolean | listenerOptions = false

        Listen while the event travels down to the target (true), or an object with capture, once and passive

      Returns void

    • Add nodes (strings become text nodes) as the last children of this node, in the order given.

      Parameters

      • ...nodes: (string | PseudoNode)[]

        The nodes (or text) to add

      Returns void

      When this kind of node cannot have children

    • Say where another node is in relation to this one, as the bits of NodeService.DOCUMENT_POSITION_*: 0 for this node itself, DISCONNECTED (with IMPLEMENTATION_SPECIFIC and a consistent PRECEDING or FOLLOWING) for a node in another tree, CONTAINS + PRECEDING when the other node is an ancestor, CONTAINED_BY + FOLLOWING when it is a descendant, otherwise PRECEDING or FOLLOWING by their order in the tree.

      Parameters

      Returns number

    • Dispatches an event to this target and through the tree: capture listeners of the ancestors from the root down, then the listeners of this target, then (when the event bubbles) the other listeners of the ancestors from the parent up to the root. stopPropagation() stops it reaching further targets, stopImmediatePropagation() also stops the remaining listeners of the current target. Afterwards, unless the default was prevented, the default action of this target (see setDefaultEvent) runs. The event can be dispatched again afterwards.

      Parameters

      Returns boolean

      False when the event was cancelable and a listener prevented the default, otherwise true

      When the event is already being dispatched, or (after the whole dispatch has finished) the error which a listener threw (an error with all of them in its errors property when several did)

    • Whether another node of the same type is equal to this one apart from its children, which isEqualNode compares afterwards. Kinds of node with more to compare (an element has attributes) override this.

      Parameters

      Returns boolean

    • Returns a string containing the prefix for a given namespace URI, if present, and null if not. When multiple prefixes are possible, the result is implementation-dependent.

      Parameters

      • namespace: string

      Returns string

    • Add nodes (strings become text nodes) as the first children of this node, in the order given.

      Parameters

      • ...nodes: (string | PseudoNode)[]

        The nodes (or text) to add

      Returns void

      When this kind of node cannot have children

    • Remove every child of this node and put the given nodes (strings become text nodes) in their place, in order.

      Parameters

      • ...nodes: (string | PseudoNode)[]

        The nodes (or text) to add

      Returns void

      When this kind of node cannot have children

    • Put the given nodes (strings become text nodes) where this node is, in order, then remove this node. Does nothing when this node has no parent.

      Parameters

      • ...nodes: (string | PseudoNode)[]

        The nodes (or text) to put in this node's place

      Returns void