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

On Tue, 13 Dec 2005, Matthew Raymond wrote:
> 
> First of all, my suggestion is that submenus always have an associated 
> <menulabel>.

So what do you do when there isn't one?

FWIW, I propose that a menu with no title inside another menu just ends up 
treated as if it had a separator each side. As in:

   <menu ...>
    <command/>
    <menu>
     <command/>
    </menu>
    <command/>
   </menu>

...would be equivalent to:

   <menu ...>
    <command/>
    <hr/>
    <command/>
    <hr/>
    <command/>
   </menu>


> | <menu type="menubar">
> |   <li>
> |     <menulabel for="menu1">Foo</menulabel>
> |     <menu id="menu1" type="popup">
> |       ...
> |     </menu>
> |   </li>
> |   <li>
> |     <a href="frobozz.html">Frobozz</a>
> |   </li>
> |   <li>
> |     <menulabel for="menu2">Bar</menulabel>
> |     <menu id="menu2" type="popup">
> |       ...
> |     </menu>
> |   </li>
> | </menu>

Here's how I'm thinking that would look:

   <menu type="commands">
    <li>
     <menu label="Foo">
       ...
     </menu>
    </li>
    <li>
     <a href="frobozz.html">Frobozz</a>
    </li>
    <li>
     <menu label="Bar">
       ...
     </menu>
    </li>
   </menu>


>    With this model, you can even pull the menus out nesting altogether:
> 
> | <menu type="menubar">
> |   <li><menulabel for="menu1">Foo</menulabel></li>
> |   <li><a href="frobozz.html">Frobozz</a></li>
> |   <li><menulabel for="menu2">Bar</menulabel></li>
> | </menu>
> |
> | <menu id="menu1" type="popup">
> |   ...
> | </menu>
> |
> | <menu id="menu2" type="popup">
> |   ...
> | </menu>

Hmm.

There are several ways we can do this, though they all basically boil down 
to doing the same as in your example -- having an element with an 
attribute that refers to another <menu> element. The real question is 
which element to use: one specifically for this, <menu>, <command>, 
<label>, <a>, or something else?

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

Received on Wednesday, 14 December 2005 15:00:08 UTC