Bug Tracker

Modify

Ticket #7334 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

children

Reported by: nefiga@… Owned by: nefiga@…
Priority: undecided Milestone: 1.5
Component: selector Version: 1.4.3
Keywords: Cc:
Blocking: Blocked by:

Description

The selector (* > *) behaves differently than $().children().children()

I don't believe this is a duplicate of #7251 but I could be wrong. I've created a test case here:  http://jsfiddle.net/z6XBx/10/

Change History

comment:1 Changed 3 years ago by rwaldron

  • Owner set to nefiga@…
  • Status changed from new to pending
  • Component changed from unfiled to selector

Can you reduce your test case to more clearly show the issue

Thanks!

comment:2 Changed 3 years ago by nefiga@…

  • Status changed from pending to new

I've simplified it somewhat, don't know how I can get much simpler than this.

 http://jsfiddle.net/z6XBx/12/

comment:3 Changed 3 years ago by jitter

Further  reduced the testcase

I don't know if this is actually a bug. As children( selector ) is supposed to return only immediate children off the elements in the jQuery object.

I think jQuery is correct in returning nothing for .children( 'ul > li' ) as no immediate child can satisfy this selector.

Assume some ul is an immediate child of some element in the jQuery object. This selector basically tells jQuery to do the following.

Give me all immediate children of the element in question which are of type ul and are at the same time of type li and an immediate child of an ul which is itself an immediate child of the element in question.

This is contradictory.

Version 1, edited 3 years ago by jitter (previous) (next) (diff)

comment:4 Changed 3 years ago by anonymous

Okay makes sense. Thanks for the explanation.

comment:5 Changed 3 years ago by SlexAxton

  • Status changed from new to closed
  • Resolution set to invalid

Yes. Those two are not functionally equivalent, because the initial * matches every element in the dom, not just the top level.

Thanks for the report. Happy jQuery-ing!

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.