#2939 closed bug (fixed)
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
Change History (8)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Owner: | set to flesler |
---|---|
Status: | new → assigned |
Will try to check this asap.
comment:4 Changed 15 years ago by
Sorry, I thought I sent this check back - no it doesn't work with latest 1.2.6:
comment:5 Changed 15 years ago by
need: | Review → Commit |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:6 Changed 12 years ago by
Can you check in version 1.6.2. It does seem to work in this version.
comment:7 Changed 12 years ago by
oops! sorry what i meant was It doesn't seem to work in this version.
comment:8 Changed 12 years ago by
@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)