DOM Levels

  • Revision slug: User:Jt//Sandbox/DOM_Levels
  • Revision title: DOM Levels
  • Revision id: 201030
  • Created:
  • Creator: Jt
  • Is current revision? No
  • Comment Migrated and altered layout slightly

Revision Content

This article is based on the abstracts of each DOM specification. It explains briefly what each DOM Level brings with regard to functionality, and the degree of support of Mozilla for that part of the specs.

Thanks to the World Wide Web Consortium for making all this possible! All of the following texts are the "abstracts" of the DOM specifications. All this and more can be found of the W3C DOM site.

The purpose of this document is to give an overview of the different DOM Levels and the support Mozilla offers for each of them. If you're looking for an introduction to the DOM, this is not the right place. :-)

Level 1

The DOM Level 1 specification is separated into two parts: Core and HTML.

DOM1 Core

The Core DOM1 section provides a low-level set of fundamental interfaces that can represent any structured document, as well as defining extended interfaces for representing an XML document.

Interfaces introduced in DOM1 include, amongst others, the Document, Node, Attr, Element, and Text interfaces. All interfaces contain attributes and/or methods that can be used to interact with XML and HTML documents.

Level of support: Excellent. See our bugs in the Core specs.

DOM1 HTML

The HTML Level 1 section provides additional, higher-level interfaces that are used with the fundamental interfaces defined in the Core Level 1 section to provide a more convenient view of an HTML document.

Level of support: Excellent. See our bugs in the HTML specs.

Level 2

The DOM Level 2 specification contains the following 6 different Recommendations. Most of the DOM Level 2 is supported in Mozilla.

DOM2 Core

The DOM2 Core extends the functionality of the DOM1 Core. It also contains specialized interfaces dedicated to XML. Examples of methods introduced in the DOM2 Core include the famous getElementById, and many namespace-related methods.

Level of support: Very good. See our bugs in the Core spec.

DOM2 Views

The DOM2 Views allows programs and scripts to dynamically access and update the content of a representation of a document. The introduced interfaces are AbstractView and DocumentView.

Level of support: Perfect.

DOM2 Events

The DOM2 Events gives to programs and scripts a generic event system. It introduces the concepts of event flow, capture, bubbling, and cancelation. Famous methods here include addEventListener and handleEvent. Several interfaces make your life easier when dealing with events: EventTarget, EventListener, Event, DocumentEvent, MouseEvent, MutationEvent, etc. It does not include however an interface for the keyboard events, which will be dealt with in later versions of the DOM.

Level of support: Very good. See our bugs in the Events spec.

DOM2 Style

The DOM2 CSS, or DOM2 Style allows programs and scripts to dynamically access and update the content of style sheets documents. It has interfaces for Style Sheets, Cascading Style Sheets, CSSRule, CSSStyleDeclaration, the famous getComputedStyle (supported in Mozilla!), the many many CSS2Properties, and all the media rules you could imagine.

Level of support: Good. See our bugs in the Style spec.

DOM2 Traversal and Range

The DOM2 Traversal and Range allow programs and scripts to dynamically traverse and identify a range of content in a document.

The DOM2 Traversal provides interfaces like NodeIterator and TreeWalker to easily traverse the content of a document.

The DOM2 Range allows the creation, insertion, modification, and deletion of a range of content in a Document, DocumentFragment, or Attr. It can be characterized as selecting all of the content between a pair of boundary-points.

Level of support: Good for Range; for Traversal, the TreeWalker is supported, however NodeIterator is not implemented at all.

DOM2 HTML

The DOM2 HTML allows programs and scripts to dynamically access and update the content and structure of HTML documents. It extends the interfaces defined in the DOM1 HTML, using the DOM2 Core possibilities. It introduces the contentDocument property, a useful way to access the document contained in a frame.

Level of support: Good. See our bugs in the HTML spec.

Level 3

The DOM Level 3 specification is currently made of 5 different specifications.

DOM3 Core

The DOM3 Core will extend the functionality of the DOM1 and DOM2 Core specs. New methods and properties include adoptNode(), strictErrorChecking, and textContent, to name only a few.

Level of support: Only a few properties and methods are supported, like baseURI. If you want to help with the code, please look at {{template.Bug(159167)}}.

DOM3 Load and Save

The DOM3 Load and Save allows programs and scripts to dynamically load the content of an XML document into a DOM document and serialize a DOM document into an XML document.

Level of support: None. If you want to help with the code, please look at {{template.Bug(155749)}}.

DOM3 Validation

The DOM3 Validation allows programs and scripts to dynamically update the content and the structure of documents while ensuring that the document remains valid, or to ensure that the document becomes valid.

Level of support: None.

DOM3 Events

The DOM3 Events is the extension of the DOM2 events spec. This spec mainly focuses on keyboard events and how to handle them.

Level of support: Parts.

DOM3 XPath

The DOM3 XPath provides simple functionalities to access a DOM tree using XPath 1.0.

Level of support: Parts.

Revision Source

