Re: [whatwg] Document with a single input[type=radio]?

2016-04-07 Thread Smylers
Mikko Rantalainen writes:

> The spec says in 4.10.5.1.16 Radio Button state (type=radio)
> https://html.spec.whatwg.org/multipage/forms.html#radio-button-state-%28type=radio%29
> 
> "A document must not contain an input element whose radio button group
> contains only that element."
> 
> What this is supposed to mean in practice?

That if you include a radio button group with only one radio button in
it, your document isn't valid HTML.

> Could this sentence be dropped because this does not match real world
> browser behavior?

No, because it isn't a requirement on browsers, so browser behaviour is
irrelevant. It's a requirement on authors.

(It could be dropped for other reasons, of course. I'm not making any
claim either way on whether it's a good requirement on authors; merely
that browser behaviour can't be the reason for dropping it.)

> (A streaming browser will may hit this case after parsing the first
> radio button element in the document. Then what?)

Then browsers will follow the parsing algorithms and treat it
accordingly. For backwards compatibility and interoperability, the spec
covers how to handle all sorts of invalid input that authors might send
them.

Smylers
-- 
http://twitter.com/Smylers2


Re: [whatwg] Document with a single input[type=radio]?

2016-04-07 Thread Rimantas Liubertas
On Thu, Apr 7, 2016 at 2:48 PM, Mikko Rantalainen <
mikko.rantalai...@peda.net> wrote:

> The spec says in 4.10.5.1.16 Radio Button state (type=radio)
>
>
>
> https://html.spec.whatwg.org/multipage/forms.html#radio-button-state-%28type=radio%29
>
> "A document must not contain an input element whose radio button group
> contains only that element."
>
> What this is supposed to mean in practice? Could this sentence be
> dropped because this does not match real world browser behavior?
>

It means that you must have at least two radio buttons in the group.

(A streaming browser will may hit this case after parsing the first
> radio button element in the document. Then what?)
>

Nothing, because the document is not parsed yet.


Re: [whatwg] Document with a single input[type=radio]?

2016-04-07 Thread Domenic Denicola
This is an authoring requirement, not a browser implementation requirement. In 
practice, it means conformance checkers (aka validators) should error for lone 
radio buttons.



From: Mikko Rantalainen <mikko.rantalai...@peda.net>
Sent: Apr 7, 2016 7:49 AM
To: whatwg@lists.whatwg.org
Subject: [whatwg] Document with a single input[type=radio]?

The spec says in 4.10.5.1.16 Radio Button state (type=radio)


https://html.spec.whatwg.org/multipage/forms.html#radio-button-state-%28type=radio%29

"A document must not contain an input element whose radio button group
contains only that element."

What this is supposed to mean in practice? Could this sentence be
dropped because this does not match real world browser behavior?

(A streaming browser will may hit this case after parsing the first
radio button element in the document. Then what?)

--
Mikko



[whatwg] Document with a single input[type=radio]?

2016-04-07 Thread Mikko Rantalainen
The spec says in 4.10.5.1.16 Radio Button state (type=radio)


https://html.spec.whatwg.org/multipage/forms.html#radio-button-state-%28type=radio%29

"A document must not contain an input element whose radio button group
contains only that element."

What this is supposed to mean in practice? Could this sentence be
dropped because this does not match real world browser behavior?

(A streaming browser will may hit this case after parsing the first
radio button element in the document. Then what?)

-- 
Mikko