Bug Tracker

Modify

Ticket #6428 (closed bug: fixed)

Opened 3 years ago

Last modified 14 months ago

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:
Blocking: Blocked by: #6093

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

comment:1 Changed 3 years ago by addyosmani

  • need changed from Review to Patch
  • Priority set to 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 3 years ago by snover

  • Blocked by 6093 added

comment:2 Changed 3 years ago by snover

  • Priority changed from low to high
  • Status changed from new to open
  • Version changed from 1.4.2 to 1.4.3
  • Blocked by 6093 removed
  • Milestone changed from 1.4.3 to 1.5

Caused by #6448.

comment:3 Changed 3 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 3 years ago by snover

#7459 is a duplicate of this ticket.

comment:5 Changed 3 years ago by snover

#3743 is a duplicate of this ticket.

comment:6 Changed 2 years ago by jitter

  • Owner set to jitter
  • Status changed from open to assigned
  • Version changed from 1.4.3 to 1.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 2 years ago by Anton M

  • Status changed from assigned to closed
  • Resolution set to fixed

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

Changeset: 1e4f3c07c70861fc334a0e61080f8bbde0d7d442

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.