[whatwg] Comment on Forms 2.0: OPTGROUP Nesting

> 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...

Received on Thursday, 1 July 2004 08:04:17 UTC