Content deleted Content added
Christian75 (talk | contribs) {{WikiProject Computing|class=|importance=}} |
→Explaining what the DOM is without being vague: Adding comment and editing bad breakup of section |
||
Line 141:
::::But if you're alright with my latest revision of the introductory section, I'll go ahead and add it once I've found some references? The w3c document you linked might be useful for some of it, but unfortunately until HTML5 the specification didn't even address the inner workings I refer to.
::::--[[User:Qwerty0|Qwerty0]] ([[User talk:Qwerty0|talk]]) 06:01, 31 December 2011 (UTC)
I've just found this again, having forgotten it for a few months. I see neither of us actually did much in the end at the time. I've just reverted an edit by {{user|TheBoothy}}. I'll explain why in steps as it's all pretty relevant to what we were saying above.
*'Web browsers '''usually''' use an internal model similar to the DOM' - there is no reason why they have to, internally, as long as they fulfil the DOM's interface when scripts make calls on it.
Line 147:
*When we say 'JavaScript sees...', that isn't sloppy English for 'JavaScript inspects...'. The script 'sees' the page via its [[interface (computing)]]; that is good technical grammar, whether it is querying the page structure, or altering it. It is not, ''per se'' an inspector of things.
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)
I just watched [http://www.youtube.com/watch?v=WxmcDoAxdoY this video], linked by {{user|Qwerty0}} above. In that 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. These are written in Python, Java etc and are pretty certainly object oriented in their implementations. So what is the point in me trying to maintain some subtle distinction in my first bullet point just above, and 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 need 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. That 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)
Right now, the opening paragraph of the article is pretty much junk. One should never, ever load up an introduction with technical jiberish and word after word of linked explanations. That just turns off the reader. Please put something like Qwerty0's simple explanation in place of it. It just makes more sense. - [[User:KitchM|KitchM]] ([[User talk:KitchM|talk]]) 18:51, 15 April 2014 (UTC)
== Shadow DOM? ==
|