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"].
Created attachment 752260 [details] [diff] [review] Make class="hidden" work, rev. 11
r?Neil since Enn is gone for a bit
(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
Last Resolved: 5 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.]
You need to log in before you can comment on or make changes to this bug.