W3C home > Mailing lists > Public > public-html@w3.org > October 2009

Question on Context menus

From: Jeff Schiller <codedread@gmail.com>
Date: Thu, 15 Oct 2009 23:50:41 -0500
Message-ID: <da131fde0910152150n651de1can513c14aedb202cde@mail.gmail.com>
To: HTML WG <public-html@w3.org>
I'm trying to understand the <menu> and <command> elements.

1) None of the examples of <menu> usage in the HTML5 spec show
<command> elements being used, nor does the <menu> element's content
model explicitly mention <command> elements, though " Building
menus and toolbars" does.  Furthermore, the section on the <command>
element does not contain an informative example either.  Can an
example be adding showing a <menu> with <command> children?  Something
along the lines of
http://www.ibm.com/developerworks/library/x-html5/#N10405 Should the
menu's content model be updated to expliclty list <command> elements?

2) The <menu> element's contents are described as either flow content
or a series of <li> elements.  Why are <li> elements explicitly
mentioned? doesn't seem to warrant that (it lumps <li> in
with <label>).  However, I noticed some special treatment of <li>
elements when they contain a <command> and are children of <menu> at
"4.13 Matching HTML elements using selectors"

3) For the second example listed :

<form action="redirect.cgi">
 <menu type="toolbar">
  <label for="goto">Go to...</label>
  <menu label="Go">
   <select id="goto"
           onchange="if (this.options[this.selectedIndex].value)
                     window.location = this.options[this.selectedIndex].value">
    <option value="" selected="selected"> Select site: </option>
    <option value="http://www.apple.com/"> Apple </option>
    <option value="http://www.mozilla.org/"> Mozilla </option>
    <option value="http://www.opera.com/"> Opera </option>
   <span><input type="submit" value="Go"></span>

The processing steps in says that the <label> children should
be iterated, but the label in the above example only has a text
element child, what should be done with it?  It doesn't appear you can
define a command with a label so would "Go to..." get dropped?  I
suspect it should be shown.

4) "Any menu item with no label, or whose label is the empty
string, must be removed" - shouldn't this be "Any non-separator menu
item with no label..." ?

5) "Context menus must not, while being shown, reflect
changes in the DOM; they are constructed as the default action of the
show event and must remain like that until dismissed."

Why is this restriction in place?  It seems arbitrary to me.  Is it
imposing user interface guidelines or ?

If a checkbox is checked while the menu is shown, doesn't that
constitute a change in the DOM (and surely the visual representation
of the menu should also update)
Also, if this requirement is needed, it seems like a better phrase
than "must remain like that" is needed here?  "must only reflect
changes caused by user interaction with the menu until dismissed"?

6) Do we really need eight different ways to define commands?
( I apologize that I haven't read through all 8 cases but
it seems unnecessarily confusing on first skim (though I have no
suggestions for improvement).

7) "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."

It has been said before that the HTML5 spec will not be specifying UA
user interface requirements, but context menus seem to come
dangerously close to that.

Are we saying that the context menu must be displayed on its own?
Could another example of this 'bypassing' be accomplished by a user
agent _appending_ the context <menu> to the UA's default context menu?
 Or showing the context <menu> as a sub-menu of the UA's default
context menu?

Neither of these two options appeal to me as a web app developer
(showing the UA's default context menu as a submenu of my context menu
is ok, I guess).  I'd much rather have more control over the context
menu contents and behavior.  It's what desktop applications and
plugins have had for years.  So wearing my 'web app developer' hat, I
really want this to be a requirement on UAs.

8) Has any browser made progress in actually implementing any of this?
 I would love to have a cross-browser way of specifying context menu
items but I just have no idea how far away that is, realistically.

Jeff Schiller
Received on Friday, 16 October 2009 04:51:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 16:25:38 UTC