Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#6428 closed bug (fixed)

IE 6 & 7 selector bug when using complex selector

Reported by: emartin24 Owned by: jitter
Priority: high Milestone: 1.5
Component: selector Version: 1.5rc1
Keywords: ie7, ie6, selector Cc:
Blocked by: #6093 Blocking:

Description

I have a form that uses array notation in the input element name attribute. I am able to select a particular element with the following:

  jQuery('input[type=hidden][name=ruleDto\\.operators\\[0\\]\\.operands\\[1\\]\\.descr]');

If I add an ID selector to the beginning, it no longer works in IE6 or IE7:

  jQuery('#one input[type=hidden][name=ruleDto\\.operators\\[0\\]\\.operands\\[1\\]\\.value]');

In order to get the correct results, I am able to use the filter function:

  els = $$('#one input:hidden').filter(function (idx) {
    return this.name === 'ruleDto.operators[0].operands[1].value';
  });

I've placed sample code online: http://www.ericmmartin.com/code/jquery/selector/

Possibly related to #5040

Change History (8)

comment:1 Changed 9 years ago by addyosmani

need: ReviewPatch
Priority: low

The provided test cases work as follows in IE based browsers:

IE 9: passes IE 8: passes IE 7: fails IE 6: fails

As mentioned, a work-around is available for this type of behaviour and given that there are currently more critical bugs to be fixed in the core, I am flagging this for a low-priority patch.

comment:2 Changed 9 years ago by snover

Blocked by: 6093 added

comment:2 Changed 9 years ago by snover

Blocked by: 6093 removed
Milestone: 1.4.31.5
Priority: lowhigh
Status: newopen
Version: 1.4.21.4.3

Caused by #6448.

comment:3 Changed 9 years ago by snover

Blocked by: 6093 added

(In #6093) test case with explanation:

First and third test cases should fail everywhere. qSA throws a SYNTAX_ERR because they are not valid, which causes Sizzle to pick them up and try again, and it matches because it is parsing the strings incorrectly.

Second and forth test cases should pass everywhere. IE6-7 do not have qSA support they go to Sizzle, and since Sizzle is parsing the strings wrong they fail in IE6-7.

comment:4 Changed 9 years ago by snover

#7459 is a duplicate of this ticket.

comment:5 Changed 9 years ago by snover

#3743 is a duplicate of this ticket.

comment:6 Changed 9 years ago by jitter

Owner: set to jitter
Status: openassigned
Version: 1.4.31.5rc1

test case

Still not fixed. Quoted/unquoted escaped attribute selectors fail in browser with no qSA if an element-rooted query is made.

pull request

comment:8 Changed 9 years ago by Anton M

Resolution: fixed
Status: assignedclosed

Pull over tests from Sizzle. Fixes #3729. Fixes #6428.

Changeset: 1e4f3c07c70861fc334a0e61080f8bbde0d7d442

Note: See TracTickets for help on using tickets.