[whatwg] input type=hidden outside phrasing content

Kristof Zelechovski giecrilj at stegny.2a.pl
Thu Oct 16 14:39:51 PDT 2008


Your question made me think you want HEAD INPUT[type="hidden"].
INPUT[type="hidden"] must be within a paragraph (explicitly or implicitly)
for consistency with other INPUT controls that are displayed.  So, where a
paragraph is not allowed, neither is the INPUT control; inserted where it
does not belong, it migrates; the document is invalid but it can be rescued.
I do not see much value in allowing it to stay wherever it is found.  If you
want to create another hidden control, go ahead and tell us how do you
imagine it should look like.
Chris

-----Original Message-----
From: Mike Wilson [mailto:mikewse at hotmail.com] 
Sent: Thursday, October 16, 2008 11:09 PM
To: 'WHATWG List'; 'Kristof Zelechovski'; 'Anne van Kesteren'; 'Tab Atkins
Jr.'
Subject: RE: [whatwg] input type=hidden outside phrasing content

Kristof Zelechovski wrote:
> Why is FORM INPUT[type="hidden"] not enough?

Hi Chris, I'm sorry I don't follow your comment. My suggestion
is about <input type="hidden"> currently not being allowed in
all locations in a document. Could you elaborate?
(Maybe the followups below will make things clearer anyway.)


Anne van Kesteren wrote:
> Where is it currently not allowed that you would like to 
> allow it? It's  
> pretty much allowed anywhere already as far as I can tell.

Yes, maybe it is? Reading the spec again, I realize I had 
missed the sentence "All phrasing content is also flow 
content". (I was mainly on the lookout for DTD-like info.)
I have included a couple of the cases I'm thinking of below 
(that are invalid in HTML4). But some of them may already be
ok in HTML5?

<form ...>
  <input type="hidden" ...>
</form>

<blockquote>
  <input type="hidden" ...>
</blockquote>

<table>
  <input type="hidden" ...>
</table>

<table>
  <tr>
    <input type="hidden" ...>
    <td></td>
  </tr>
</table>

<ul/ol/dl>
  <input type="hidden" ...>
</ul/ol/dl>



> -----Original Message-----
> From: whatwg-bounces at lists.whatwg.org
> [mailto:whatwg-bounces at lists.whatwg.org] On Behalf Of Mike Wilson
> Sent: Wednesday, October 15, 2008 9:40 PM
> To: whatwg at lists.whatwg.org
> Subject: [whatwg] input type=hidden outside phrasing content
> 
> Would it be possible to have HTML5 allow the insertion of
>   <input type="hidden" ...>
> (or something with the same effect) anywhere in the document?
> 
> This would f ex relieve cases like server-side templating
> wanting to attach hidden state to its generated markup, and
> not having to use complex algorithms to find a suitable spot.
> 
> As this type of element is non-visual this suggestion 
> shouldn't cause any layout problems, but I guess having
> different placement rules for different settings on the same
> element type is, so maybe using <input> is not possible.
> Could HTML5 support adding hidden POSTable state in another 
> way, that wouldn't be subject to placement rules for visual
> content?
> 
> Best regards
> Mike Wilson




More information about the whatwg mailing list