W3C home > Mailing lists > Public > www-validator@w3.org > May 2011

Re: label element for attribute not checked for pointing to form control

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Tue, 3 May 2011 08:05:52 +0300
Message-ID: <2849DB2680E64E24A7BCEDC7008E8B46@Vodka6000>
To: "Liam Morland" <Liam@Morland.ca>, <www-validator@w3.org>
Liam Morland wrote:

> In the HTML4 specification, for@ is required to contain the @id of a
> form control, not just any @id in the document:
> However, the following validates even though the @for points to a div
> element.

The requirement that you cite has not been expressed and cannot be expressed 
in a Document Type Definition (DTD), so markup validation in the classic 
(SGML, XML) sense does not cover it. The @for attribute is declared with 
IDREF type, which means that the value must be match an @id attribute value 
in the document, but there is no further requirement.

In the experimental HTML5 mode, for HTML5 documents, the W3C Markup 
Validator applies a completely different approach, performing a mixture of 
checks, instead of checking conformance to a DTD. In that mode, a situation 
discussed here is reported as an error.

Received on Tuesday, 3 May 2011 05:06:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:59:21 UTC