Bug Tracker

Opened 6 years ago

Closed 6 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:


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 6 years ago by snover

  • Blocked by 7128 added
  • Component changed from unfiled to attributes
  • Priority changed from undecided to blocker
  • Status changed from new to open

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 6 years ago by snover (previous) (diff)

comment:2 Changed 6 years ago by john

  • Milestone changed from 1.5 to 1.6

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

comment:3 Changed 6 years ago by timmywil

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

comment:4 Changed 6 years ago by timmywil

  • Blocked by 7128 removed

comment:4 Changed 6 years ago by timmywil

  • Resolution set to fixed
  • Status changed from open to closed
  • Version changed from 1.4.4 to 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/

Note: See TracTickets for help on using tickets.