Re: HTML5 style and script tags

20.10.2011 15:20, Matthew Jordan wrote:

> I believe a warning about the redundancy of the "type" attr would help
> to encourage reduction of the size of a document's markup in general.

On the other hand, as the HTML5 drafts do not in any way suggest that 
markup be minimized, a warning (or even an informative message) might be 
somewhat odd - especially since many people have the habit of using 
them, and there are usually many more important things to consider.

Reading again my own previous message I see a typo, or rather lack of 
typo here:

>> There's a related question: What happens when the attribute is present
>> and its value is pragmatically wrong, as in <style type=text/css> or
>> <script type=text/javascirpt>? Nothing, it seems.

The first tag is correct of course - I meant to include a typo like 
text/ccs instead of text/css (I've seen this happen).

And I think issues like this would be much more important than any 
message about a redundant attribute. (The only real problem with 
redundant attributes is that you may mistype then - and might use quite 
some time in trying to find out why your style sheet or your JavaScript 
code seems to be ignored.)

So I think a validator could issue an informative message, possibly even 
a warning, if it encounters <style type=...> or <script type=...> with 
an attribute value outside a specific small list, saying something like 
"limited or no support in web browsers".

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Received on Thursday, 20 October 2011 12:34:32 UTC