Side navigation
#2939 closed bug (fixed)
Opened May 26, 2008 07:52PM UTC
Closed July 28, 2008 04:25PM UTC
Last modified March 14, 2012 10:16PM UTC
Selectors using style attribute broken
Reported by: | remysharp | Owned by: | flesler |
---|---|---|---|
Priority: | major | Milestone: | 1.3 |
Component: | selector | Version: | 1.2.5 |
Keywords: | selector style | Cc: | |
Blocked by: | Blocking: |
Description
Demonstrations:
http://remysharp.com/demo/selector-issue.html
Using the style attribute in the selector either returns the wrong number of results or throws exception.
Tested in FF2 and Safari (test above makes use of console.log).
Example selectors broken:
$(div[style]); returns total number of elements regardless of result
$(div[style^="color"]); throws exception
Attachments (0)
Change History (8)
Changed May 26, 2008 08:27PM UTC by comment:1
Changed May 27, 2008 01:07AM UTC by comment:2
owner: | → flesler |
---|---|
status: | new → assigned |
Will try to check this asap.
Changed June 11, 2008 10:40PM UTC by comment:3
component: | core → selector |
---|
Could you recheck with 1.2.6 ?
Changed June 26, 2008 11:42AM UTC by comment:4
Sorry, I thought I sent this check back - no it doesn't work with latest 1.2.6:
Changed July 28, 2008 04:25PM UTC by comment:5
need: | Review → Commit |
---|---|
resolution: | → fixed |
status: | assigned → closed |
Fixed at [5795].
This made me realize of a possible optimization: #3194.
Changed July 21, 2011 06:21AM UTC by comment:6
Can you check in version 1.6.2. It does seem to work in this version.
Changed July 21, 2011 06:22AM UTC by comment:7
oops! sorry what i meant was It doesn't seem to work in this version.
Changed July 21, 2011 01:50PM UTC by comment:8
@sandy can you provide a complete reduced test case on jsFiddle to help us assess your ticket!
Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.
I think I've found a/the fix, but I've only been able to test on a Mac so far, Opera 9*, Safari 3, FF2 - not IE testing as yet, all browsers give the right result.
File: src/selector.js rev: 5696
Change line 339 from (note intentional spaces in OR to prevent formatting):
if ( z == null | | /href|src|selected/.test(m[2]) )
To:
if ( z == null | | /style|href|src|selected/.test(m[2]) )
Diff: http://codedumper.com/ocopo#9-10 (I couldn't paste the diff properly)