-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Comments
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. |
Cool, thanks @sanjoypal. @smaug----, what are your thoughts? |
Paging @sicking. |
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. |
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 |
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.)
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.
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.
Still to-investigate after #244:
|
|
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.)
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.
@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 |
If you render |
I'm getting very much like normal button, and .type says "submit", in FF. http://searchfox.org/mozilla-central/source/testing/web-platform/tests/html/semantics/forms/the-button-element/button-validation.html |
Where is that coming from. Do we get wrong native styling or something? This should go to some Gecko bug, but |
As a web developer, I would love to see There's no way to use JavaScript to fully mimic |
@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. |
I'm looking into this more. We can definitely remove 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 |
It seems httparchive (~500,000 pages): 304 matches |
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.
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.
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.
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.
Consider all of the following:
<button menu="id">
<menu type="contextmenu">
functionality (renamed in Rename <menu type=popup> to <menu type=context> #235)<menu type="toolbar">
functionalitydocument.commands
(removed in Remove some unimplemented menu and command features #244)<menuitem command="">
(removed in Remove some unimplemented menu and command features #244)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.The text was updated successfully, but these errors were encountered: