Java Reference
In-Depth Information
Level 1
Level 1 is the fi rst version of the standard. It is split into two sections: one is defi ned as core (objects,
properties, and methods that can apply to both XML and HTML) and the other as HTML (HTML-
specifi c objects, properties, and methods). The fi rst section deals with how to go about navigating and
manipulating the structure of the document. The objects, properties, and methods in this section are
very abstract. The second section deals with HTML only and offers a set of objects corresponding to
all the HTML elements. This chapter mainly deals with the second section — level 1 of the standard.
In 2000, level 1 was revamped and corrected, though it only made it to a working draft and not to a full
W3C recommendation.
Level 2
Level 2 is complete and many of the properties, methods, and events have been implemented by today's
browsers. It has sections that add specifi cations for events and style sheets to the specifi cations for core
and HTML-specifi c properties and events. (It also provides sections on views and traversal ranges, nei-
ther of which will be covered in this topic; you can fi nd more information at www.w3.org/TR/2000/
PR-DOM-Level-2-Views-20000927/ and www.w3.org/TR/2000/PR-DOM-Level-2-Traversal-
Range-20000927/.) You will be making use of some of the features of the event and style sections of
this level of the DOM later in this chapter because they have been implemented in the latest versions of
both browsers.
Level 3
Level 3 achieved recommendation status in 2004. It is intended to resolve a lot of the complications that
still exist in the event model in level 2 of the standard, and adds support for XML features, such as con-
tents models and being able to save the DOM as an XML document. Only a few browsers support some
features of Level 3.
Browser Compliance with the Standards
Almost no browser has 100 percent compliance with any standard, although some, such as Firefox,
Opera, and Safari/Chrome, come pretty close with the DOM. Therefore, there is no guarantee that
all the objects, properties, and methods of the DOM standard will be available in a given version of a
browser, although a few level 1 and level 2 objects, properties, and methods have been available in all
the browsers for some time.
Much of the material in the DOM standards has only recently been clarifi ed, and a lot of DOM features
and support have been added to only the latest browser versions. For this reason, examples in this
chapter will be guaranteed to work on only the latest versions of IE, Firefox, Opera, Safari, and Chrome.
Although cross-browser scripting is a realistic goal, backwards compatible support isn't at all.
Although the standards might still not be fully implemented, they do give you an idea as to how a
particular property or method should be implemented, and provide a guideline for all browser manu-
facturers to agree to work toward in later versions of their browsers. The DOM doesn't introduce any
new HTML elements or style sheet properties to achieve its ends. The idea of the DOM is to make use
of the existing technologies, and quite often the existing properties and methods of one or other of the
browsers.
Search WWH ::




Custom Search