Bug Tracker

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 snover

Blocked by: 7128 added
Component: unfiledattributes
Priority: undecidedblocker
Status: newopen

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.

Last edited 13 years ago by snover (previous) (diff)

comment:2 Changed 13 years ago by john

Milestone: 1.51.6

This is getting moved to 1.6 for when the $.attr happens.

comment:3 Changed 12 years ago by Timmy Willison

I think #7128, #5930, and #5637 are duplicates of this issue, but I'm not 100% on that.

comment:4 Changed 12 years ago by Timmy Willison

Blocked by: 7128 removed

comment:4 Changed 12 years ago by Timmy Willison

Resolution: fixed
Status: openclosed
Version: 1.4.41.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/

Note: See TracTickets for help on using tickets.