{"action":"created","issue":{"url":"https://api.github.com/repos/jsdom/w3c-xmlserializer/issues/2","repository_url":"https://api.github.com/repos/jsdom/w3c-xmlserializer","labels_url":"https://api.github.com/repos/jsdom/w3c-xmlserializer/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/jsdom/w3c-xmlserializer/issues/2/comments","events_url":"https://api.github.com/repos/jsdom/w3c-xmlserializer/issues/2/events","html_url":"https://github.com/jsdom/w3c-xmlserializer/issues/2","id":381145909,"node_id":"MDU6SXNzdWUzODExNDU5MDk=","number":2,"title":"Failed to serialize CDATASection nodes","user":{"login":"TechQuery","id":19969570,"node_id":"MDQ6VXNlcjE5OTY5NTcw","avatar_url":"https://avatars2.githubusercontent.com/u/19969570?v=4","gravatar_id":"","url":"https://api.github.com/users/TechQuery","html_url":"https://github.com/TechQuery","followers_url":"https://api.github.com/users/TechQuery/followers","following_url":"https://api.github.com/users/TechQuery/following{/other_user}","gists_url":"https://api.github.com/users/TechQuery/gists{/gist_id}","starred_url":"https://api.github.com/users/TechQuery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TechQuery/subscriptions","organizations_url":"https://api.github.com/users/TechQuery/orgs","repos_url":"https://api.github.com/users/TechQuery/repos","events_url":"https://api.github.com/users/TechQuery/events{/privacy}","received_events_url":"https://api.github.com/users/TechQuery/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-15T12:46:53Z","updated_at":"2018-12-03T19:44:16Z","closed_at":null,"author_association":"NONE","body":"## Actual\r\n\r\n```JavaScript\r\nconst { JSDOM } = require('jsdom');\r\n\r\nconst {window: {document, XMLSerializer}} = new JSDOM();\r\n\r\nconst element = document.createElement('style'),\r\n    documentXML = document.implementation.createDocument(null, 'xml');\r\n\r\nelement.append( documentXML.createCDATASection('a > b { }') );\r\n\r\nconsole.log( (new XMLSerializer()).serializeToString( element ) );\r\n\r\n//  InvalidStateError: Failed to serialize XML: Only Nodes and Attr objects can be serialized\r\n```\r\n\r\n## Expected\r\n\r\nhttps://codepen.io/tech_query/pen/KrmxmQ\r\n\r\n\r\n## Environment\r\n\r\n```JavaScript\r\n{ npm: '6.4.1',\r\n  ares: '1.10.1-DEV',\r\n  cldr: '32.0',\r\n  http_parser: '2.8.0',\r\n  icu: '60.1',\r\n  modules: '57',\r\n  napi: '3',\r\n  nghttp2: '1.32.0',\r\n  node: '8.12.0',\r\n  openssl: '1.0.2p',\r\n  tz: '2017c',\r\n  unicode: '10.0',\r\n  uv: '1.19.2',\r\n  v8: '6.2.414.66',\r\n  zlib: '1.2.11' }\r\n```\r\nWindows 10.0.17134.407"},"comment":{"url":"https://api.github.com/repos/jsdom/w3c-xmlserializer/issues/comments/443843938","html_url":"https://github.com/jsdom/w3c-xmlserializer/issues/2#issuecomment-443843938","issue_url":"https://api.github.com/repos/jsdom/w3c-xmlserializer/issues/2","id":443843938,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Mzg0MzkzOA==","user":{"login":"Zirro","id":3169418,"node_id":"MDQ6VXNlcjMxNjk0MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/3169418?v=4","gravatar_id":"","url":"https://api.github.com/users/Zirro","html_url":"https://github.com/Zirro","followers_url":"https://api.github.com/users/Zirro/followers","following_url":"https://api.github.com/users/Zirro/following{/other_user}","gists_url":"https://api.github.com/users/Zirro/gists{/gist_id}","starred_url":"https://api.github.com/users/Zirro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zirro/subscriptions","organizations_url":"https://api.github.com/users/Zirro/orgs","repos_url":"https://api.github.com/users/Zirro/repos","events_url":"https://api.github.com/users/Zirro/events{/privacy}","received_events_url":"https://api.github.com/users/Zirro/received_events","type":"User","site_admin":false},"created_at":"2018-12-03T19:44:16Z","updated_at":"2018-12-03T19:44:16Z","author_association":"MEMBER","body":"So... the DOM Parsing and Serialization specification which defines XMLSerializer [does not include](dfn-xml-serialization-algorithm) instructions for serializing a CDATASection node, and the main DOM specification does not supersede it by itself. While we usually follow the specifications closely, current browsers seem to serialize CDATASection nodes without issue so making an exception here may be appropriate.\r\n\r\n@domenic, do you know if this is a case where the DOM Parsing and Serialization specification has not kept up with the main DOM specification?"}}
{"actor":{"display_login":"Zirro"}}