DOM Levels

  • Revision slug: DOM_Levels
  • Revision title: DOM Levels
  • Revision id: 27572
  • Created:
  • Creator: Nickolay
  • Is current revision? No
  • Comment /* Original Document Information */

Revision Content

The following are "abstracts" of the DOM specifications from the World Wide Web Consortium. All this and more can be found at the W3C DOM site: http://www.w3.org/DOM.

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, see the Gecko DOM Reference.

DOM Level 1

The DOM Level 1 specification is separated into two parts: Core and HTML. Core Level 1 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. HTML Level 1 provides additional, higher-level interfaces that are used with the fundamental interfaces defined in Core Level 1 to provide a more convenient view of an HTML document. Interfaces introduced in DOM1 include, among 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 and HTML specifications.

DOM Level 2

The DOM Level 2 specification contains six different specifications: The DOM2 Core, Views, Events, Style, Traversal and Range, and the DOM2 HTML. Most of the DOM Level 2 is supported in Mozilla.

  1. 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 specification.

  2. 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.

  3. The DOM2 Events gives a generic event system to programs and scripts. It introduces the concepts of event flow, capture, bubbling, and cancellation. Famous methods here include addEventListener and handleEvent. Several interfaces make your life easier when dealing with events: EventTarget, EventListener, Event, DocumentEvent, MouseEvent, MutationEvent, etc. However, it does not include 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 specification.

  4. The DOM2 CSS, or DOM2 Style, allows programs and scripts to dynamically access and update the content of style sheets. 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 can imagine.

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

  5. 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.

  6. 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 specification.

DOM Level 3

The DOM Level 3 specification contains five different specifications: The DOM3 Core, Load and Save, Validation, Events, and XPath.

  1. 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 see {{template.Bug(159167)}}.

  2. 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 ({{template.Bug(155749)}}). Mozilla supports non-standard DOMParser and XMLSerializer objects instead.

  3. 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.

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

    Level of support: Parts.

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

    Level of support: Parts.

Original Document Information

  • Author: Fabian Guisset
  • Copyright Information: Copyright © 1998-2006 by individual mozilla.org contributors; content available under a Creative Commons license.
The DOM levels list was changed: http://www.w3.org/DOM/DOMTR#dom3 {{ wiki.languages( { "ja": "ja/DOM_Levels" } ) }}

Revision Source