<p>This article is based on the abstracts of each DOM specification. It explains briefly what each DOM Level brings with regard to functionality, and the degree of support of Mozilla for that part of the specs.
</p><p>Thanks to the <a class="external" href="http://www.w3.org/">World Wide Web Consortium</a> for making all this possible! All of the following texts are the "abstracts" of the DOM specifications. All this and more can be found of the <a class="external" href="http://www.w3.org/DOM">W3C DOM site</a>.
</p><p>The purpose of this document is to give an overview of the different DOM Levels and the support Mozilla offers for each of them. If you're looking for an introduction to the DOM, this is not the right place. :-)
</p>
<h2 name="Level_1">Level 1</h2>
<p>The DOM Level 1 specification is separated into two parts: Core and HTML. 
</p>
<h3 name="DOM1_Core">DOM1 Core</h3>
<p>The Core DOM1 section provides a low-level set of fundamental interfaces that can represent any structured document, as well as defining extended interfaces for representing an XML document. 
</p><p>Interfaces introduced in DOM1 include, amongst others, the Document, Node, Attr, Element, and Text interfaces. All interfaces contain attributes and/or methods that can be used to interact with XML and HTML documents.
</p><p>Level of support: Excellent. See our bugs in the Core specs.
</p>
<h3 name="DOM1_HTML">DOM1 HTML </h3>
<p>The HTML Level 1 section provides additional, higher-level interfaces that are used with the fundamental interfaces defined in the Core Level 1 section to provide a more convenient view of an HTML document. 
</p><p>Level of support: Excellent. See our bugs in the HTML specs.
</p>
<h2 name="Level_2">Level 2</h2>
<p>The DOM Level 2 specification contains the following 6 different Recommendations. Most of the DOM Level 2 is supported in Mozilla.
</p>
<h3 name="DOM2_Core">DOM2 Core</h3>
<p>The DOM2 Core extends the functionality of the DOM1 Core. It also contains specialized interfaces dedicated to XML. Examples of methods introduced in the DOM2 Core include the famous getElementById, and many namespace-related methods.
</p><p>Level of support: Very good. See our bugs in the Core spec.
</p>
<h3 name="DOM2_Views">DOM2 Views</h3>
<p>The DOM2 Views allows programs and scripts to dynamically access and update the content of a representation of a document. The introduced interfaces are AbstractView and DocumentView.
</p><p>Level of support: Perfect.
</p>
<h3 name="DOM2_Events">DOM2 Events</h3>
<p>The DOM2 Events gives to programs and scripts a generic event system. It introduces the concepts of event flow, capture, bubbling, and cancelation. Famous methods here include addEventListener and handleEvent. Several interfaces make your life easier when dealing with events: EventTarget, EventListener, Event, DocumentEvent, MouseEvent, MutationEvent, etc. It does not include however an interface for the keyboard events, which will be dealt with in later versions of the DOM.
</p><p>Level of support: Very good. See our bugs in the Events spec.
</p>
<h3 name="DOM2_Style">DOM2 Style</h3>
<p>The DOM2 CSS, or DOM2 Style allows programs and scripts to dynamically access and update the content of style sheets documents. It has interfaces for Style Sheets, Cascading Style Sheets, CSSRule, CSSStyleDeclaration, the famous getComputedStyle (supported in Mozilla!), the many many CSS2Properties, and all the media rules you could imagine.
</p><p>Level of support: Good. See our bugs in the Style spec.
</p>
<h3 name="DOM2_Traversal_and_Range">DOM2 Traversal and Range</h3>
<p>The DOM2 Traversal and Range allow programs and scripts to dynamically traverse and identify a range of content in a document. 
</p><p>The DOM2 Traversal provides interfaces like NodeIterator and TreeWalker to easily traverse the content of a document. 
</p><p>The DOM2 Range allows the creation, insertion, modification, and deletion of a range of content in a Document, DocumentFragment, or Attr. It can be characterized as selecting all of the content between a pair of boundary-points.
</p><p>Level of support: Good for Range; for Traversal, the TreeWalker is supported, however NodeIterator is not implemented at all.
</p>
<h3 name="DOM2_HTML">DOM2 HTML</h3>
<p>The DOM2 HTML allows programs and scripts to dynamically access and update the content and structure of HTML documents. It extends the interfaces defined in the DOM1 HTML, using the DOM2 Core possibilities. It introduces the contentDocument property, a useful way to access the document contained in a frame.
</p><p>Level of support: Good. See our bugs in the HTML spec.
</p>
<h2 name="Level_3">Level 3</h2>
<p>The DOM Level 3 specification is currently made of 5 different specifications.
</p>
<h3 name="DOM3_Core">DOM3 Core</h3>
<p>The DOM3 Core will extend the functionality of the DOM1 and DOM2 Core specs. New methods and properties include adoptNode(), strictErrorChecking, and textContent, to name only a few.
</p><p>Level of support: Only a few properties and methods are supported, like baseURI. If you want to help with the code, please look at {{template.Bug(159167)}}.
</p>
<h3 name="DOM3_Load_and_Save">DOM3 Load and Save</h3>
<p>The DOM3 Load and Save allows programs and scripts to dynamically load the content of an XML document into a DOM document and serialize a DOM document into an XML document.
</p><p>Level of support: None. If you want to help with the code, please look at {{template.Bug(155749)}}.
</p>
<h3 name="DOM3_Validation">DOM3 Validation</h3>
<p>The DOM3 Validation allows programs and scripts to dynamically update the content and the structure of documents while ensuring that the document remains valid, or to ensure that the document becomes valid.
</p><p>Level of support: None.
</p>
<h3 name="DOM3_Events">DOM3 Events</h3>
<p>The DOM3 Events is the extension of the DOM2 events spec. This spec mainly focuses on keyboard events and how to handle them.
</p><p>Level of support: Parts.
</p>
<h3 name="DOM3_XPath">DOM3 XPath</h3>
<p>The DOM3 XPath provides simple functionalities to access a DOM tree using <a href="en/XPath">XPath</a> 1.0.
</p><p>Level of support: Parts.
</p>
Revert to this revision