[whatwg/dom] CDATA section can be imported into HTML document (Issue #1420)

meiqinyan created an issue (whatwg/dom#1420)

### What is the issue with the DOM Standard?

`Document.importNode()` can be called with a CDATA section node as the first argument, in effect allowing for a CDATA section to belong to a HTML document. Given that `.createCDATASection()` for HTML throws an exception, the intent appears to be that this is not supposed to be possible.

While this situation is somewhat bizarre, as far as I can tell there are not any inconsistencies that actually result from this. Maybe changing `.createCDATASection()` to behave the same in HTML as XML would be less surprising?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1420
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1420@github.com>

Received on Thursday, 6 November 2025 09:22:01 UTC