#9776 closed bug (duplicate)
jQuery can't select elements by completely valid CSS selector and alternatively makes unwished DOM element
Reported by: | miya2000 | Owned by: | Rick Waldron |
---|---|---|---|
Priority: | high | Milestone: | 1.next |
Component: | core | Version: | 1.6.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I posted a ticket but it was rejected as a sapn. So I write it my blog and link it.
http://d.hatena.ne.jp/miya2000/20110707/p0
jQuery Result: http://jsfiddle.net/nH26U/1/
Change History (7)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Owner: | set to miya2000 |
---|---|
Status: | new → pending |
Is there anyway you could reduce that overkill to something simple and straight forward that merely illustrates the issue...?
comment:3 follow-up: 4 Changed 12 years ago by
Reduced test case:
http://jsfiddle.net/rwaldron/wFJ8N/
FWIW, I think it's obscene that HTML5 puts no restrictions on the characters that can be used in attribute values
comment:4 Changed 12 years ago by
Status: | pending → new |
---|
Thanks a lot! I didn't know that Firebug Lite is available. It is very simple!
FWIW, I think it's obscene that HTML5 puts no restrictions on the characters that can be used in attribute values
I think so, too about "class" attribute. But attributes are not only "class". "value" and "data-*" attributes are expected to store any data. And it is possible to include every attributes in a query selector.
And jQuery document says:
http://api.jquery.com/category/selectors/ If you wish to use any of the meta-characters ( such as !"#$%&'()*+,./:;<=>[email protected][\]`{|}~ ) as a literal part of a name, you must escape the character with two backslashes:
.
So I think it should be fixed.
This problem is caused by existing two context, "Selector" and "DOM creation", in a same signature $(string).
I think jQuery's main work is Selector. But DOM creation interrupts it.
Fortunately, There is no selector starts with '<'. So I agree with suggestion in #9521. Do you think it has any problem in this suggestion?
Thank you.
comment:5 Changed 12 years ago by
Component: | unfiled → core |
---|---|
Owner: | changed from miya2000 to Rick Waldron |
Priority: | undecided → high |
Status: | new → assigned |
First of all, I think you misunderstood me - I said nothing about "class" attributes specifically; I meant _all_ attributes. It has nothing to do with the sizzle/selectors, but everything to do with the regular expression used to determine which branch of logic should be used.
comment:6 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
Closing as duplicate, however this is not a 1-to-1 duplicate, simply that fixing 9521 will also resolve this issue
Solution -> Ticket #9521 http://bugs.jquery.com/ticket/9521#comment:3