Side navigation
#7216 closed bug (fixed)
Opened October 16, 2010 07:31PM UTC
Closed January 17, 2011 10:46PM UTC
Last modified March 10, 2012 12:00AM UTC
[Regression] $('input[value=]').live('change', ...) does not work in 1.4.3 (FF 3.6.10)
Reported by: | Glen.84 | Owned by: | john |
---|---|---|---|
Priority: | blocker | Milestone: | 1.5 |
Component: | selector | Version: | 1.4.4 |
Keywords: | regression | Cc: | |
Blocked by: | Blocking: |
Description
Same with $('input[value!=]').
Attachments (0)
Change History (29)
Changed October 16, 2010 07:34PM UTC by comment:1
Changed October 16, 2010 08:13PM UTC by comment:2
component: | unfiled → event |
---|---|
priority: | undecided → blocker |
status: | new → open |
Changed October 19, 2010 03:47AM UTC by comment:3
Any relation to http://bugs.jquery.com/ticket/7212 ?
Changed October 20, 2010 07:03AM UTC by comment:4
resolution: | → duplicate |
---|---|
status: | open → closed |
Changed October 20, 2010 08:44AM UTC by comment:6
Isn't #7243 a duplicate of this bug, since it was created after it?
Changed October 24, 2010 05:44PM UTC by comment:7
Please re-open ... http://jsfiddle.net/darkangel/geX3c/1/
Changed October 25, 2010 07:33PM UTC by comment:8
Isn't that an invalid selector? You can't do !=] or =] - you have to have quotes. Changing that makes it work:
Changed October 25, 2010 07:44PM UTC by comment:9
As mentioned on IRC, it worked in 1.4.2 and the documentation says the quotes are optional.
The documentation should be updated if the selector is invalid.
Thanks.
Changed October 25, 2010 08:03PM UTC by comment:10
I've updated all the selector docs to represent this:
http://api.jquery.com/category/selectors/attribute-selectors/
Changed October 26, 2010 08:04PM UTC by comment:11
"Attribute values in selector expressions can be written as bare words and must be surrounded by quotation marks."
Shouldn't that be *cannot* be written as bare words? Or simply ...
"Attribute values in selector expressions must be surrounded by quotation marks."
Changed October 31, 2010 02:35PM UTC by comment:12
_comment0: | The docs are now somewhat confusing, as they suggest doing something syntactically impossible: `jQuery('[attribute|='value']')`. \ \ [[Image(http://gyazo.com/d29d38d82859a4c574cb96fe19cd9ff6.png)]] \ \ All the attribute selector "name" values should combine single/double quotes and either be `jQuery("[attribute|='value']")` or `jQuery('[attribute|="value"]')`, whichever is more universally consistent. → 1288535803677978 |
---|
The docs are now somewhat confusing, as they suggest doing something syntactically impossible: jQuery('[attribute|='value']')
.
[[Image(http://gyazo.com/d29d38d82859a4c574cb96fe19cd9ff6.png)]]
All the attribute selector "name" values should combine single/double quotes and be formatted as either jQuery("[attribute|='value']")
or jQuery('[attribute|="value"]')
, whichever is more universally consistent.
Changed October 31, 2010 04:09PM UTC by comment:13
@cowboy (comment:12)
I've changed the syntax errors in all attribute pages to match
jQuery('[attribute|="value"]')
Changed October 31, 2010 04:10PM UTC by comment:14
Replying to [comment:13 anonymous]:
@cowboy (comment:12) I've changed the syntax errors in all attribute pages to match> jQuery('[attribute|="value"]') >
Wasn't logged in, but that was me :)
Changed November 07, 2010 12:31AM UTC by comment:15
component: | event → selector |
---|---|
resolution: | duplicate |
status: | closed → reopened |
Changing the docs isn't a sufficient fix for this problem, especially for a 1.x.x release, since it potentially breaks a lot of existing code. Additionally, examples in the CSS spec suggest that quotes are optional: http://www.w3.org/TR/CSS2/selector.html#attribute-selectors
This bug was closed as duplicate of #7243, but they're really two separate issues.
Changed November 07, 2010 02:09AM UTC by comment:16
keywords: | → regression needsreview |
---|
Quotes are optional only if the value part is an ident. This is detailed in the css3 grammar.
Changed November 08, 2010 10:52PM UTC by comment:17
owner: | → john |
---|---|
status: | reopened → assigned |
Ok, Karl provided another test case:
This is more than when there's no content on the right hand side. I'll look into this.
Changed November 08, 2010 11:00PM UTC by comment:18
_comment0: | Think this might fix it, will try later: \ {{{ \ .replace(/=\\s*([^'"]*)\\s*\\]/g, "='$1'") \ }}} → 1289257256375806 |
---|
Think this might fix it, will try later:
.replace(/=\\s*([^'"\\]]*)\\s*\\]/g, "='$1'")
Changed November 09, 2010 07:03PM UTC by comment:19
resolution: | → fixed |
---|---|
status: | assigned → closed |
Ensure that unquoted attribute selectors are quoted (allowing them to go into qSA/matchesSelector properly). Fixes #7216.
Changeset: b0e1e83aa987279dcdb81112ec942c161111be17
Changed November 10, 2010 08:17PM UTC by comment:20
keywords: | regression needsreview → regression |
---|
Changed November 19, 2010 06:44AM UTC by comment:21
This "bug fix" doesn't seem to work correctly in all cases. Refer to the example on the Selectors page of the Documentation for a simple example that doesn't work with jQuery 1.4.4.
http://api.jquery.com/category/selectors/
(example in second paragraph... try to run this code in jQuery 1.4.4)
It seems that the modification made by this bug fix in the Sizzle function seems to choke on some of the meta-characters that are supposed to be allowed in selectors. In particular, some of my selectors contain the "=" character in an attribute, but the quoting logic doesn't seem to handle this case properly.
Changed November 19, 2010 08:03PM UTC by comment:22
Replying to [comment:21 webmaster@…]:
This "bug fix" doesn't seem to work correctly in all cases. It seems that the modification made by this bug fix in the Sizzle function seems to choke on some of the meta-characters that are supposed to be allowed in selectors. In particular, some of my selectors contain the "=" character in an attribute, but the quoting logic doesn't seem to handle this case properly.
Please submit a reduced test case which reproduces the issue you are experiencing (ideally on http://jsfiddle.net). So that we can investigate this issue further.
Changed November 21, 2010 08:44AM UTC by comment:23
Reduced test case.
Under 1.4.3 and 1.4.4, it doesn't work, but does under 1.4.2. (Maybe the issue was introduced in 1.4.3, but I didn't notice).
Changed November 21, 2010 08:46AM UTC by comment:24
Insignificant correction to test case.
Changed November 21, 2010 10:12PM UTC by comment:25
milestone: | 1.4.4 → 1.4.5 |
---|---|
resolution: | fixed |
status: | closed → reopened |
version: | 1.4.3 → 1.4.4 |
test case which works under jQuery 1.4.2/1.4.3 but fails under 1.4.4
The testcase provided in comment 23/24 also work in 1.4.2/1.4.3 but fail under 1.4.4 (Opera 10.63 and FF 3.6.12 tested)
Changed November 21, 2010 10:13PM UTC by comment:26
status: | reopened → open |
---|
Changed December 09, 2010 12:12PM UTC by comment:27
Additionally,
$("input[name=song[attachment]]").length
returns 0
$("input[name='song[attachment]']").length
returns 1
The first case used to work in 1.4.2 and is not working on 1.4.4. Is this being looked at as well?
Changed January 17, 2011 06:50PM UTC by comment:28
milestone: | 1.4.5 → 1.5 |
---|
Changed January 17, 2011 10:46PM UTC by comment:29
resolution: | → fixed |
---|---|
status: | open → closed |
The additional issues that were brought up here were taken care of in #6093.
More detailed view: http://jsfiddle.net/seankoole/6EYxm/