[whatwg] Validator.nu Bug: "Error: XHTML element noscript not allowed as child of XHTML element head in this context."

On Fri, Aug 27, 2010 at 6:32 AM, Hugh Guiney <hugh.guiney at gmail.com> wrote:
> But, I thought XHTML5 was just an XML serialization of HTML5, so why
> is this the case? I just read the rationale behind it, but despite not
> being best practice shouldn't it be at the very least allowed?

This is guesswork on my part, but maybe it's correct.  <noscript> in
text/html has magical parsing effects, which cannot be replicated in
XML.  Specifically, if scripting is enabled, its contents will be
parsed as plaintext, which is then hidden.  In XML, you'd have to
specify for every single element that its effects are ignored if it's
a descendant of <noscript> and scripting is enabled.  For instance,
the text/html markup <noscript><meta http-equiv="foo"
content="bar"><meta http-equiv="baz" content="quuz"></noscript> will
result in a DOM with a noscript element and a single text node child.
The equivalent markup in XML must instead result in two elements as
children, which the rest of the UA then has to specially ignore at
some higher level than the parser.

So I'm guessing that browsers didn't implement <noscript> in XML since
it would have been a pain and lots of people don't like it anyway; and
nobody wants to change it now because it would still be a pain and few
sites use XML.  But that's just a guess, someone else can give a more
informed answer.

On Fri, Aug 27, 2010 at 9:59 AM, Julian Reschke <julian.reschke at gmx.de> wrote:
> The HTML WG is currently discussing whether it should be deprecated (in
> HTML), see <http://www.w3.org/Bugs/Public/show_bug.cgi?id=10068>.
>
> If the outcome of this is that there are good use cases for <noscript>, I'd
> expect that it will also be allowed in XHTML.

I'm quite sure that <noscript> was not banned from XHTML just because
it lacked use-cases, and the editor currently thinks it has use-cases
regardless, so I don't expect it to be allowed in XHTML regardless.
Note that it's not just invalid in XHTML -- it actually has no effect,
as an *implementation* requirement.

Received on Friday, 27 August 2010 12:00:28 UTC