Das DOM (2016-05) [] (Das DOM (2016-05)), Lektion, Seite 723591
https://www.purl.org/stefan_ram/pub/quick_reference_dom (Permalink) ist die kanonische URI dieser Seite.
Stefan Ram

Das DOM ( 2016-05 )

Die auf dieser Seite zur Beschreibung des DOM verwendete Notation ist kein JavaScript !

Es ist nicht nötig alle Details der Notation zu verstehen.

Da dieses DOM recht neu ist, könnte es sein, daß einzelne Browser noch nicht alle Teile dieses DOM umgesetzt haben.

Die Verbesserung der Formatierung dieser Seite ist noch in Arbeit.

Die verwendeten Attributtypen (siehe auch https://www.w3.org/TR/WebIDL/)

? = bedeutet "oder null"

DOMString = eine Zeichenfolge

Element = ein Element

Node = ein Teil

HTMLCollection = Eine Auflistung

NodeList = Eine Auflistung

boolean = ein Wahrheitswert

unsigned long = eine Zahl

Document = ein Dokument

DocumentType = ein Dokumenttyp

any = irgendetwas

DOMImplementation
DOMTimeStamp
DOMTokenList
EventTarget
HTMLSlotElement
NamedNodeMap
NodeFilter
ShadowRoot
ShadowRootMode

Einige weitere verwendete Typen (siehe auch https://www.w3.org/TR/WebIDL/)

sequence< T >

iterable< T >

IDL Index·(siehe auch: dom.spec.whatwg.org, WHATWG DOM Living Standard — Last Updated 12 May 2016)

interface NodeList
{ getter Node? item( unsigned long index );
readonly attribute unsigned long length;
iterable< Node >; };

interface HTMLCollection
{ readonly attribute unsigned long length;
getter Element? item( unsigned long index );
getter Element? namedItem( DOMString name ); };

interface Node : EventTarget
{

const unsigned short ELEMENT_NODE
= 1;

const unsigned short ATTRIBUTE_NODE
= 2; /* historical */

const unsigned short TEXT_NODE
= 3;

const unsigned short CDATA_SECTION_NODE
= 4; /* historical */

const unsigned short ENTITY_REFERENCE_NODE
= 5; /* historical */

const unsigned short ENTITY_NODE
= 6; /* historical */

const unsigned short PROCESSING_INSTRUCTION_NODE
= 7;

const unsigned short COMMENT_NODE
= 8;

const unsigned short DOCUMENT_NODE
= 9;

const unsigned short DOCUMENT_TYPE_NODE
= 10;

const unsigned short DOCUMENT_FRAGMENT_NODE
= 11;

const unsigned short NOTATION_NODE
= 12; /* historical */

readonly attribute unsigned short nodeType;

readonly attribute DOMString nodeName;

readonly attribute DOMString baseURI;

readonly attribute boolean isConnected;

readonly attribute Document? ownerDocument;

readonly attribute Node rootNode;

readonly attribute Node? parentNode;

readonly attribute Element? parentElement;

boolean hasChildNodes();

readonly attribute NodeList childNodes;

readonly attribute Node? firstChild;

readonly attribute Node? lastChild;

readonly attribute Node? previousSibling;

readonly attribute Node? nextSibling;

attribute DOMString? nodeValue;

attribute DOMString? textContent;

void normalize();

Node cloneNode
( optional boolean deep = false );

boolean isEqualNode
( Node? otherNode );

boolean isSameNode
( Node? otherNode );
/* historical alias of === */

const unsigned short DOCUMENT_POSITION_DISCONNECTED
= 0x01;

const unsigned short DOCUMENT_POSITION_PRECEDING
= 0x02;

const unsigned short DOCUMENT_POSITION_FOLLOWING
= 0x04;

const unsigned short DOCUMENT_POSITION_CONTAINS
= 0x08;

const unsigned short DOCUMENT_POSITION_CONTAINED_BY
= 0x10;

const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
= 0x20;

unsigned short compareDocumentPosition( Node other );

boolean contains( Node? other );

DOMString? lookupPrefix( DOMString? namespace );
DOMString? lookupNamespaceURI( DOMString? prefix );
boolean isDefaultNamespace( DOMString? namespace );

Node insertBefore( Node node, Node? child );
Node appendChild( Node node );
Node replaceChild( Node node, Node child );
Node removeChild( Node child ); };

interface NonElementParentNode
{ Element? getElementById( DOMString elementId ); };

interface ParentNode
{ readonly attribute HTMLCollection children;
readonly attribute Element? firstElementChild;
readonly attribute Element? lastElementChild;
readonly attribute unsigned long childElementCount;

void prepend( ( Node or DOMString )... nodes );
void append( ( Node or DOMString )... nodes );

Element? querySelector( DOMString selectors );
NodeList querySelectorAll( DOMString selectors ); };

interface NonDocumentTypeChildNode
{ readonly attribute Element? previousElementSibling;
readonly attribute Element? nextElementSibling; };

interface ChildNode
{ void before( ( Node or DOMString )... nodes );
void after( ( Node or DOMString )... nodes );
void replaceWith( ( Node or DOMString )... nodes );
void remove(); };

interface Document : Node
implements NonElementParentNode, ParentNode, DocumentOrShadowRoot
{ readonly attribute DOMImplementation implementation;
readonly attribute DOMString URL;
readonly attribute DOMString documentURI;
readonly attribute DOMString origin;
readonly attribute DOMString compatMode;
readonly attribute DOMString characterSet;
readonly attribute DOMString charset; /* historical alias of characterSet */
readonly attribute DOMString inputEncoding; /* historical alias of characterSet */
readonly attribute DOMString contentType;

readonly attribute DocumentType? doctype;
readonly attribute Element? documentElement;
HTMLCollection getElementsByTagName( DOMString qualifiedName );
HTMLCollection getElementsByTagNameNS( DOMString? namespace, DOMString localName );
HTMLCollection getElementsByClassName( DOMString classNames );

Element createElement( DOMString localName, optional ElementCreationOptions options );
Element createElementNS( DOMString? namespace, DOMString qualifiedName, optional ElementCreationOptions options );
DocumentFragment createDocumentFragment();
Text createTextNode( DOMString data );
Comment createComment( DOMString data );
ProcessingInstruction createProcessingInstruction( DOMString target, DOMString data );

Node importNode( Node node, optional boolean deep = false );
Node adoptNode( Node node );

Attr createAttribute( DOMString localName );
Attr createAttributeNS( DOMString? namespace, DOMString qualifiedName );

Event createEvent( DOMString interface );

Range createRange();

/* NodeFilter.SHOW_ALL = 0xFFFFFFFF */
NodeIterator createNodeIterator( Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null );
TreeWalker createTreeWalker( Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null ); };


interface DocumentType : Node
implements ChildNode
{ readonly attribute DOMString name;
readonly attribute DOMString publicId;
readonly attribute DOMString systemId; };

interface DocumentFragment : Node
implements NonElementParentNode, ParentNode
{ };

interface Element : Node
implements ParentNode, NonDocumentTypeChildNode, ChildNode, Slotable
{ readonly attribute DOMString? namespaceURI;
readonly attribute DOMString? prefix;
readonly attribute DOMString localName;
readonly attribute DOMString tagName;

attribute DOMString id;
attribute DOMString className;
readonly attribute DOMTokenList classList;
attribute DOMString slot;

boolean hasAttributes();
readonly attribute NamedNodeMap attributes;
sequence< DOMString >getAttributeNames();
DOMString? getAttribute( DOMString qualifiedName );
DOMString? getAttributeNS( DOMString? namespace, DOMString localName );
void setAttribute( DOMString qualifiedName, DOMString value );
void setAttributeNS( DOMString? namespace, DOMString qualifiedName, DOMString value );
void removeAttribute( DOMString qualifiedName );
void removeAttributeNS( DOMString? namespace, DOMString localName );
boolean hasAttribute( DOMString qualifiedName );
boolean hasAttributeNS( DOMString? namespace, DOMString localName );

Attr? getAttributeNode( DOMString qualifiedName );
Attr? getAttributeNodeNS( DOMString? namespace, DOMString localName );
Attr? setAttributeNode( Attr attr );
Attr? setAttributeNodeNS( Attr attr );
Attr removeAttributeNode( Attr attr );

ShadowRoot attachShadow( ShadowRootInit init );
readonly attribute ShadowRoot? shadowRoot;

Element? closest( DOMString selectors );
boolean matches( DOMString selectors );
boolean webkitMatchesSelector( DOMString selectors ); /* historical alias of matches */

HTMLCollection getElementsByTagName( DOMString qualifiedName );
HTMLCollection getElementsByTagNameNS( DOMString? namespace, DOMString localName );
HTMLCollection getElementsByClassName( DOMString classNames );

Element? insertAdjacentElement( DOMString where, Element element ); /* historical */
void insertAdjacentText( DOMString where, DOMString data ); /* historical */ };

interface Attr
{ readonly attribute DOMString? namespaceURI;
readonly attribute DOMString? prefix;
readonly attribute DOMString localName;
readonly attribute DOMString name;
readonly attribute DOMString nodeName; /* historical alias of name */
attribute DOMString value;
attribute DOMString nodeValue; /* historical alias of value */
attribute DOMString textContent; /* historical alias of value */

readonly attribute Element? ownerElement;

readonly attribute boolean specified; /* useless; always returns true */ };

interface CharacterData : Node
implements NonDocumentTypeChildNode, ChildNode
{ attribute DOMString data;
readonly attribute unsigned long length;
DOMString substringData( unsigned long offset, unsigned long count );
void appendData( DOMString data );
void insertData( unsigned long offset, DOMString data );
void deleteData( unsigned long offset, unsigned long count );
void replaceData( unsigned long offset, unsigned long count, DOMString data ); };

interface Text : CharacterData
implements Slotable
{ Text splitText( unsigned long offset );
readonly attribute DOMString wholeText; };

interface ProcessingInstruction : CharacterData
{ readonly attribute DOMString target; };

interface Comment : CharacterData { };

interface Event
{ readonly attribute DOMString type;
readonly attribute EventTarget? target;
readonly attribute EventTarget? currentTarget;
sequence< EventTarget >composedPath();

const unsigned short NONE = 0;
const unsigned short CAPTURING_PHASE = 1;
const unsigned short AT_TARGET = 2;
const unsigned short BUBBLING_PHASE = 3;
readonly attribute unsigned short eventPhase;

void stopPropagation();
void stopImmediatePropagation();

readonly attribute boolean bubbles;
readonly attribute boolean cancelable;
void preventDefault();
readonly attribute boolean defaultPrevented;
readonly attribute boolean composed;

readonly attribute boolean isTrusted;
readonly attribute DOMTimeStamp timeStamp;

void initEvent( DOMString type, boolean bubbles, boolean cancelable ); /* historical */ };

dictionary EventInit
{ boolean bubbles = false;
boolean cancelable = false;
boolean composed = false; };

interface CustomEvent : Event
{ readonly attribute any detail;

void initCustomEvent( DOMString type, boolean bubbles, boolean cancelable, any detail ); };

dictionary CustomEventInit : EventInit
{ any detail = null; };

interface EventTarget
{ void addEventListener( DOMString type, EventListener? callback, optional ( AddEventListenerOptions or boolean ) options );
void removeEventListener( DOMString type, EventListener? callback, optional ( EventListenerOptions or boolean ) options );
boolean dispatchEvent( Event event ); };

callback interface EventListener
{ void handleEvent( Event event ); };

dictionary EventListenerOptions
{ boolean capture = false; };

dictionary AddEventListenerOptions : EventListenerOptions
{ boolean passive = false;
boolean once = false; };

interface DocumentOrShadowRoot { };

interface Slotable
{ readonly attribute HTMLSlotElement? assignedSlot; };

interface MutationObserver
{ void observe( Node target, MutationObserverInit options );
void disconnect();
sequence< MutationRecord >takeRecords(); };

callback MutationCallback = void ( sequence< MutationRecord >mutations, MutationObserver observer );

dictionary MutationObserverInit
{ boolean childList = false;
boolean attributes;
boolean characterData;
boolean subtree = false;
boolean attributeOldValue;
boolean characterDataOldValue;
sequence< DOMString >attributeFilter; };

interface MutationRecord
{ readonly attribute DOMString type;
readonly attribute Node target;
readonly attribute NodeList addedNodes;
readonly attribute NodeList removedNodes;
readonly attribute Node? previousSibling;
readonly attribute Node? nextSibling;
readonly attribute DOMString? attributeName;
readonly attribute DOMString? attributeNamespace;
readonly attribute DOMString? oldValue; };

interface XMLDocument : Document {};

dictionary ElementCreationOptions
{ DOMString is; };

interface DOMImplementation
{ DocumentType createDocumentType( DOMString qualifiedName, DOMString publicId, DOMString systemId );
XMLDocument createDocument( DOMString? namespace, DOMString qualifiedName, optional DocumentType? doctype = null );
Document createHTMLDocument( optional DOMString title );

boolean hasFeature(); /* useless; always returns true */ };

interface ShadowRoot : DocumentFragment
implements DocumentOrShadowRoot
{ readonly attribute ShadowRootMode mode;
readonly attribute Element host; };

enum ShadowRootMode { "open", "closed" };

dictionary ShadowRootInit
{ required ShadowRootMode mode; };

interface NamedNodeMap
{ readonly attribute unsigned long length;
getter Attr? item( unsigned long index );
getter Attr? getNamedItem( DOMString qualifiedName );
Attr? getNamedItemNS( DOMString? namespace, DOMString localName );
Attr? setNamedItem( Attr attr );
Attr? setNamedItemNS( Attr attr );
Attr removeNamedItem( DOMString qualifiedName );
Attr removeNamedItemNS( DOMString? namespace, DOMString localName ); };

interface Range
{ readonly attribute Node startContainer;
readonly attribute unsigned long startOffset;
readonly attribute Node endContainer;
readonly attribute unsigned long endOffset;
readonly attribute boolean collapsed;
readonly attribute Node commonAncestorContainer;

void setStart( Node node, unsigned long offset );
void setEnd( Node node, unsigned long offset );
void setStartBefore( Node node );
void setStartAfter( Node node );
void setEndBefore( Node node );
void setEndAfter( Node node );
void collapse( optional boolean toStart = false );
void selectNode( Node node );
void selectNodeContents( Node node );

const unsigned short START_TO_START = 0;
const unsigned short START_TO_END = 1;
const unsigned short END_TO_END = 2;
const unsigned short END_TO_START = 3;
short compareBoundaryPoints( unsigned short how, Range sourceRange );

void deleteContents();
DocumentFragment extractContents();
DocumentFragment cloneContents();
void insertNode( Node node );
void surroundContents( Node newParent );

Range cloneRange();
void detach();

boolean isPointInRange( Node node, unsigned long offset );
short comparePoint( Node node, unsigned long offset );

boolean intersectsNode( Node node );

stringifier; };

interface NodeIterator
{ readonly attribute Node root;
readonly attribute Node referenceNode;
readonly attribute boolean pointerBeforeReferenceNode;
readonly attribute unsigned long whatToShow;
readonly attribute NodeFilter? filter;

Node? nextNode();
Node? previousNode();

void detach(); };

interface TreeWalker
{ readonly attribute Node root;
readonly attribute unsigned long whatToShow;
readonly attribute NodeFilter? filter;
attribute Node currentNode;

Node? parentNode();
Node? firstChild();
Node? lastChild();
Node? previousSibling();
Node? nextSibling();
Node? previousNode();
Node? nextNode(); };

callback interface NodeFilter
{ /* Constants for acceptNode() */
const unsigned short FILTER_ACCEPT = 1;
const unsigned short FILTER_REJECT = 2;
const unsigned short FILTER_SKIP = 3;

/* Constants for whatToShow */
const unsigned long SHOW_ALL = 0xFFFFFFFF;
const unsigned long SHOW_ELEMENT = 0x1;
const unsigned long SHOW_ATTRIBUTE = 0x2; /* historical */
const unsigned long SHOW_TEXT = 0x4;
const unsigned long SHOW_CDATA_SECTION = 0x8; /* historical */
const unsigned long SHOW_ENTITY_REFERENCE = 0x10; /* historical */
const unsigned long SHOW_ENTITY = 0x20; /* historical */
const unsigned long SHOW_PROCESSING_INSTRUCTION = 0x40;
const unsigned long SHOW_COMMENT = 0x80;
const unsigned long SHOW_DOCUMENT = 0x100;
const unsigned long SHOW_DOCUMENT_TYPE = 0x200;
const unsigned long SHOW_DOCUMENT_FRAGMENT = 0x400;
const unsigned long SHOW_NOTATION = 0x800; /* historical */

unsigned short acceptNode( Node node ); };

interface DOMTokenList
{ readonly attribute unsigned long length;
getter DOMString? item( unsigned long index );
boolean contains( DOMString token );
void add( DOMString... tokens );
void remove( DOMString... tokens );
boolean toggle( DOMString token, optional boolean force );
void replace( DOMString token, DOMString newToken );
boolean supports( DOMString token );
attribute DOMString value;
stringifier;
iterable< DOMString >; };

Seiteninformationen und Impressum   |   Mitteilungsformular  |   "ram@zedat.fu-berlin.de" (ohne die Anführungszeichen) ist die Netzpostadresse von Stefan Ram.   |   Eine Verbindung zur Stefan-Ram-Startseite befindet sich oben auf dieser Seite hinter dem Text "Stefan Ram".)  |   Der Urheber dieses Textes ist Stefan Ram. Alle Rechte sind vorbehalten. Diese Seite ist eine Veröffentlichung von Stefan Ram. Schlüsselwörter zu dieser Seite/relevant keywords describing this page: Stefan Ram Berlin slrprd slrprd stefanramberlin spellched stefanram723591 stefan_ram:723591 Das DOM (2016-05) Stefan Ram, Berlin, and, or, near, uni, online, slrprd, slrprdqxx, slrprddoc, slrprd723591, slrprddef723591, PbclevtugFgrsnaEnz Erklärung, Beschreibung, Info, Information, Hinweis,

Der Urheber dieses Textes ist Stefan Ram. Alle Rechte sind vorbehalten. Diese Seite ist eine Veröffentlichung von Stefan Ram.
https://www.purl.org/stefan_ram/pub/quick_reference_dom