This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
http://html5.org/tools/web-apps-tracker?from=8021&to=8022#diff [[ + <dd>One or more <code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code>, <code>h6</code>, and <span>script-supporting</span> elements.</dd> ]] i'd expect to be able to remove a <script> element and have the document still be valid
Why? What's the use case?
No particular use case, just a mental invariant. Like I expect removing comments to not change the conformance. One thing I can think of is a mashup of third-party content where you want to strip scripts because they might not make sense in the mashup context, but the mashup should still be conforming if the original content was conforming.
The original was only conforming because the script was supposed to be filling in the <hgroup>. If you strip the script, the page is broken. It _should_ therefore be flagged by a validator. This actually is the main use case for putting the <script> inside the <hgroup> that it manages.
OK. So if this is conforming: <hgroup><script>document.write('<h1>Hello</h1>');</script></hgroup> Why should this not be conforming?: <hgroup id=x></hgroup> <script> x.innerHTML = '<h1>Hello</h1>'; </script> Or on the flip side, why is this conforming?: <hgroup><script>/* Not filling in the hgroup */</script></hgroup> Since we don't know what scripts are doing and where they are placed in the DOM doesn't tell much about what the script does, I think the content model here makes little sense. Either we should allow empty hgroup, or we should require one or more headings, in my opinion. Case study: We allow empty <p> and empty <ol> in case a script fills it in, without requiring a <script> child in the content model.
With script, it's mathematically impossible to do a perfect job of statically describing what is ok and what's not. So whatever we do has to be arbitrary. So I went for something that can be used in a useful manner. Obviously it can be abused, there's not much we can do for that. We allow (sort of) empty <p> because it provides a place to fill in the text, same as we allow an empty <h1> in the <hgroup>. We allow an empty <ol> because the logical thing to do when filling an <ol> is to generate the <li> along with the rest of the item, to insert the whole thing at once. <hgroup> is kind of in between. You'll typically not be filling it with script at all; when you do, you'll probably be filling in an explicit <h1> and then adding some <h2>s or whatnot dynamically. Usually if you have an empty one it's gonna be a mistake. But if you have a script in there, you're almost certainly going to have it there for a reason relating to the <hgroup>, so a validator pointing it out isn't useful. This is just trying to thread the needle to find what's most useful.
fair enough