Roles and responsibilties inherited in this browser object's hierarchy

- 1 answer

Ad

In the below hierarchy of browser objects,

enter image description here

Each object in the above hierarchy would have been created to target certain scope of responsibilities to manage html elements.

In the above hierarchy, Can you please outline the roles & responsibilities of each browser object including Object that are inherited by its child?

Ad

Answer

Ad

I'll take a shot at some basics.

Nodes are basically every item in the DOM including text nodes.

Elements are a subset of nodes which have html tags. The element level also holds the API for a number of high-level generic attributes and event handling that all of the HTML elements share.

Elements and nodes have parent/child relationships which can be traversed, iterated over, etc.

The event target is essentially a node at a point in time when an event has fired; which is the object passed to the event handler that is set on that node for that specific event. E.g. the button that I just clicked.

HTML elements are essentially different tags which have certain basic looks and feels. So there's lots of default CSS and supported eventing this level. Also certain HTML elements can only be children of other certain ones. Think schema.

I think object is pretty self explanatory, for object-oriented purposes (prototypes, instantiation, etc). The thing that comes to mind when I see that though, is that it would be the spot on the graph which would be responsible for JSON serialization.

Ad
source: stackoverflow.com
Ad