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

Nathan Heagy wrote:
> While it is true that authors will want to style their menu buttons it's
> not true that every menu item would need a label. In that case nesting
> <menu> inside its label becomes quite ugly with a menu of menus only
> some of which have labels:
> 
> <menu>
> 	<menulabel>
> 		Foo
> 		<menu>
> 		...
> 		</menu>
> 	</menulabel>
> 	<menu>
> 	...
> 	</menu>
> 	<menulabel>
> 		Foo
> 		<menu>
> 		...
> 		</menu>
> 	</menulabel>
> </menu>

   First of all, my suggestion is that submenus always have an
associated <menulabel>. If the |type| is "popup" (or "context", as Ian
calls it), then the menu doesn't display unless activated by the
associated menu label element. Additionally, a |for| element can be used
to avoid nesting:

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

   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. The name "context" as a menu |type| is more semantic, but less
accurate in non-context-menu cases, such as popup menus and submenus.
The name "popup" is more general, but more presentational.

Received on Tuesday, 13 December 2005 14:29:50 UTC