Originally Posted by Airblader
If it's not in the DOM spec, it is not a DOM method. And your link is the HTML5 spec, which is not DOM. The MDN talks about Gecko DOM, which is an implementation. If Mozilla sees it as part of their DOM, that's fine. That makes it part of their DOM's implementation, not part of the DOM.
If I write my own spec and call something "dom-foobar", it still isn't part of the DOM either.
mozilla sees it as a part of the HTML5 implementation. the first link was an archived page not hosted on the mdn page shown to establish the undocumented nature of alert() prior to HTML5, the current copy of the page, linked secondly, refers to an html5 specification.
i thought the debate was that alert() is not spec'd, which it clearly is. then it somehow got tied into the dom...
i think the confusion here lies in a somewhat ambiguous usage of the term DOM. In one respect, we often mean the proper HTML DOM when we say DOM, stuff like getElementsByTagName, children, nodeValue, etc.
But, anything that in-browser JS reaches is considered part of the browser's DOM, including the "window" object spec'd as document.defaultView
. This is why for example, xmlHttpRequest is spec'd using "DOMString"s instead of "String"s. If a browser wants to support HTML5, it MUST support alert().
i agree that alert() is not part of the html document model, but that's not to say it's not part of the JS DOM, which encompasses more than just the document, stuff like ajax, addEventListener, registerPrototcolHandler and all that fun stuff.
yes, it's confusing, but it also doesn't really matter one bit.