Ticket #1960 (closed enhancement: wontfix)
Name selectors should delegate to document.getElementsByName
| Reported by: | sil | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.2.4 |
| Component: | core | Version: | 1.2.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The selector $("*[@name=foo]") should delegate to document.getElementsByName("foo"), since getElementsByName is natively implemented and therefore faster. (This assumes that you can recognise this selector type fast enough that it's worth checking for it to do the delegation, of course.)
Attachments
Change History
comment:2 Changed 5 years ago by joern
Both patches break "selector module: attributes" test 19. and 20., related to :not()
comment:3 Changed 5 years ago by flesler
I made a few attempts but it just fails when doing :not. I restricted it to only positive filters, see if this passes, I g2g, I'll try to test this myself :)
comment:4 Changed 5 years ago by joern
- Status changed from new to closed
- Resolution set to fixed
Fixed in [5343].
comment:5 Changed 5 years ago by arrix
- Status changed from closed to reopened
- Resolution fixed deleted
document.getElementsByName can only retrieve elements in the document tree. see #2787
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


I did a quick benchmark, the page had 533 elements, 7 of them matched the name. The call was
$('[name=foo]');Results: