[whatwg] Menus, fallback, and backwards compatibility: ideas wanted

Ian Hickson ian at hixie.ch
Tue Dec 13 19:33:56 PST 2005


On Mon, 28 Nov 2005, Ian Hickson wrote:
> On Mon, 28 Nov 2005, Lachlan Hunt wrote:
> > 
> > How about this, or some variation of:
> > 
> > <form ...>
> > <menubar>
> >   <li><button type="submit" for="foo" name="menu">Foo</button>
> >       <select id="foo" name="foo">
> >         ...
> >       </select>
> >   </li>
> >   <li><button type="submit" for="bar" name="menu">Bar</button>
> >       <select id="bar" name="bar">
> >         ...
> >       </select>
> >   </li>
> > </menubar>
> > </form>
> > 
> > -- Behaviour in Current UAs --
> > 
> > * User selects item from select menu, button submits it.
> > * Con: Submit button occurs before form control, though they typically occur
> > after, which may be bad for usability in current/older UAs (could be changed
> > with CSS, I guess).
> > * Very good support for UAs without JS (assuming the server side processing
> > has been implemented to support it)
> 
> Interesting idea. I like the non-JS fallback potential. Pity about the 
> <menubar> being necessary to get the <select> to disappear, but I guess 
> we need that... It's unfortunate about the button being first, too. I 
> guess we could change that if we say that in the new world in an <li> any 
> <select>s are ignored and just the <button> is looked for... Hmm.

Turns out the above is a lot harder to specify than I expected.

The problem is that we want to support this kind of case:

   <menu type="commands">
    <input type="submit">
    <input type="reset">
   </menu>

...to create a menu with two actions (submit and reset, in this case), and 
we want to support this kind of case:

   <menu type="commands">
    <select>
     <option/>
     <option/>
     <option/>
    </select>
   </menu>

...as an equivalent of:

   <menu type="commands">
    <hr/>
    <input type="radio"/>
    <input type="radio"/>
    <input type="radio"/>
    <hr/>
   </menu>

So logically, this:

   <menu type="commands">
    <select>
     <option/>
     <option/>
     <option/>
    </select>
    <input type="submit">
   </menu>

...would be equivalent to:

   <menu type="commands">
    <hr/>
    <input type="radio"/>
    <input type="radio"/>
    <input type="radio"/>
    <hr/>
    <input type="submit">
   </menu>

...and not:

   <menu type="commands">
    <input type="button">
    <input type="button">
    <input type="button">
   </menu>

...which is roughly want we actually want.

Bummer.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list