W3C home > Mailing lists > Public > www-validator-cvs@w3.org > September 2013

[Bug 23157] XHTML: validator doesn’t check that Raw Text elements (style/script) match the constraints

From: <bugzilla@jessica.w3.org>
Date: Thu, 05 Sep 2013 03:13:28 +0000
To: www-validator-cvs@w3.org
Message-ID: <bug-23157-169-SXgVNLUIcm@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=23157

Michael[tm] Smith <mike@w3.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Michael[tm] Smith <mike@w3.org> ---
(In reply to comment #2)
> So, in the default state - which is what I intended by this bug, the content
> model is _JavaScript_. And does elements belong inside the JavaScript code?
> As much as I know, the answer is "no". I don't think they belong in any
> scripting language (except perhaps one that is based on XML - like you
> mentioned below).

You have a point there, but that's a different bug than what you described in
the Summary/Description for this bug report.

> Hence, <script><foo/></script> does break the content type of that
> particular <script> element.
> 
> Of course, I don’t expect the validator to validate the JavaScript.

It'd feasible for it to check that the syntax is valid JavaScript, actually. We
already have an error-reporting JS parser (Rhino) we're using to check the
syntax of attribute values that can contain JS. So I'll probably add
JS-syntax-checking support for <script> contents at some point. There may even
be an open validator bug for it already. If not, feel free to raise one.

> But I do
> expect the validator to understand if there are markup mixed with the code.

I don't expect it to. There's nothing special about the fact that it's markup
as opposed to just some JS syntax error. So I don't plan to add any special
checking for whether there's markup in there not.

> Just like the validator can flag a <title> that occurs in the <body>, it can
> also flag an <element> that occurs inside a <script> element of type
> javascript.

I guess it could, if there were any special value in having it do that. But as
far as I see, there's not.

> But the way I see it, since there is no @type attribute in
> <script><FOO/></script>, the content is, by default, javaScript. Hence, it
> is not in line with the content model if an element occurs in the midst of
> the script.
> 
> It might be that you don’t wanna add this feature, but that does not make
> the request invalid.

In the Summary/Description for this bug, you didn't mention anything about
checking for JavaScript. You described something else. If you want to request
that we add a feature for checking that the syntax of <script> contents is
valid JS, then I think you should raise a different bug for that.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Thursday, 5 September 2013 03:13:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:55 UTC