[whatwg] Thoughts on Context and Popup Menus for Web Applications 1.0

Ian Hickson ian at hixie.ch
Thu Jan 5 17:52:25 PST 2006

On Wed, 10 Nov 2004, Matthew Raymond wrote:
> Lachlan Hunt wrote:
> > Matthew Raymond wrote:
> > 
> > > I have a few suggestions for menus outside the context of a menu 
> > > bar. The first is a suggestion for context menus (menus that, in 
> > > Windows, show up when you right-click on something). The second is 
> > > for popup menus (menus that appear when you click on or activate a 
> > > control, et cetera).
> > 
> > We should not give authors the power to override the UAs context menu. 
> > Enough authors already try with JavaScript which more often than not 
> > just creates usability problems.

Agreed. I have added the following to the spec:

# User agents may provide means for bypassing the context menu processing 
# model, ensuring that the user can always access the UA's default context 
# menus. For example, the user agent could handle right-clicks that have 
# the Shift key depressed in such a way that it does not fire the 
# contextmenu event and instead always shows the default context menu.

> I know what you mean. I remember using a company website where you 
> couldn't paste into a text field for a search because the webmaster had 
> apparently decided that the clipboard was the work of the devil.


> > Thankfully, descent browsers now prevent authors blocking/overriding 
> > the context menu, let's not make it easier for them.
> Who's to say the UA couldn't just append the menu to the context menu?
> Or append the browser context menu as a submenu? Or provide a context 
> button as part of the control?

Good idea. Added:

# The user agent may also provide access to its default context menu, if 
# any, with the context menu shown. For example, it could merge the menu 
# items from the two menus together, or provide the page's context menu as 
# a submenu of the default menu.

> Or allow access to the context menu when an additional key is pressed 
> (such as alt + [right-click])?

See above.

> The UA vendors aren't stupid. Let's provide a semantic and let them 
> figure the behavior out for themselves.

In general it takes a few versions with users complaining before the UAs 
get the right balance, but sure. :-)

> > I'm not objecting to having elements specifically for menus, as long 
> > as their names are semantic (unlike <popup> which also suggests its 
> > presentation), I object to the method you have proposed for accessing 
> > the menu.  The method should not be defined like that, but should be 
> > left to UA and the presentation (CSS) and sometimes behavour 
> > (JavaScript) layers to determine.
> Then simply change "popup" to "menu". Simple enough. I'm not married to 
> the word "popup"; I'm simply trying to distinguish it from a context 
> menu.

Currently I have used the words "popup" and "toolbar" (on the type="" 
attribute of the <menu> element, because they were the only words I could 
find that were easy to type and understand.

I'm open to better ideas, though.

> > > The deal breaker for me, though, is that you can't tell what the 
> > > hyperlink does just by looking at it. For instance, what does the 
> > > following do?...
> > > 
> > > | <a href="#guess">Does this point to a menu?</a>

I agree. I've removed this feature from the spec. It was stupid.

> > >    Now, figure out what this does:
> > > 
> > > | <button popup="obvious">This displays a popup menu.</button>
> > 
> > That will only display a popup for visual UAs, which is why I object 
> > to the name popup for the attribute and element.  In UAs that don't 
> > support popups, the text is meaningless.  It provides no information 
> > about its purpose or what information can be accessed by activating 
> > it.
> Are you honestly trying to tell me that you don't think popup menus can 
> be done in text mode?!? How is it we can do menus in text mode but not 
> popups? Remember that by "popup", I mean a method of accessing a menu by 
> activating or clicking on a control. If you don't like the name "popup" 
> then fine, but I don't see while the underlying principle of activating 
> a menu with a button or other control is impossible in text mode UAs.

Yeah, I don't really understand here. Popup menus in text mode have been 
possible for decades...

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