Closed
Bug 676236
Opened 14 years ago
Closed 3 years ago
Add support for the <menuitem> element to the HTML parser
Categories
(Core :: DOM: HTML Parser, enhancement)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: janv, Assigned: hsivonen)
References
Details
(Keywords: dev-doc-needed)
Attachments
(3 files)
|
32.77 KB,
patch
|
hsivonen
:
review+
|
Details | Diff | Splinter Review |
|
27.14 KB,
patch
|
hsivonen
:
review+
|
Details | Diff | Splinter Review |
|
10.70 KB,
patch
|
Details | Diff | Splinter Review |
We need this for bug 617528. We decided to replace <command> with <menuitem>
The new syntax is:
<menu type="context">
<menuitem type="" label="" ...>
...
</menu>
The behavior of <menuitem> is similar to <command>. However there is no need to use <menuitem> in <head>
There are plans to upgrade the syntax in future to:
<head>
<command id="foo" type="" label="" ...>
</head>
<body>
<menu type="context">
<menuitem command="foo">
</menu>
</body>
| Reporter | ||
Comment 1•14 years ago
|
||
Attachment #550371 -
Flags: review?(hsivonen)
| Assignee | ||
Comment 2•14 years ago
|
||
Comment on attachment 550371 [details] [diff] [review]
patch v1
(In reply to comment #0)
> We need this for bug 617528. We decided to replace <command> with <menuitem>
Decided? Why? Who is "we"? Why hasn't this been raised at the WHATWG or the W3C HTML WG?
The days of browser vendors adding HTML parsing behaviors without coordinating through the spec are supposed to be over. It's painful (see www.w3.org/Bugs/Public/show_bug.cgi?id=13113) but coordinating through the spec is the right thing to do.
Attachment #550371 -
Flags: review?(hsivonen) → review-
| Reporter | ||
Comment 3•14 years ago
|
||
| Assignee | ||
Updated•14 years ago
|
Comment 4•14 years ago
|
||
Before the menuitem gets spec'ed, we should #ifdef/pref the code, IMO.
| Assignee | ||
Comment 5•14 years ago
|
||
Comment on attachment 550371 [details] [diff] [review]
patch v1
r=me on the condition that the lines
case MENUITEM:
are #ifdefed off by default when landing on trunk ahead of the spec making <menuitem> a void element.
(I'll figure out what to do about #ifdefs and the translator when I return from vacation.)
Attachment #550371 -
Flags: review- → review+
| Reporter | ||
Comment 6•14 years ago
|
||
I'm updating and testing a patch with the ifdefs
| Reporter | ||
Comment 7•14 years ago
|
||
Assignee: nobody → Jan.Varga
| Assignee | ||
Comment 8•14 years ago
|
||
Comment on attachment 550678 [details] [diff] [review]
Patch with ifdef'ed code
r=me assuming that the define continues to be off by default until the spec changes to have menuitem as a void element.
Attachment #550678 -
Flags: review+
| Reporter | ||
Comment 9•14 years ago
|
||
| Assignee | ||
Comment 10•14 years ago
|
||
smaug told me that <menuitem> is no longer meant to be a void element. Can we back this out now?
Comment 11•14 years ago
|
||
| Reporter | ||
Comment 12•14 years ago
|
||
Updated•14 years ago
|
Keywords: dev-doc-needed
Comment 13•14 years ago
|
||
Is this still in progress? I was under the impression we'd implemented this already, based on bug 677463. Can I get a clarification as to the status here before I document it? Thanks!
Comment 14•14 years ago
|
||
OK, when time comes to document this, I need to reference bug 677463 to be sure that behavior is covered.
Comment 15•12 years ago
|
||
According to [1] and the spec[2], menuitem is a void element. So the pref can be flipped now, I think.
Anything else left to do in this bug?
[1] http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-December/038472.html
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#the-menuitem-element
Flags: needinfo?(Jan.Varga)
| Reporter | ||
Comment 16•12 years ago
|
||
Well, yes, but it's not just the pref. All the tests need to be updated to use just <menuitem label="...">
Flags: needinfo?(Jan.Varga)
| Reporter | ||
Comment 17•12 years ago
|
||
initial patch (more work needs to be done)
| Reporter | ||
Comment 18•12 years ago
|
||
Hm, trying to clear the needinfo flag, sorry for the spam.
Flags: needinfo?(Jan.Varga)
Comment 20•10 years ago
|
||
It would be good to get input on this spec issue: https://github.com/whatwg/html/issues/234#issuecomment-146335204
Comment 21•9 years ago
|
||
Based on the link in comment #20, the spec ended up changing such that <menuitem> is not void, but is <option>-like (and no longer in the special category).
smaug, I can't quite tell if that means Firefox now handles <menuitem> correctly, or if there are still differences which need to be addressed. Can you see anything obvious?
At any rate I'm guessing we might as well close this bug as INVALID, and file a follow-up to remove the few lines of code which add the build option for making <menuitem> a void element.
Flags: needinfo?(bugs)
Comment 22•9 years ago
|
||
https://github.com/whatwg/html/issues/234 is still open, so I don't really understand what has happened in the spec.
I'd be ok to make us work closer to <option> if that is what the spec and other browsers will have too.
If you want to do some parser changes, ask hsivonen to review ;)
Flags: needinfo?(bugs)
Comment 23•9 years ago
|
||
Henri, could you take a look at whether something needs to be done here.
The spec bug was closed but it is still a bit unclear to me what actually got changed.
(some times I hate github making it so hard to follow changes)
Flags: needinfo?(hsivonen)
Comment 24•9 years ago
|
||
The spec changed from void to parse "like <option>", with optional end tag.
Processing model changes:
https://github.com/whatwg/html/commit/8fdccb55e40a36449ae6011f9960cb09c1da0db7
Parser changes:
https://github.com/whatwg/html/commit/5e49a20874fabef620bf7ea0be7534c73fbd58c4
https://github.com/whatwg/html/commit/2999aa01438bdef11ba10aef82b775293efbef79
HTH,
| Assignee | ||
Comment 25•9 years ago
|
||
I'll take a look.
Comment 26•9 years ago
|
||
Do you think you'll have a chance to take a look at this anytime soon, hsivonen?
| Assignee | ||
Comment 27•9 years ago
|
||
| Assignee | ||
Comment 28•9 years ago
|
||
Looking now. See the previous comment for a try push.
Flags: needinfo?(hsivonen)
| Assignee | ||
Comment 29•9 years ago
|
||
| Assignee | ||
Updated•9 years ago
|
Assignee: jvarga → hsivonen
| Assignee | ||
Comment 30•9 years ago
|
||
| Assignee | ||
Comment 31•9 years ago
|
||
| Assignee | ||
Comment 32•9 years ago
|
||
Which other browsers have implemented this spec change?
Flags: needinfo?(zcorpan)
Comment 33•9 years ago
|
||
None yet. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4740
https://bugs.chromium.org/p/chromium/issues/detail?id=412945 is the relevant issue for Chromium.
It is implemented in https://github.com/inikulin/parse5 though.
Flags: needinfo?(zcorpan)
Comment 34•8 years ago
|
||
These are now merged:
https://github.com/whatwg/html/pull/2319
https://github.com/html5lib/html5lib-tests/pull/88
Comment 35•8 years ago
|
||
Per https://github.com/whatwg/html/issues/2730 this should probably be wontfixed.
Comment 36•8 years ago
|
||
https://github.com/whatwg/html/pull/2319 made menuitem parse like an unknown element.
If there are ifdefs, I suppose they can be removed.
Updated•6 years ago
|
Type: defect → enhancement
Updated•3 years ago
|
Severity: normal → S3
Comment 37•3 years ago
|
||
Feature was removed in bug 1372276
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•