Saturday, May 16, 2015

Document Object Model (DOM)

DOM is a language independent API for working with XML and HTML.  In browser, DOM is usually implemented in JavaSCript.  Major browser implement the Javascript engine and DOM separately.  For example, IE's JavaScript engine is call JScript (jscrirpt.dll).  The DOM API is called Trident (mshtml.dll).  In Webkit (Safari), the JavaScript engine is called SquirrelFish and the DOM engine is called Webcore. For chrome, the JavaScript engine is called V8.  Chrome uses Webcore for rendering as well.  For Firefox, JavaScript engine is called SpiderMonkey (or TraceMonkey in latter version) and the DOM API is implemented in Gecko.

Because of the separation of the script engine and the DOM/rendering engine, there are overhead in manipulating the DOM tree as every move need to be accomplished by procedure calls.

No comments: