[whatwg] Comment on Forms 2.0: OPTGROUP Nesting

levik levikcom at gmail.com
Thu Jul 1 08:04:17 PDT 2004


> I did some research into the matter and it turns out that no existing
> browser correctly parses nested OPTGROUPs. They basically all parse
> OPTGROUP as if it had an optional end tag. So it wouldn't be possible to
> allow nested OPTGROUPs, sadly.
> 

Why is that a problem?

Say your code has

<SELECT>
      <OPTGROUP label="books">
              <OPTGROUP label="fiction">
                     <OPTION>Treasure Island</OPTION>
              </OPTGROUP>
              <OPTGROUP label="nonfiction">
                     <OPTION>Art of War</OPTION>
              </OPTGROUP>
      </OPTGROUP>

     ....     

</SELECT>

The compliant browser would render

[BOOKS >]
      [fiction >]
           [Treasure Island]
      [nonfiction >] 
           [Art of War]
...

while an older browser would show

/BOOKS/
/fiction/
Treasure Island
/nonfiction/
Art of War
...

I don't see a problem with that - it looks like perfectly graceful
degradation to me...



More information about the whatwg mailing list