[whatwg] Looking at menus in HTML5...

Ian Hickson ian at hixie.ch
Tue Aug 7 19:36:46 PDT 2007


On Tue, 7 Aug 2007, Andrew Fedoniouk wrote:
> > On Tue, 7 Aug 2007, Andrew Fedoniouk wrote:
> > > 
> > > Pure text? Why?
> > 
> > With HTML5 we're following a design principle of not biting off more 
> > than we can chew at once -- so the initial design is intended to be 
> > very conservative.
> 
> I think that
> 
> <menu type="context-menu">
>   <li>Copy<kbd>Ctrl-C</kbd></li>
> </menu>
> 
> is conservative enough as it allows me to define typical menus.

Indeed, as I mentioned earlier the shortcut key feature is currently 
missing but will be added when we figure out the solution for the more 
general accesskey issue.


> All modern UAs have their own implementation of menus so they already 
> can "chew" menu items with markup and styling.

The intent is to allow implementations to use native OS menu support.


> Otherwise <menu> should not use <li> but <option> or so. But this will 
> not be backward compatible.

Well, as currently specced we can use <select> and thus <option>s in 
<menu>s already.


> > > As you may see above, Windows XP/Vista, Gnome and KDE4 all use rich 
> > > menus. So it is not RiscOS only.
> > 
> > The three menus you mention above are all examples of a specific OS 
> > launcher menu, they're not context menus. The feature under discussion 
> > is currently intentionally limited in scope to just context menus.
> 
> Do you have definitions on what is context menu and what is not?

Sure, it's the type of menu you get (for instance) when control-clicking 
on the Mac or right-clicking on Windows, as opposed to the kind of menu 
you get from a menubar, menu button, or OS application launchers.


> Do you have any examples of exisiting web applications that will benefit 
> significantly from having that flat puristic context menus?

Web applications widely have hacks for context menus today. For example, 
Google Maps and Live Search maps have simple context menus. Today they 
have to have non-native implementations that don't really work well and 
that interfere with the browser's features.


> So where this context menu feature request comes from?

It's a frequent request from Web app developers.


> BTW: Everything there works already without any HTML5.

Excellent!


> I believe that HTML5 goal is to provide more or less generic solution 
> that can serve as simple menus *and* cover the whole class of popup 
> elements and lightweight dialog needs.

Nope, that isn't the goal. We're aiming at 80% with the intent to keep the 
basic language simple and approachable.


> Otherwise we will end up with spending rest of our life adding that 
> endless <menu>, <rich-menu>, <popup>, <dialogue>, <monologue>, <novel>, 
> <poem>, <haiku>, whatever....

For things that HTML can't handle, authors have to fall back on CSS and 
JS, and (in the future) XBL, as I mentioned. I don't think we will ever 
need to specifically have a <haiku> element, for instance.


> > While your enthusiasm for flexibility is commendable, we are 
> > intentionally limiting the speed at which we add features to HTML5 to 
> > prevent feature creep. Feature creep is often the cause of poor 
> > quality implementations. We have to move slowly so that we can take 
> > into account implementation experience from multiple vendors 
> > (especially those with significant market share), and so that we can 
> > make sure we are addressing the most desired features instead of only 
> > the most unusual ones.
> 
> It is not an enthusiasm but rather frustration of where this thing is 
> moving. As I said, proposed <menu> is not a solution. Just a cosmetic 
> and limited feature that will solve some pretty small number of cases. 
> If any.

I would argue that what we have in the spec now solves a good 80% of all 
needs for menus and tool bars. I don't think most people need pie menus, 
application launchers, complex markup in menus, etc.


> In any case I would like to know examples of existing web applications 
> that such non-styleable menus.

I gave two earlier; Google Docs and Spreadsheets is another. Context menus 
that are "non-styleable" are used in almost all desktop applications, so 
any Web analogue to desktop applications could well want to use one. We 
frequently get requests for how to do this.

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