Closed Bug 874514 Opened 12 years ago Closed 12 years ago

Make class="hidden" behave the same as hidden="true" for XUL elements

Categories

(Core :: XUL, defect, P2)

x86_64
Windows 7
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: benjamin, Assigned: benjamin)

Details

Attachments

(1 file)

In working on the plugin doorhanger and I'd really like to be able to use class="hidden" instead of hidden="true" on some of the XUL elements. I have a patch which treats .hidden just like [hidden="true"].
Attachment #752260 - Flags: review?(neil)
r?Neil since Enn is gone for a bit
Priority: -- → P2
(In reply to Benjamin Smedberg [:bsmedberg] from comment #0) > In working on the plugin doorhanger and I'd really like to be able to use > class="hidden" instead of hidden="true" on some of the XUL elements. Why?
Mostly because I have a inbred hate for the hidden="true" selector, which is inefficient compared with class-matching selectors. Also because I was already using .classList.add for tweaking other classes on the same objects, and it became a lot more readable to use classes than mucking with the attributes.
Those don't seem like very strong arguments to me, and adding such a generic class name to xul.css seems likely to cause compatibility issues. For XUL elements, you can set .hidden = true, instead of using setAttribute (http://hg.mozilla.org/mozilla-central/annotate/daf809df7936/content/xul/content/src/nsXULElement.cpp#l1410).
Ah, I didn't know that, I thought it had to be in XBL. I'd love to eventually stop using the attribute, but for my scripting purposes I guess the .hidden property works ;-)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
Comment on attachment 752260 [details] [diff] [review] Make class="hidden" work, rev. 11 [I was minded to cancel (if not deny) the review anyway, for much the same reason as has already been discussed.]
Attachment #752260 - Flags: review?(neil)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: