Side navigation
#7234 closed bug (duplicate)
Opened October 18, 2010 09:00AM UTC
Closed July 12, 2011 04:16PM UTC
Last modified September 27, 2011 04:04AM UTC
$(selector).not(':has[attribute]') don't work in IE 6-9
Reported by: | pinal | Owned by: | john |
---|---|---|---|
Priority: | blocker | Milestone: | |
Component: | selector | Version: | 1.4.3 |
Keywords: | 1.7-discuss | Cc: | |
Blocked by: | Blocking: |
Description
Code like this : $('tr').not(':has([colspan])') fine works in not IE browsers, but don't work in IE
Attachments (0)
Change History (29)
Changed October 18, 2010 09:04AM UTC by comment:1
Changed October 18, 2010 10:12PM UTC by comment:2
component: | unfiled → selector |
---|---|
milestone: | 1.5 → 1.4.4 |
priority: | undecided → high |
status: | new → open |
version: | 1.4.2 → 1.4.3 |
Still an issue in 1.4.3.
Changed October 18, 2010 10:13PM UTC by comment:3
priority: | high → blocker |
---|
Changed October 21, 2010 10:59PM UTC by comment:4
milestone: | 1.4.4 → 1.4.5 |
---|
Retargeting due to severity of regressions in 1.4.3.
Changed October 22, 2010 05:53AM UTC by comment:5
milestone: | 1.4.5 → 1.4.4 |
---|
Retargeting for 1.4.4 as per John’s request.
Changed October 22, 2010 09:05AM UTC by comment:6
_comment0: | I'm a bit confused as to why this is a bug. I think IE is correct with this ( for once ). \ \ Your code is looking for a tr that doesn't has colspan. But:[[BR]] \ tr's doesn't have the colspan attribute[[BR]] \ td's always has a colspan value, even if you don't set it (defaults to 1)[[BR]] \ \ Is it meant to work event if td was used instead of tr? I tested it and it doesn't. \ \ I did some alternative code to getting a tr where the child td's don't have a colspan (or in my case, have a colspan > 1) [http://jsfiddle.net/tomgrohl/fa98L/4/ here] (tested in FF, Chrome, Safari and IE 6,7,8,9) → 1287738857599277 |
---|
I'm a bit confused as to why this is a bug. I think IE is correct with this ( for once ). Unless you meant td and not tr.
tr's doesn't have the colspan attribute
td's always has a colspan value, even if you don't set it (defaults to 1)
Which might be why you were gettings those results.
I did some alternative code to getting a tr where the child td's don't have a colspan (or in my case, have a colspan > 1) here (tested in FF, Chrome, Safari and IE 6,7,8,9)
Changed October 22, 2010 10:08AM UTC by comment:7
I made a misprint in a header:) But:
$('tr').not(':has([colspan])')
Such code means: "Get tr which don't have td with colspan attribute".
It's a bug because it works fine in not IE browsers and 'has' can accept a selector in jQuery 1.4.* and '[colspan]' is a CSS 2.1 selector.
Changed October 22, 2010 11:17AM UTC by comment:8
Replying to [comment:7 pinal]:
I made a misprint in a header:) But: $('tr').not(':has([colspan])') Such code means: "Get tr which don't have td with colspan attribute". It's a bug because it works fine in not IE browsers and 'has' can accept a selector in jQuery 1.4.* and '[colspan]' is a CSS 2.1 selector.
Yeah that what I thought, I've tried:
$('tr').not('td:has([colspan])') //doesn't work at all
And
//doesn't work in IE 6, 7 and 8 ( Works In non IE browsers and IE9) $('tr').not('td').has('[colspan]')
Example here:
Maybe because colspan defaults to 1 if it is not set IE says it is anyway.
Changed October 22, 2010 11:52AM UTC by comment:9
I want to get such table rows by selector. I think $('tr').not(':has([colspan])') is right in selectoin syntax. May be this bug is duplicate of another one, but such selectoion must work.
Changed October 22, 2010 12:43PM UTC by comment:10
Replying to [comment:9 pinal]:
I want to get such table rows by selector. I think $('tr').not(':has([colspan])') is right in selectoin syntax. May be this bug is duplicate of another one, but such selectoion must work.
Yes I agree. Although to me
$('tr').not(':has([colspan])')
should be
$('tr').not('td:has([colspan])')
to be syntactally correct, I may be wrong.
Both the examples I've gave should really work, as they are the same technically, but only one does.
Changed October 23, 2010 07:21PM UTC by comment:11
owner: | → john |
---|---|
status: | open → assigned |
Changed October 27, 2010 12:59PM UTC by comment:12
I just was struck by this problem in a project of mine, and created a small fiddle of it, and afterwards searched the bugtracker and found this. Bad choice =)
Anyway, I created the fiddle so I give it to you:
http://www.jsfiddle.net/wailqill/jW5CZ/
Works in ff, not in ie. No matter what version of jQuery.
Changed October 28, 2010 02:09AM UTC by comment:13
milestone: | 1.4.4 → 1.4.5 |
---|
Retargeting to next minor release.
Changed November 06, 2010 05:20AM UTC by comment:14
IE appears to be behaving differently in jsFiddle vs. true operation.
Here it thinks all td elements have a colspan, it even picks them up in CSS:
http://jsfiddle.net/MrTyzik/DSVeg/4/
However outside jsFiddle things match Chrome for me in IE9 beta:
http://csh.rit.edu/~ryanw/chaos/ie9-colspan.html
I haven't tried true IE8 or below yet.
Please note the colspan_not_one test at the end though using $('td[colspan!=1]'). In this case, IE does not match FF or Chrome. That feels like a related but different issue.
Changed January 17, 2011 04:51PM UTC by comment:15
milestone: | 1.4.5 → 1.6 |
---|
This is getting moved to 1.6 for when the $.attr happens.
Changed April 17, 2011 08:40PM UTC by comment:16
milestone: | 1.6 → 1.next |
---|
Changed May 07, 2011 02:34AM UTC by comment:17
blockedby: | → 5637 |
---|
Changed May 22, 2011 07:27PM UTC by comment:18
keywords: | → 1.7-discuss |
---|
Nominating ticket for 1.7 discussion.
Changed May 22, 2011 09:41PM UTC by comment:19
+1, Seems like a bug, should be fixed
Changed May 23, 2011 12:15AM UTC by comment:20
+0,
Changed May 23, 2011 03:52AM UTC by comment:21
+1, Sizzle attributes again
Changed May 23, 2011 03:45PM UTC by comment:22
+1, Buggers
Changed June 03, 2011 01:41PM UTC by comment:23
+1, Probably due to attribute camelCase, timmywil and I can fix this.
Changed June 03, 2011 03:27PM UTC by comment:24
+1, also, .hasAttr() might be nice
Changed June 06, 2011 03:56PM UTC by comment:25
+1
Changed July 12, 2011 02:47PM UTC by comment:26
milestone: | 1.next → 1.7 |
---|
Changed July 12, 2011 04:16PM UTC by comment:27
resolution: | → duplicate |
---|---|
status: | assigned → closed |
Changed July 12, 2011 04:16PM UTC by comment:28
Duplicate of #5637.
Changed September 27, 2011 04:04AM UTC by comment:29
milestone: | 1.7 |
---|
http://jsfiddle.net/fa98L/