2.2.1 [DOM Level 1] Section 1.2, Fundamental Interfaces

C0001:

The specification states:

 Method
 createDocumentFragment Creates an empty DocumentFragment object. 
  
 Return Value 
 A new DocumentFragment. 
  
 This method has no parameters.
  
 This method raises no exceptions.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The createDocumentFragment method returns an object that is derived from the document interface.

C0002:

The specification states:

 Method
 createTextNode Creates a Text node given the specified string. 
  
 Parameters 
 data  The data for the node.
  
 Return Value 
 The new Text object. 
  
 This method raises no exceptions.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The data parameter is treated as optional. The createTextNode method creates a text node even when no parameter is provided.

C0003:

The specification states:

 Method
 createComment Creates a Comment node given the specified string. 
  
 Parameters 
 data  The data for the node.
  
 Return Value 
 The new Comment object. 
  
 This method raises no exceptions.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The data parameter is treated as optional. The createComment method creates a COMMENT node even when no parameter is provided.

C0004:

The specification states:

 Method
 getAttributeNode Retrieves an Attr node by name. 
  
 Parameters 
 name  The name of the attribute to retrieve.
  
 Return Value 
 The Attr node with the specified attribute name or null if there is no such attribute. 
  
 This method raises no exceptions.

Quirks Mode and IE7 Mode (All Versions)

The nodeValue attribute of the object returned from the getAttributeNode method returns an empty string if an attribute has not been assigned a value in HTML.

IE8 Mode (All Versions)

The getAttributeNode method returns null if an attribute is specified but has not been assigned a value in HTML.

C0005:

The specification states:

 Method
 normalize 
 Puts all Text nodes in the full depth of the sub-tree underneath this 
 Element into a "normal" form where only markup (e.g., tags, comments, processing 
 instructions, CDATA sections, and entity references) separates Text nodes, i.e., 
 there are no adjacent Text nodes. This can be used to ensure that the DOM view of a 
 document is the same as if it were saved and re-loaded, and is useful when 
 operations (such as XPointer lookups) that depend on a particular document tree 
 structure are to be used.
  
 This method has no parameters.
  
 This method returns nothing.
  
 This method raises no exceptions.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The following clarifications apply:

  • If the normalize method is called on an empty text node, the text node is not combined with adjacent text nodes that have content.

  • If the normalize method is called on a text node that is empty and is the only child node of an element, the text node is not removed.

Show: