Closed
Bug 677463
Opened 14 years ago
Closed 14 years ago
<menuitem>.label should return .textContent if there's no label content attribute
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla8
People
(Reporter: janv, Assigned: janv)
References
Details
Attachments
(1 file, 1 obsolete file)
|
10.31 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
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 | ||
Comment 2•14 years ago
|
||
Attachment #551690 -
Flags: review?(Olli.Pettay)
Comment 3•14 years ago
|
||
Is there any reason why we don't want to keep consistency with option.label?
Version: unspecified → Trunk
| Assignee | ||
Comment 4•14 years ago
|
||
do you mean the compress whitespace feature ?
Comment 5•14 years ago
|
||
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)
| Assignee | ||
Comment 6•14 years ago
|
||
ok, I'll redo it
| Assignee | ||
Comment 7•14 years ago
|
||
Attachment #551690 -
Attachment is obsolete: true
Attachment #551690 -
Flags: review?(Olli.Pettay)
Attachment #552034 -
Flags: review?(Olli.Pettay)
| Assignee | ||
Comment 8•14 years ago
|
||
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 9•14 years ago
|
||
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+
| Assignee | ||
Comment 10•14 years ago
|
||
sure, I'll add it
| Assignee | ||
Comment 11•14 years ago
|
||
Comment 12•14 years ago
|
||
Jan, is this bug fixed?
Updated•14 years ago
|
Keywords: dev-doc-needed
| Assignee | ||
Comment 13•14 years ago
|
||
yes, fixed
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Updated•14 years ago
|
Target Milestone: mozilla7 → mozilla8
Comment 14•14 years ago
|
||
Documentation updated:
https://developer.mozilla.org/en/XUL/menuitem
https://developer.mozilla.org/en/XUL/Attribute/label
And updated Firefox 8 for developers.
Keywords: dev-doc-needed → dev-doc-complete
| Assignee | ||
Comment 15•14 years ago
|
||
uhm, this bug is about html <menuitem>, not the xul one
Comment 16•14 years ago
|
||
Oops. Undoing that stuff, will try again. :)
Keywords: dev-doc-complete → dev-doc-needed
Comment 17•14 years ago
|
||
I'm confused by this. There's no <menuitem> element in the specification, so where does this come from?
Comment 18•14 years ago
|
||
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.
Comment 19•14 years ago
|
||
Removing doc-needed; documentation for this will be tracked by bug 676236 instead.
Keywords: dev-doc-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•