Talk:Document Object Model: Difference between revisions

Content deleted Content added
Line 121:
::*"'''The DOM of a webpage needs to be distinguished''' from its markup because of [[client-side scripting]].." What I was trying to get at was that the effect of Javascript altering the DOM is another reason the DOM ends up usually being different from the plain HTML. But I don't think I phrased it well. How about "The DOM of a webpage is often distanced further from its markup by the effect of [[client-side scripting]].."?
::--[[User:Qwerty0|Qwerty0]] ([[User talk:Qwerty0|talk]]) 08:06, 11 December 2011 (UTC)
:::Woh. This is going to be hard. Especially if there's just the two of us. I've just had a read through the talk sections above, and a look at the article. There's a lot to be done here, and I can't find any decent references for the level of detail that's needed. I found this, http://www.w3.org/TR/DOM-Level-2-Core/introduction.html, and some other less useful stuff.
:::I think there are many levels to get in order.
:::*The DOM defines an [[Interface (computing)]], through which [[Client-side scripting]] can access and manipulate HTML and XML documents
:::*In an HTML DOM, the document is represented as a [[Tree (data structure)]] comprising the [[HTML element]]s, [[HTML attribute]]s, text and other aspects of the HTML text document
:::*Although the DOM defines an [[Object (computer science)|object]] [[Domain model|model]] of the document, there is no requirement that the DOM implementation (in the web browser or wherever) uses this object model to represent the document, just that it fulfils the interface ''as if it did''.
:::*If scripts alter or manipulate the DOM 'objects' via the provided interface, then a web browser should alter the displayed representation appropriately.
:::*DOM Level 3 provides for XML DOM structures to be serialised back into markup text. There are many reasons and ways that the output document may differ from original markup:[http://www.w3.org/TR/2004/NOTE-DOM-Requirements-20040226/]
:::**The DOM may have been manipulated by scripting since it was loaded
:::**The serialisation mode may have been set to alter [[XML entity]]s
:::**the serialisation mode may alter whitespace, namespaces, etc
:::I had some of that wrong in my version above, but I think it's about right here. I left most of the links un-piped for now. Once we (and whoever else may show up to help) agree what the points are, we can re-write the prose, I hope. --[[User:Nigelj|Nigelj]] ([[User talk:Nigelj|talk]]) 17:47, 30 December 2011 (UTC)