Closed Bug 677463 Opened 9 years ago Closed 9 years ago
<menuitem>.label should return .text
Content if there's no label content attribute
This is a followup bug from 617528. Just in case the <menuitem> element won't become void element (bug 676236 and http://www.w3.org/Bugs/Public/show_bug.cgi?id=13608) For now, we have to use this syntax: <menu> <menuitem label="Label"></menuitem> </menu> it would be nice to support also: <menu> <menuitem>Label</menuitem> </menu>
Assignee: nobody → Jan.Varga
Is there any reason why we don't want to keep consistency with option.label?
Version: unspecified → Trunk
do you mean the compress whitespace feature ?
Yeah, I was proposing to handle menuitem.label like option.label. The patch adds some tiny inconsistencies. (But I don't think we need to add .text to the public menuitem API)
ok, I'll redo it
Comment on attachment 552034 [details] [diff] [review] patch v2 >+ <menuitem>Item w/ textContent</menuitem> I put a space before "Item w/ textContent" to improve automatic testing. > return rv; > } > >- > NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLMenuItemElement, Type, type, I put back the empty line.
Comment on attachment 552034 [details] [diff] [review] patch v2 Would be great if you could add still some tests which make sure that option.label handling stays the same as menuitem.label. Something like var o = document.createElement("option"); var m = document.createElement("menuitem"); is(o.label, m.label, "Should have same labels"); o.textContent = " "; is(o.label, m.label, "Should have same labels"); o.textContent = "foo"; isnot(o.label, m.label, "Shouldn't have same labels"); m.textContent = "foo"; is(o.label, m.label, "Should have same labels"); m.label = "bar"; isnot(o.label, m.label, "Shouldn't have same labels"); o.label = "bar"; is(o.label, m.label, "Should have same labels");
Attachment #552034 - Flags: review?(Olli.Pettay) → review+
sure, I'll add it
Jan, is this bug fixed?
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Documentation updated: https://developer.mozilla.org/en/XUL/menuitem https://developer.mozilla.org/en/XUL/Attribute/label And updated Firefox 8 for developers.
uhm, this bug is about html <menuitem>, not the xul one
I'm confused by this. There's no <menuitem> element in the specification, so where does this come from?
We think that the spec should have menuitem. http://www.w3.org/Bugs/Public/show_bug.cgi?id=13608 If you document this, make sure to mention that spec doesn't have menuitem.
Removing doc-needed; documentation for this will be tracked by bug 676236 instead.
You need to log in before you can comment on or make changes to this bug.