3R - HTMLCollection vs NodeList

Summary of the Documentation

Research the Document Object Model (DOM) specifications. Look for the role of the DOM in web development and how browsers implement the DOM specifications. Explain in your own words what the DOM is and what it does. Expalin who is responsible for the DOM specifications. Additionally, explain how browsers vendors implement the DOM.

Define/Explain the DOM

The role of the DOM in web development is to represent the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects so programming languages can interact with the page. The DOM is the data representation of the objects that are made up with the structure and content of a document on the web.

DOM Specification

The w3c is responsible for setting the standards for the DOM, but the WHATWG maintains the DOM living standards.

DOM Implementation in Browsers

The browsers vendors implement the DOM by having their source code get broken down that are more easily understood by the computer. HTML forms a tree structure in memory in order to describe the relationships and layouts which form the DOM. Then the tree tells the browser all the information it needs to execute its' tasks in order to display and handle interaction with the user. When a web page is loaded, the browser reads the HTML text and constructs the DOM tree from it. It processes the CSS that is inline, embedded, or external CSS and constructs the CSSOM tree from it. After the trees are constructed, it constructs the render-tree from it. Once constructed, the browser starts printing the elements on the screen. The first browser creates layouts of each individual node and the layout consists of the size of each node in pixels and where it'll be on the screen.