{"action":"opened","issue":{"url":"https://api.github.com/repos/w3c/DOM-Parsing/issues/7","repository_url":"https://api.github.com/repos/w3c/DOM-Parsing","labels_url":"https://api.github.com/repos/w3c/DOM-Parsing/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/w3c/DOM-Parsing/issues/7/comments","events_url":"https://api.github.com/repos/w3c/DOM-Parsing/issues/7/events","html_url":"https://github.com/w3c/DOM-Parsing/issues/7","id":153666260,"number":7,"title":"Scripting flag and behaviour for noscript","user":{"login":"ArkadiuszMichalski","id":2730894,"avatar_url":"https://avatars.githubusercontent.com/u/2730894?v=3","gravatar_id":"","url":"https://api.github.com/users/ArkadiuszMichalski","html_url":"https://github.com/ArkadiuszMichalski","followers_url":"https://api.github.com/users/ArkadiuszMichalski/followers","following_url":"https://api.github.com/users/ArkadiuszMichalski/following{/other_user}","gists_url":"https://api.github.com/users/ArkadiuszMichalski/gists{/gist_id}","starred_url":"https://api.github.com/users/ArkadiuszMichalski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArkadiuszMichalski/subscriptions","organizations_url":"https://api.github.com/users/ArkadiuszMichalski/orgs","repos_url":"https://api.github.com/users/ArkadiuszMichalski/repos","events_url":"https://api.github.com/users/ArkadiuszMichalski/events{/privacy}","received_events_url":"https://api.github.com/users/ArkadiuszMichalski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-08T17:01:06Z","updated_at":"2016-05-08T17:01:06Z","closed_at":null,"body":"This flag determinate behaviour for noscript. Default [scripting flag](https://html.spec.whatwg.org/multipage/syntax.html#scripting-flag) depends on [scripting was enabled/disabled](https://html.spec.whatwg.org/multipage/webappapis.html#concept-n-script) which depends if node's node document has a browsing context and scripting is enabled in that browsing context.\r\nIf needed then scripting flag can be force so we can have scripting flag set to \"enabled\" where scripting was disabled. Comment from HTML spec: \"The scripting flag can be enabled even when the parser was originally created for the HTML fragment parsing algorithm, even though script elements don't execute in that case.\"\r\n[HTML fragment parsing algorithm](https://html.spec.whatwg.org/multipage/syntax.html#html-fragment-parsing-algorithm) only check scripting flag state (doesn't change it).\r\nAnd now in P&S I see:\r\n- all commands that use fragment parsing algorithm (`nnerHTML`, `outerHTML`, `createContextualFragment`) don't set explicity a scripting flag. They operate on intermediate document without browsing context so this flag has default state \"disabled\" so noscript element should be parsed. But browsers don't do this so probably somewhere this flag should be set to \"enabled\" in P&S spec.\r\n- for DOMParser.parseFromString() and \"text/html\" you wrote \"The scripting flag must be set to \"disabled\" but it's obvious because returned document doesn't have browsing context and second green box inform about parsing noscript element. \r\nSome test:\r\n```js\r\n<script type = \"text/javascript\">\r\n\tvar div = document.createElement(\"div\");\r\n\tdiv.innerHTML = \"<noscript><p>test1<p>test2</noscript></noscript>\";\r\n\tconsole.log(div.firstChild.childNodes.length, div.firstChild.firstChild); // 1 text\r\n\r\n\tvar frag = document.createRange().createContextualFragment(\"<noscript><p>test1<p>test2</noscript>\");\r\n\tconsole.log(frag.firstChild.childNodes.length, frag.firstChild.firstChild); // 1 text\r\n\r\n\tvar doc = new DOMParser().parseFromString(\"<body><noscript><p>test1<p>test2</noscript>\", \"text/html\");\r\n\tconsole.log(doc.body.firstChild.childNodes.length, doc.body.firstChild.firstChild, doc.body.firstChild.lastChild); // 2 p p \r\n\tconsole.log(doc.defaultView); // null - this new document is without browsing context\r\n</script>\r\n```"}}