Opened 13 years ago
Closed 12 years ago
#7485 closed bug (fixed)
Inconsistency between has [attribute] selector and attr() method
Reported by: | jitter | Owned by: | |
---|---|---|---|
Priority: | blocker | Milestone: | 1.6 |
Component: | attributes | Version: | 1.5.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
While checking on #7480 I noted a related bug.
There are inconsistencies when using the has [attr]
selector and the attr()
method.
The selector doesn't return all elements which have the attribute although upon checking with the attr()
method it returns a value.
test case with text attribute not explicitly defined
test case with text attribute explicitly defined on some elements
Change History (5)
comment:1 Changed 13 years ago by
Blocked by: | 7128 added |
---|---|
Component: | unfiled → attributes |
Priority: | undecided → blocker |
Status: | new → open |
comment:2 Changed 13 years ago by
Milestone: | 1.5 → 1.6 |
---|
This is getting moved to 1.6 for when the $.attr happens.
comment:3 Changed 12 years ago by
comment:4 Changed 12 years ago by
Blocked by: | 7128 removed |
---|
comment:4 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Version: | 1.4.4 → 1.5.2 |
The nodes in question do not have content attributes called "text" and therefore should not be found by either one. http://jsfiddle.net/timmywil/znVBU/2/
This is something on the roadmap for 1.5.
.attr
will be rewritten along with Sizzle to stop matching on the DOM properties, so this will all be happily consistent again.You will probably also notice here that the first test case will behave differently in IE6/7 because they run through Sizzle.