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

RESOLVED WONTFIX

Status

()

P2
normal
RESOLVED WONTFIX
6 years ago
6 years ago

People

(Reporter: benjamin, Assigned: benjamin)

Tracking

Trunk
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
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"].
(Assignee)

Comment 1

6 years ago
Created attachment 752260 [details] [diff] [review]
Make class="hidden" work, rev. 11
Attachment #752260 - Flags: review?(neil)
(Assignee)

Comment 2

6 years ago
r?Neil since Enn is gone for a bit
(Assignee)

Updated

6 years ago
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?
(Assignee)

Comment 4

6 years ago
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).
(Assignee)

Comment 6

6 years ago
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
Last Resolved: 6 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.