This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 24972 - menuitem as void element
Summary: menuitem as void element
Status: RESOLVED MOVED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 editorial
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard: whatwg-resolved
Keywords:
: 24754 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-07 17:51 UTC by Andrea Rendine
Modified: 2016-10-25 09:28 UTC (History)
6 users (show)

See Also:


Attachments

Description Andrea Rendine 2014-03-07 17:51:53 UTC
Please consider removing <menuitem> from the list of void elements. It is a new element and its context is in a list of other menuitem elements. When it will be used (either thanks to a polyfill or after starting implementation) it isn't going to be backward compatible, as browsers fail to interpret it as void element and end up nesting subsequent menuitems.
So instead of having
<menu>
 + <menuitem></menuitem>
 + <menuitem></menuitem>
 + <menuitem></menuitem>
</menu>

user agents will interpret
<menu>
 + <menuitem>
    + <menuitem>
       + <menuitem></menuitem>
      </menuitem>
   </menuitem>
</menu>

Moreover, this structure would allow authors to specify the text of the command inside the element itself, rather than as attribute. It could be suggested as alternative, in a manner similar to <option> tag.
Comment 1 Andrea Rendine 2014-03-11 00:28:39 UTC
*** Bug 24754 has been marked as a duplicate of this bug. ***
Comment 2 Andrea Rendine 2014-03-11 00:32:43 UTC
I hope that now editors will really consider the following:
 1. <menuitem> should not be a void element, so that a normal open-closing tag syntax will help legacy UAs to treat it properly without nesting subsequent <menuitem>s
 2. additionally, once it were made a normal element, its content model could also change from "empty" to "text", allowing authors to specify the label of the command as textContent avoiding as an alternative to @label.
Comment 3 Andrea Rendine 2014-04-24 23:56:26 UTC
Is it possible to receive an answer in either way?
 a. The spec is considered to be correct, backward compatibility is not an issue, the element itself is not rendered unless user agents support it (even if its function can be achieved no matter the actual support) and the label cannot be given by the element's content. [this is poor coding language IMO]
If all above considerations are true, then the validator fails (it does not consider menuitem as void)
 OR
 b. The spec is not correct:
    1. <menuitem> MUST have a closing tag in order to prevent a messy DOM
    2. and possibly the content model for <menuitem> is "text", so that the label for the control can be given by the element's textContent. Consider that menu commands rely on script because as of now no standard commands have been defined. So, the menu can (and should) be made visible somehow also to legacy UA.

Please consider.
Comment 4 Travis Leithead [MSFT] 2016-04-27 16:30:22 UTC
HTML5.1 Bugzilla Bug Triage: Moved to Github issue: https://github.com/w3c/html/issues/274 to get closure on this.

To file additional issues please use the W3C HTML5 Issue tracker: https://github.com/w3c/html/issues/new Thanks!