The Document Object Model (DOM) is a cross-platform and language-independent interface that treats an XML or HTML document as a tree structure wherein each node is an object representing a part of the document. The DOM represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects. DOM methods allow programmatic access to the tree; with them one can change the structure, style or content of a document. Nodes can have event handlers attached to them. Once an event is triggered, the event handlers get executed.
The principal standardization of the DOM was handled by the World Wide Web Consortium, which last developed a recommendation in 2004. WHATWG took over development of the standard, publishing it as a living document. The W3C now publishes stable snapshots of the WHATWG standard.
|Document Object Model|
Example of DOM hierarchy in an HTML document
|First published||October 1, 1998|
November 19, 2015
|Organization||World Wide Web Consortium, WHATWG|
|Base standards||WHATWG DOM Living Standard|
Legacy DOM was limited in the kinds of elements that could be accessed. Form, link and image elements could be referenced with a hierarchical name that began with the root document object. A hierarchical name could make use of either the names or the sequential index of the traversed elements. For example, a form input element could be accessed as either
The Legacy DOM enabled client-side form validation and the popular "rollover" effect.
After the standardization of ECMAScript, the W3C DOM Working Group began drafting a standard DOM specification. The completed specification, known as "DOM Level 1", became a W3C Recommendation in late 1998. By 2005, large parts of W3C DOM were well-supported by common ECMAScript-enabled browsers, including Microsoft Internet Explorer version 6 (from 2001), Opera, Safari and Gecko-based browsers (like Mozilla, Firefox, SeaMonkey and Camino).
The W3C DOM Working Group published its final recommendation and subsequently disbanded in 2004. Development efforts migrated to the WHATWG, which continues to maintain a living standard. In 2009, the Web Applications group reorganized DOM activities at the W3C. In 2013, due to a lack of progress and the impending release of HTML5, the DOM Level 4 specification was reassigned to the HTML Working Group to expedite its completion. Meanwhile, in 2015, the Web Applications group was disbanded and DOM stewardship passed to the Web Platform group. Beginning with the publication of DOM Level 4 in 2015, the W3C creates new recommendations based on snapshots of the WHATWG standard.
getElementByIdfunction as well as an event model and support for XML namespaces and CSS.
To render a document such as a HTML page, most web browsers use an internal model similar to the DOM. The nodes of every document are organized in a tree structure, called the DOM tree, with the topmost node named as "Document object". When an HTML page is rendered in browsers, the browser downloads the HTML into local memory and automatically parses it to display the page on screen.
Because the DOM supports navigation in any direction (e.g., parent and previous sibling) and allows for arbitrary modifications, an implementation must at least buffer the document that has been read so far (or some parsed form of it).
Web browsers rely on layout engines to parse HTML into a DOM. Some layout engines, such as Trident/MSHTML, are associated primarily or exclusively with a particular browser, such as Internet Explorer. Others, including Blink, WebKit, and Gecko, are shared by a number of browsers, such as Google Chrome, Opera, Safari, and Firefox. The different layout engines implement the DOM standards to varying degrees of compliance.
APIs that expose DOM implementations:
The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents.
The Browser Object Model (BOM) is a browser-specific convention referring to all the objects exposed by the web browser. Unlike the Document Object Model, there is no standard for implementation and no strict definition, so browser vendors are free to implement the BOM in any way they wish.
That which we see as a window displaying a document, the browser program sees as a hierarchical collection of objects. When the browser parses a document, it creates a collection of objects that define the document and detail how it should be displayed. The object the browser creates is known as the Document object. It is part of a larger collection of objects that the browser makes use of. This collection of browser objects is collectively known as the Browser Object Model, or BOM.
The top level of the hierarchy is the window object, which contains the information about the window displaying the document. Some of the window object are objects themselves that describe the document and related information.Browser sniffing
Browser sniffing (also known as browser detection) is a set of techniques used in websites and web applications in order to determine the web browser a visitor is using, and to serve browser-appropriate content to the visitor. This practice is sometimes used to circumvent incompatibilities between browsers due to misinterpretation of HTML, Cascading Style Sheets (CSS), or the Document Object Model (DOM). While the World Wide Web Consortium maintains up-to-date central versions of some of the most important Web standards in the form of recommendations, in practice no software developer has designed a browser which adheres exactly to these standards; implementation of other standards and protocols, such as SVG and XMLHttpRequest, varies as well. As a result, different browsers display the same page differently, and so browser sniffing was developed to detect the web browser in order to help ensure consistent display of content.
For features that are fully supported (based on DOM Level 2 or DOM Level 3 modules that are under W3C Recommendation), an exact version number is given if it is certain that the feature was added in such version. DOM Level 0 and DOM Level 3 modules that are still under development are not included.DOM Inspector
DOM Inspector (DOMi) is a web developer tool created by Joe Hewitt and was originally included in Mozilla Application Suite as well as versions of Mozilla Firefox prior to Firefox 3. It is now included by default in SeaMonkey and is an installable extension for subsequent versions of Firefox and other Mozilla-based applications. Its main purpose is to inspect and edit the Document Object Model (DOM) tree of HTML and XML-based documents.
Similar tools exist in other browsers, e.g., Opera's Dragonfly, Safari's Web Inspector, the Internet Explorer Developer Toolbar, and Google Chrome's Developer Tools.DOM events
Historically, like DOM, the event models used by various web browsers had some significant differences. This caused compatibility problems. To combat this, the event model was standardized by the World Wide Web Consortium (W3C) in DOM Level 2.DVB-HTML
DVB-HTML, or Digital Video Broadcast HyperText Markup Language, is a standard for allowing digital televisions to access web content. It is an optional part of the larger MHP1.1 standard of DVB.
DHTML allows scripting languages to change variables in a web page's definition language, which in turn affects the look and function of otherwise "static" HTML page content, after the page has been fully loaded and during the viewing process. Thus the dynamic characteristic of DHTML is the way it functions while a page is viewed, not in its ability to generate a unique page with each page load.
By contrast, a dynamic web page is a broader concept, covering any web page generated differently for each user, load occurrence, or specific variable values. This includes pages created by client-side scripting, and ones created by server-side scripting (such as PHP, Python, JSP or ASP.NET) where the web server generates content before sending it to the client.
The use of JS engines is not limited to browsers. For example, the Chrome V8 engine is a core component of the popular Node.js runtime system.Java API for XML Processing
In computing, the Java API for XML Processing, or JAXP ( JAKS-pee), one of the Java XML Application programming interfaces (API)s, provides the capability of validating and parsing XML documents. It has three basic parsing interfaces:
the Document Object Model parsing interface or DOM interface
the Simple API for XML parsing interface or SAX interface
the Streaming API for XML or StAX interface (part of JDK 6; separate jar available for JDK 5)In addition to the parsing interfaces, the API provides an XSLT interface to provide data and structural transformations on an XML document.
JAXP was developed under the Java Community Process as JSR 5 (JAXP 1.0), JSR 63 (JAXP 1.1 and 1.2), and JSR 206 (JAXP 1.3).
JAXP version 1.4.4 was released on September 3, 2010. JAXP 1.3 was declared end-of-life on February 12, 2008.Komodo IDE
Komodo IDE is an integrated development environment (IDE) for dynamic programming languages. It was introduced in May 2000. Many of Komodo's features are derived from an embedded Python interpreter.Komodo IDE uses the Mozilla and Scintilla code base as they share many features and support the same languages (including Python, Perl, PHP, Ruby, Tcl, SQL, Smarty, CSS, HTML and XML) and operating systems (Linux, OS X, and Windows). The editor component is implemented using the Netscape Plugin Application Programming Interface (NPAPI), with the Scintilla view embedded in the XML User Interface Language (XUL) interface in the same manner as a web browser plugin.
Komodo IDE has an open-source counterpart called Komodo Edit. Both share much of the same code base, Komodo IDE containing the more advanced IDE features such as debugging, unit testing, etc.
Both Komodo Edit and IDE support user customizing via plug-ins and macros. Komodo plug-ins are based on Mozilla Add-ons and extensions can be searched for, downloaded, configured, installed and updated from within the application. Available extensions include a Document Object Model (DOM) inspector, pipe features, additional language support and user interface enhancements.
Komodo IDE has features such as integrated debugger support, DOM viewer, interactive shells, source code control integration, and the ability to select the engine used to run regular expressions, to ensure compatibility with the final deployment target. The commercial version also adds code browsing, a database explorer, collaboration, support for many popular source code control systems, and more. Independent implementations of some of these features, such as the database editor, git support, and remote FTP file access, are available in the free version via Komodo Edit's plugin system.Mariner (browser engine)
Mariner was a canceled project to add performance and stability enhancements to the browser engine used in the Netscape Communicator web browser. Mariner became open source in March 1998 when Netscape released its client code and started the Mozilla project.
Mariner added support for page reflow, a feature lacking in previous Netscape releases, making the layout of text and tables much faster. In addition, development work was done on a Document Object Model (level 1) and stability was improved. Enhancements to HTML and CSS were also made but these were not technically part of the Mariner project.
The original intention was to ship Mariner in Netscape Communicator 5.0, with subsequent releases using the newer NGLayout engine (now called Gecko). However, in October 1998, Netscape decided to abandon the old layout engine in favour of NGLayout and work on Mariner ceased. Netscape Communicator 5.0 and Mariner never shipped. The next major Netscape revision (Netscape 6, released in November 2000) was built around Gecko.MenuBox
MenuBox is a discontinued web browser developed by Cloanto Corporation. It is based on the Trident layout engine, to which it adds an extended document object model (DOM) and event intercepts to achieve special functionality for use in contexts such as AutoRun projects, wrapping of web-based services, chromeless applications and kiosk mode operation.
A MenuBox project consists of a single, redistributable binary file (MenuBox.exe, may also be renamed), one configuration file (in INI format, may be merged into Autorun.inf) and the actual content files (HTML, scripts, images, etc.)
The MenuBox software first launched in 1997. HTML support was introduced in version 2.0, which was released on September 22, 2002. As of October 10, 2009, MenuBox was still listed as the only third-party browser to have passed formal "Certified for Windows Vista" testing.Object model
In computing, object model has two related but distinct meanings:
The properties of objects in general in a specific computer programming language, technology, notation or methodology that uses them. Examples are the object models of Java, the Component Object Model (COM), or Object-Modeling Technique (OMT). Such object models are usually defined using concepts such as class, generic function, message, inheritance, polymorphism, and encapsulation. There is an extensive literature on formalized object models as a subset of the formal semantics of programming languages.
A collection of objects or classes through which a program can examine and manipulate some specific parts of its world. In other words, the object-oriented interface to some service or system. Such an interface is said to be the object model of the represented service or system. For example, the Document Object Model (DOM)  is a collection of objects that represent a page in a web browser, used by script programs to examine and dynamically change the page. There is a Microsoft Excel object model  for controlling Microsoft Excel from another program, and the ASCOM Telescope Driver  is an object model for controlling an astronomical telescope.An object model consists of the following important features:
Objects can be accessed via object references. To invoke a method in an object, the object reference and method name are given, together with any arguments.Interfaces
An interface provides a definition of the signature of a set of methods without specifying their implementation. An object will provide a particular interface if its class contains code that implement the method of that interface. An interface also defines types that can be used to declare the type of variables or parameters and return values of methods.Actions
An action in object-oriented programming (OOP) is initiated by an object invoking a method in another object. An invocation can include additional information needed to carry out the method. The receiver executes the appropriate method and then returns control to the invoking object, sometimes supplying a result.Exceptions
Programs can encounter various errors and unexpected conditions of varying seriousness. During the execution of the method many different problems may be discovered. Exceptions provide a clean way to deal with error conditions without complicating the code. A block of code may be defined to throw an exception whenever particular unexpected conditions or errors arise. This means that control passes to another block of code that catches the exception.Parser (CGI language)
Parser is a free server-side CGI web scripting language developed by Art. Lebedev Studio and released under the GPL.
Originally, Parser was merely a simple macro processing language. The latest 3rd revision (March 2006) introduced object-oriented programming features.
The compiler for the language was developed in C++ by studio employees Konstantin Morshnev and Alexander Petrosyan to automate often repeated tasks, especially maintenance of already existing websites. It was used in many web projects of the studio. Since revision 3 it was released as free software and it is now used in other websites, mostly in Russia (according to a partial list at the language's website).
The language supports technologies needed for common web design tasks: XML, Document Object Model (DOM), Perl Compatible Regular Expressions (PCRE) and others.Processing Instruction
A Processing Instruction (PI) is an SGML and XML node type, which may occur anywhere in the document, intended to carry instructions to the application.Processing instructions are exposed in the Document Object Model as Node.PROCESSING_INSTRUCTION_NODE, and they can be used in XPath and XQuery with the 'processing-instruction()' command.Script.aculo.us
It is most notably included with Ruby on Rails and Seaside, but also provided separately to work with other web frameworks and scripting languages.
script.aculo.us was extracted by Thomas Fuchs from his work on fluxiom, a web based digital asset management tool by the design company wollzelle. It was first released to the public in June 2005.WebAssembly
Web storage, sometimes known as DOM storage (Document Object Model storage), provides web application software methods and protocols used for storing data in a web browser. Web storage supports persistent data storage, similar to cookies but with a greatly enhanced capacity and no information stored in the HTTP request header. There are two main web storage types: local storage and session storage, behaving similarly to persistent cookies and session cookies respectively.
All major browsers support Web storage, which is standardized by the World Wide Web Consortium (W3C).