I hope this will be clearer when somebody has a good go at writing a proper clear explanation. --[[User:Nigelj|Nigelj]] ([[User talk:Nigelj|talk]]) 00:15, 18 March 2012 (UTC)
====Random thoughts re DOM vs. the browser's internal data model====
I just watched [http://www.youtube.com/watch?v=WxmcDoAxdoY this video], linked by {{user|Qwerty0}} above. In thatbthat the speaker is pretty definite that the DOM ''is'' the data structure produced by the browser's parser. He's talking about HTML5, and there are now reference implementations of the perfect parser getting released, open source. ThereThese are written in Python, Java etc and are pretty certainly object oriented in their implementation (I haven't checked that)implementations. So what is the point in me trying to maintain some subtle distinction in my first bullet point just above, theand the third bullet in my list above that one. So, I re-read [http://www.w3.org/TR/DOM-Level-2-Core/introduction.html this DOM Level 2] spec. In that the authors are pretty clear that the parser may not even be written in an OO language (guess, e.g. C), and so there is no way it can create the ''objects'' specified by the DOM spec: "The structure of SGML documents has traditionally been represented by an abstract data model, not by an object model"." Therefore there is no necessary link between the internal data structure and the DOM, only a requirement to behave properly to incoming, valid, DOM-based, OO, script code: "The Document Object Model is not a set of data structures; it is an object model that specifies interfaces." Now, this article is about DOMs in general, not just the HTML5 DOM, so we'd betterneed to maintain the distinctions required by other DOM specs, I think, at least until they are deprecated, or have really fallen out of use just about everywhere. thatThat said, with free open-source, perfect, HTML5 parsers available, no one but an idiot would write their own - especially in a non-OO language - these days, (and have to simulate all that OO DOM stuff from some other data structure). So, maybe there is no need to harp on about the older distinctions. Comments welcome. --[[User:Nigelj|Nigelj]] ([[User talk:Nigelj|talk]]) 01:28, 18 March 2012 (UTC)
|