#11706 closed bug (fixed)
`.has()` fails on document fragments
Reported by: | john.firebaugh | Owned by: | Rick Waldron |
---|---|---|---|
Priority: | low | Milestone: | 1.8 |
Component: | traversing | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
While :has
works correctly, .has()
returns an empty selection whenever the selection is a document fragment. Once the fragment is inserted in the document, it works as expected.
Test case:
$('<div><span></span></div>').has('span').length
Expected: 1 Actual: 0
Change History (6)
comment:1 Changed 11 years ago by
Owner: | set to Rick Waldron |
---|---|
Status: | new → assigned |
comment:2 Changed 11 years ago by
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
comment:3 Changed 11 years ago by
Sorry, what?
I just ran fiddle test case in Chrome 18, Firefox 12, and Safari 5.1. All failed.
Please reopen.
comment:4 Changed 11 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Confirmed from the fiddle.
comment:5 Changed 11 years ago by
Component: | unfiled → traversing |
---|---|
Milestone: | None → 1.8 |
Priority: | undecided → low |
Resolution: | → fixed |
Status: | reopened → closed |
This is working in master. rwaldron switched to jQuery edge before testing, which is why he didn't see the failure.
Note: See
TracTickets for help on using
tickets.
This is not even possible, as we have unit tests that would catch such a regression.
Also, your test case doesn't support your claim.