I often hear about DOM level 1, DOM level 2, DOM level 3 and DOM level 4 and realized that I don't know the difference between any of them or how they relate to each other.
I know the very basics - DOM is Document Object Model, and is what provides access for scripting languages (particularly, but as far as I know, not limited to various versions of ECMAScript, such as ECMAScript 5.1) to access elements of an HTML document. (Some sites I read - such as the dom introduction on quirksmode - say that it's for any XML document, but HTML is a sufficient subset.)
The dates on w3c's DOM technical reports seem to imply that each subsequent DOM level supersedes the previous ones.
Sadly, the best reference I've found to provide clarification has been wikipedia, which seems to say the same - the Standardization section says subsequent levels added extra functionality, while not mentioning removing anything.
Now, for my questions, which may be rapid fire, but hopefully express the general state of my ignorance:
- What's the relation of one DOM level to another?
- Are lower level DOMs complete subsets of higher level DOMs? Has any functionality been removed as the DOM level advances? When I see statements like
The level 1 DOM will work fine on an HTML document
andIn the Level 1 DOM, each object, whatever it may be exactly, is a Node
(both from the quirksmode intro), does this imply that such statements are true for levels 2, 3 and 4? (These are all kind of the same question, just asked different ways) - Is citing DOM level really little more than a shorthand way of how modern a user agent must be for a particular function to work?
Obviously, I can study each specification off of the w3c's DOM technical reports, but was hoping to get answers from those with first-hand experience. Just by glancing at the changes section of the spec for DOM level 3, I see that most of the changes from 2 to 3 were additions, though some of the key implementations in the Node interface have changed. Did these changes break anything?
I'd like to do more than just nod sagely next time someone tells me, Oh, that's DOM level 2, so it's ok, so would welcome any references I have missed or firsthand information that I didn't glean from my research.