[whatwg] text/html flavor conformance checkers and <foo />

Henri Sivonen hsivonen at iki.fi
Wed Apr 27 02:42:31 PDT 2005

On Apr 27, 2005, at 04:13, fantasai wrote:

> Henri Sivonen wrote:
>> On Apr 26, 2005, at 19:08, fantasai wrote:
>>> Henri Sivonen wrote:
>>>> What do you suggest the parser layer of an text/html conformance 
>>>> checker say about <input checkbox ...>?
>>>> 1. Silently treat as <input type="checkbox" ...>?
>>>> 2. Treat as <input type="checkbox" ...> but warn?
>>>> 3. Treat as <input checkbox="checkbox" ...> causing an error to be 
>>>> reported on a higher layer?
>>>> 4. Treat as fatal error in the parser?
>>>> I'm inclined to choose 3.
>>> *Why?* Why of all things would you choose to interpret it like 
>>> /that/?
>>> It's neither reporting a useful error, nor handling it per SGML 
>>> rules.
>> To make the separation of concerns similar to what it would be on the 
>> XML side while being real about SGMLness being fiction. That is, the 
>> parser does not need to know if an attribute is allowed. That's a job 
>> for a higher layer.
> I still don't understand how this interpretation is useful or required.

It is useful, because it doesn't require knowledge of allowable 
minimizable attributes on the lowest parser level.

> If you want to make <input checkbox> invalid, handle it the same way
> you'd handle <input foo>.

That's what I am suggesting. The parser would treat <input foo> as 
<input foo="foo">, which would be caught on the RELAX NG validation 
layer in my diagram.

> Expanding the attribute from checked to checked="checked" is neither 
> conforming to SGML parsing rules

ITYM checkbox to checkbox="checkbox".

> nor helping the author understand what was wrong.

Would "Attribute 'checkbox' not allowed here." or something along those 
lines be any more incomprehensible that validation errors in general?

> I mean, I understand you're disillusioned with the state of HTML 
> parsing in the world, but it doesn't mean you need to be /reactionary/ 
> about it.

Authors get constantly confused when validator.w3.org feeds them SGML 
fiction. Why shouldn't the QA tools be better aligned with reality?

Henri Sivonen
hsivonen at iki.fi

More information about the whatwg mailing list