Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pare down menu and command machinery to what will be implemented #237

Closed
domenic opened this issue Oct 7, 2015 · 16 comments · Fixed by #2342
Closed

Pare down menu and command machinery to what will be implemented #237

domenic opened this issue Oct 7, 2015 · 16 comments · Fixed by #2342
Assignees
Labels
removal/deprecation Removing or deprecating a feature

Comments

@domenic
Copy link
Member

domenic commented Oct 7, 2015

Consider all of the following:

Which of these are actually on track to be implemented? I know Gecko has some implementation of menu stuff, although based on an older spec. And Blink has a behind-a-flag implementation of contextmenu, and maybe more.

I am especially interested in <menu type="toolbar"> and the command API. Are they implemented anywhere, or on track to be implemented? If not, we could remove a decent amount of extra complication.

@domenic domenic added the removal/deprecation Removing or deprecating a feature label Oct 7, 2015
@sanjoypal
Copy link

I don't see any point implementing type=toolbar. Javascript libraries are enough for this purpose. Also, I am not sure how useful the command API is. We don't have implementation of command API in blink.

@domenic
Copy link
Member Author

domenic commented Oct 8, 2015

Cool, thanks @sanjoypal. @smaug----, what are your thoughts?

@annevk
Copy link
Member

annevk commented Oct 9, 2015

Paging @sicking.

@sicking
Copy link

sicking commented Oct 9, 2015

I think the whole command stuff is overly complex and better handled by the page itself.

Beyond that, we really need input from developers what they need. For example, I don't think it's useful to implement anything that can't be styled by authors. It simply won't get used.

These days I'm more of the opinion that whatever we do is likely a waste of time. We should just ship web components and let libraries evolve something that authors like. If we need primitives we can always add those, for example aria attributes to support accessibility.

The one thing that might be hard to add primitives for is to enable pages to create a menu that goes outside of the browser/iframe rendering area. That would be the main reason to do anything here at all I think. But again, if it can't be styled, it likely won't get used.

Anyhow, I think starting by asking browser vendors here is the wrong end. I'd recommend reaching out to library/framework authors and get their thoughts.

@domenic
Copy link
Member Author

domenic commented Oct 9, 2015

Well, I generally align with the waste of time idea. But we're on the verge of two interoperable implementations of at least some subset of this, so I want to keep that specced and pare down the rest.

It sounds like at least <menu type="toolbar"> can be removed, and probably the command API. For the rest, I'll probably have to roll up my sleeves and do some testing on Gecko and Blink-with-the-flag-flipped to see what's left.

domenic added a commit that referenced this issue Oct 9, 2015
This removes the command API properties commandType, commandLabel, commandIcon, commandHidden, commandDisabled, and commandChecked. It also removes document.commands. These were not implemented anywhere, and per #237, were not on track to be implemented.

Without these APIs, the command facets Type, ID, Hint, Icon, and Checked State are no longer used by the specification. (The remaining facets, viz. Label, Access Key, Hidden State, Disabled State, and Action, are still used, mostly by the accesskey specification.)
domenic added a commit that referenced this issue Oct 9, 2015
The spec contains a provision wherein <menuitem>s can have command="" attributes which contain the ID of another command that they delegate to. This has not been implemented in either of the two engines which have implemented menu items.

Part of #237.
domenic added a commit that referenced this issue Oct 9, 2015
The spec contains a provision wherein <menuitem>s can have command="" attributes which contain the ID of another command that they delegate to. This has not been implemented in either of the two engines which have implemented menu items.

Part of #237.
@domenic
Copy link
Member Author

domenic commented Oct 9, 2015

Still to-investigate after #244:

  • HTMLButtonElement.prototype.menu / menu content attribute / <button menu="id">. Does this work anywhere? If not, then we should probably get rid of it, as it'll be un-stylable and of limited use. In that case we can rename "popup" to context throughout the spec.
  • <menu type="toolbar">. What actual implementation requirements does the spec give for this? I am beginning to think that all the spec's content on this is basically author/checker facing, in that it tells you that you can combine <menu type="toolbar"> and <li> in various ways as a semantic tool, instead of using <ul> like people often do. If that's the case, we can probably leave it in. More investigation needed.

@annevk
Copy link
Member

annevk commented Oct 10, 2015

  • Note that <button menu> goes with <button type=menu>, the latter of which definitely seems to do something in Firefox.
  • "toolbar" used to be something special, but that got removed. Now it's simply the default value and indicates the element is another list/grouping element of sorts. So yeah, nothing fancy.

domenic added a commit that referenced this issue Oct 14, 2015
This removes the command API properties commandType, commandLabel, commandIcon, commandHidden, commandDisabled, and commandChecked. It also removes document.commands. These were not implemented anywhere, and per #237, were not on track to be implemented.