<p>
The following are "abstracts" of the <a href="en/DOM">DOM</a> specifications from the <a class="external" href="http://www.w3.org">World Wide Web Consortium</a>. All this and more can be found at the W3C DOM site: http://www.w3.org/DOM.
</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, see the <a href="en/Gecko_DOM_Reference">Gecko DOM Reference</a>.
</p>
<h3 name="DOM_Level_1"> DOM Level 1 </h3>
<p>The DOM Level 1 specification is separated into two parts: Core and HTML. Core Level 1 provides a low-level set of fundamental interfaces that can represent any structured document, as well as defining extended interfaces for representing an <a href="en/XML">XML</a> document. HTML Level 1 provides additional, higher-level interfaces that are used with the fundamental interfaces defined in Core Level 1 to provide a more convenient view of an HTML document. Interfaces introduced in DOM1 include, among 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>
<dl><dd>Level of support: Excellent. See our bugs in the <a class="external" href="http://www.mozilla.org/docs/dom/mozilla/bug-core.html">Core</a> and <a class="external" href="http://www.mozilla.org/docs/dom/mozilla/bug-html.html">HTML</a> specifications.
</dd></dl>
<h3 name="DOM_Level_2"> DOM Level 2 </h3>
<p>The DOM Level 2 specification contains six different specifications: The DOM2 Core, Views, Events, Style, Traversal and Range, and the DOM2 HTML. Most of the DOM Level 2 is supported in Mozilla.
</p>
<ol><li><b>The DOM2 Core</b> 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 <code><a href="en/DOM/document.getElementById">getElementById</a></code>, and many namespace-related methods.
<dl><dd><p>Level of support: Very good. See our bugs in the <a class="external" href="http://www.mozilla.org/docs/dom/mozilla/bug-core.html">Core</a> specification.</p>
</dd></dl>
</li><li><b>The DOM2 Views</b> allows programs and scripts to dynamically access and update the content of a representation of a document. The introduced interfaces are AbstractView and DocumentView.
<dl><dd><p>Level of support: Perfect.</p>
</dd></dl>
</li><li><b>The DOM2 Events</b> gives a generic event system to programs and scripts. It introduces the concepts of event flow, capture, bubbling, and cancellation. Famous methods here include <code>addEventListener</code> and <code>handleEvent</code>. Several interfaces make your life easier when dealing with events: EventTarget, EventListener, Event, DocumentEvent, MouseEvent, MutationEvent, etc. However, it does not include an interface for the keyboard events, which will be dealt with in later versions of the DOM.
<dl><dd><p>Level of support: Very good. See our bugs in the <a class="external" href="http://www.mozilla.org/docs/dom/mozilla/bug-events.html">Events</a> specification.</p>
</dd></dl>
</li><li><b>The DOM2 CSS</b>, or DOM2 Style, allows programs and scripts to dynamically access and update the content of style sheets. 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 can imagine.
<dl><dd><p>Level of support: Good. See our bugs in the <a class="external" href="http://www.mozilla.org/docs/dom/mozilla/bug-style.html">Style</a> specification.</p>
</dd></dl>
</li><li><b>The DOM2 Traversal and Range</b> allow programs and scripts to dynamically traverse and identify a range of content in a document. The DOM2 Traversal provides interfaces like <code>NodeIterator</code> and <code>TreeWalker</code> 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.
<dl><dd><p>Level of support: Good for Range; for Traversal, the TreeWalker is supported, however NodeIterator is not implemented at all.</p>
</dd></dl>
</li><li><b>The DOM2 HTML</b> 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.
<dl><dd><p>Level of support: Good. See our bugs in the <a class="external" href="http://www.mozilla.org/docs/dom/mozilla/bug-html.html">HTML</a> specification.</p>
</dd></dl>
</li></ol>
<h3 name="DOM_Level_3"> DOM Level 3 </h3>
<p>The DOM Level 3 specification contains five different specifications: The DOM3 Core, Load and Save, Validation, Events, and XPath. 
</p>
<ol><li><b>The DOM3 Core</b> will extend the functionality of the DOM1 and DOM2 Core specs. New methods and properties include <code>adoptNode(), strictErrorChecking, and textContent</code>, to name only a few.
<dl><dd><p>Level of support: Only a few properties and methods are supported, like <code>baseURI</code>. If you want to help with the code, please see {{template.Bug(159167)}}.</p>
</dd></dl>
</li><li><b>The DOM3 Load and Save</b> 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.
<dl><dd><p>Level of support: None ({{template.Bug(155749)}}). Mozilla supports non-standard <code><a href="en/DOMParser">DOMParser</a></code> and <code><a href="en/XMLSerializer">XMLSerializer</a></code> objects instead.</p>
</dd></dl>
</li><li><b>The DOM3 Validation</b> 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.
<dl><dd><p>Level of support: None.</p>
</dd></dl>
</li><li><b>The DOM3 Events</b> is the extension of the DOM2 Events specification. This specification mainly focuses on keyboard events and how to handle them.
<dl><dd><p>Level of support: Parts.</p>
</dd></dl>
</li><li><b>The DOM3 XPath</b> provides simple functionalities to access a DOM tree using XPath 1.0.
<dl><dd><p>Level of support: Parts.</p>
</dd></dl>
</li></ol>
<div class="originaldocinfo">
<h2 name="Original_Document_Information"> Original Document Information </h2>
<ul><li> Author: Fabian Guisset
</li><li> Copyright Information: Copyright © 1998-2006 by individual mozilla.org contributors; content available under a Creative Commons license.
</li></ul>
</div> <span class="comment">The DOM levels list was changed: http://www.w3.org/DOM/DOMTR#dom3</span>
{{ wiki.languages( { "ja": "ja/DOM_Levels" } ) }}
Revert to this revision