View Full Version : Has the Validator Finally Lost It?
jscheuer1
06-16-2011, 09:25 PM
I recently got this result when testing a page with an image map in HTML 5:
Error Line 24, Column 36: Element area is missing required attribute href.
<area shape="default" nohref alt="">
Attributes for element area:
Global attributes
alt
coords
shape
href
target
ping
rel
media
hreflang
type
Error Line 24, Column 36: The nohref attribute on the area element is obsolete. Omitting the href attribute is sufficient.
<area shape="default" nohref alt="">
Note, they are both for the exact same spot in the document. One says the href is required, the other says to omit it. If I drop the obsolete nohref attribute and omit href as is suggested, the first error remains.
lol... you should also have another warning, stating that the HTML5 validator is "experimental" and may be "unreliable." I believe the current status of the html5 spec is that the href is optional; nohref is obsolete.
out of curiosity, did you get a warning for alt="" ? in html5, attribute values may not be an empty string (the attribute should be omitted if the value is empty).
jscheuer1
06-17-2011, 03:16 AM
It also 'loves' this:
<script type="text/javascript">
/***********************************************
* Muti-Use inMotion - (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/
* Author John Davenport Scheuer - username:jscheuer1
***********************************************/
</script>
I forget exactly. I'm pretty sure it's the // in http://www. that sets it off for some reason.
I've also gotten erroneous results from some of the more established DTD's. Usually though these tools are what they purport to be, and quite handy at it.
I'm coming nearly full circle, knowing the place for the first time. I used to think that whatever the browser allowed was OK. Then some folks around here really got on my case about standards. I'm assuredly better off having learned about them. But I'm beginning to think that just makes it easier to know what might work. The standards certainly are not in all cases a predictor of what does work. And there are as many stand on your head while waving your arms solutions, if not more, when employing standards as there are when one ignores them. The standards took away several perfectly good and simple things that existed before them, while at the same time present some new good and simple things. At the same time unnecessarily complex constructs exist in both standards compliant and quirks mode coding.
The worst part though is the frequent tension between the two camps.
Added Later:
I forgot to answer your question on the empty alt attribute. No, the validator said nothing about it.
there is a big balance to be struck between standards and the real world [ referring -ironically- to the internet ].
valid code preempts a lot of potential problems, and I'm very much in favor of it. at the same time, it's not a direct indication of what works, especially considering the fact that no two browsers implement the standards in the same way. Also, if you stick to the standards, you cut yourself out of some neat things that are technically invalid but actually supported by almost everyone.
Triggering standards mode in browsers is important (especially in IE), but beyond that, you need to code what works. most of the time, it's valid anyway. :)
yeah, almost any embedded/inline script or css pretty much guarantees the validator will throw a fit :)
djr33
06-17-2011, 06:43 PM
John, I agree with what you said and I've thought that for a long time: standards are only perfect if you don't really analyze them. That doesn't mean they're useless, but it's complicated.
I think the problem is that standards are chosen, set, and no one really questions them (at least not effectively) because they are standards. But the problem is that just because they are standard there's no reason they are necessarily any better than any other solution. The only advantage would be if all browsers did exactly the same thing every time, but they don't.
So the bottom line is that, yes, they're good guidelines, and whenever you deviate you should have a good reason. Validating the code is still a good idea, then you can choose to ignore the problematic warnings.
warriorfullight
01-08-2012, 09:14 AM
It is good for programmere that while writing codes they should validate fast. There are different ways of validation,if it is not validated at that time then afterwards it will give lots of problems and situation will become complicated.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.