Without these APIs, the command facets Type, ID, Hint, Icon, and Checked State are no longer used by the specification. (The remaining facets, viz. Label, Access Key, Hidden State, Disabled State, and Action, are still used, mostly by the accesskey specification.)
domenic added a commit that referenced this issue Oct 14, 2015
The spec contains a provision wherein <menuitem>s can have command="" attributes which contain the ID of another command that they delegate to. This has not been implemented in either of the two engines which have implemented menu items.

Part of #237.
@domenic
Copy link
Member Author

domenic commented Jan 27, 2017

Note that <button menu> goes with <button type=menu>, the latter of which definitely seems to do something in Firefox.

@annevk, can you create a live-dom-viewer or jsbin example? I can't reproduce anything working using e.g. the example from the spec: http://jsbin.com/bagosurebu/edit?html,output

@annevk
Copy link
Member

annevk commented Jan 29, 2017

If you render <button type=menu>test</button> you don't get a button, but you get something that looks like a dropdown (that doesn't function). I'm not sure how it works or can be made to work though.

@annevk
Copy link
Member

annevk commented Jan 30, 2017

screen shot 2017-01-30 at 9 54 20 am
Is what I see in Firefox on macOS. type does return "submit".

@smaug----
Copy link

@dpogue
Copy link

dpogue commented Jan 30, 2017

As a web developer, I would love to see <button type="menu" menu="id"> actually supported in some browsers. I feel like supporting <menu type="context"> is missing half its intended functionality if there's no way to show the menu except via right-click.

There's no way to use JavaScript to fully mimic <button type="menu"> because you cannot fake a contextmenu event on the button to present the menu, and <menu type="context"> can't be styled to be visible in the page.

@annevk
Copy link
Member

annevk commented Jan 31, 2017

@smaug---- I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1335337. My concern no longer blocks this bug.

@dpogue that might be worth filing a new issue on. If there's a native thing you cannot emulate there might be more interest in adding something to get there.

@domenic domenic self-assigned this Feb 8, 2017
@domenic
Copy link
Member Author

domenic commented Feb 8, 2017

I'm looking into this more. We can definitely remove <button type="menu">, but once we do that, <menu type="toolbar"> starts looking pretty useless. I started trying to hack together some acceptable CSS to make the spec's example uses of it look reasonable and it's just a mess. I'm going to remove it entirely; authors can use lists and such.

Edit: meh, I guess as long as I don't try to make the spec's examples work, we can leave it as an alternative to <ol> and <ul>.

@zcorpan
Copy link
Member

zcorpan commented Feb 9, 2017

It seems menu type=toolbar as some usage in the wild, so might as well keep it...

httparchive (~500,000 pages): 304 matches
GitHub search: ~20,000 matches

domenic added a commit that referenced this issue Feb 9, 2017
This removes the type="menu" option for buttons, which has wide-reaching
consequences for the menu infrastructure.

It was intended that <menu type="context"> (originally <menu
type="popup">) would be used both for context menus, and for popup menus
triggered by buttons. Only the context menu case was ever implemented
(in Gecko and, behind a flag, in Blink). As such, removing support for
the triggered-by-button case allows us to remove a lot of
now-unnecessary abstraction; for example, we can rename the "popup menu
state" to the "context menu state" to match the type="context" content
attribute. And we can relocate all of the processing model for
constructing menus into the context menu processing model section.
Finally, we can clearly state for authors that the <menu> element has
two distinct uses: for customizing the context menu (type="context"),
and as a semantic alternative to <ul> for a list of commands
(type="toolbar").

This fixes #237, although we still need to keep an eye on the entire
context menu feature since its cross-browser support is on the low side.
zcorpan added a commit to zcorpan/validator that referenced this issue Mar 20, 2017
Since whatwg/html#237 there are almost no
UA requirements for <menu type=toolbar> (basically just reflection),
so there is no reason to warn about its use.
sideshowbarker pushed a commit to validator/validator that referenced this issue Mar 26, 2017
Since whatwg/html#237 there are almost no
UA requirements for <menu type=toolbar> (basically just reflection),
so there is no reason to warn about its use.
alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
This removes the type="menu" option for buttons, which has wide-reaching
consequences for the menu infrastructure.

It was intended that <menu type="context"> (originally <menu
type="popup">) would be used both for context menus, and for popup menus
triggered by buttons. Only the context menu case was ever implemented
(in Gecko and, behind a flag, in Blink). As such, removing support for
the triggered-by-button case allows us to remove a lot of
now-unnecessary abstraction; for example, we can rename the "popup menu
state" to the "context menu state" to match the type="context" content
attribute. And we can relocate all of the processing model for
constructing menus into the context menu processing model section.
Finally, we can clearly state for authors that the <menu> element has
two distinct uses: for customizing the context menu (type="context"),
and as a semantic alternative to <ul> for a list of commands
(type="toolbar").

This fixes whatwg#237, although we still need to keep an eye on the entire
context menu feature since its cross-browser support is on the low side.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
removal/deprecation Removing or deprecating a feature
Development

Successfully merging a pull request may close this issue.

7 participants