Re: [whatwg/dom] Change .createElement() namespace to match UAs (#213)

Yes, I checked yesterday and pondered whether `isXHTMLDocument() || isHTMLDocument()` is exactly the same as checking at `contentType`. I've poked around and can't find any exceptions, so it's probably close enough, but I could have missed something.

The `isXHTMLDocument() || isHTMLDocument()` test is used in a few other places that are worth comparing with:
 * The `document.title` setter, where [the spec](https://html.spec.whatwg.org/#document.title) instead just looks at the elements in the document.
 * For `execCommand` and related APIs, which throws an "execCommand is only supported on HTML documents" exception, but [the spec](https://w3c.github.io/editing/execCommand.html#execcommand()) instead talks about the `HTMLDocument` interface which is gone from the spec.
 * For `createContextualFragment`, in an optimization that isn't in [the spec](https://w3c.github.io/DOM-Parsing/#widl-Range-createContextualFragment-DocumentFragment-DOMString-fragment).

Having the concept of "HTML or XHTML document" might be useful.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/213#issuecomment-208852566

Received on Tuesday, 12 April 2016 11:20:52 UTC