Bug Tracker

Opened 7 years ago

Closed 7 years ago

#13212 closed feature (wontfix)

Immediate call removeAttr on jQuery.attr when value is null

Reported by: igor.kalashnikov@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.0
Keywords: Cc:
Blocked by: Blocking:

Description

We do not need to check the node is not xml, its type, lowercase the name, match the rboolean regexp to remove the attribute with attr(key, null), so I propose to move the "value is null" check to the top of the attr function with immediate removeAttr call in this case.

Here is some jsPerf links: http://jsperf.com/removeattr-new (attr with null as value) http://jsperf.com/removeattr-set-new (attr with not null as value)

Pull request: https://github.com/jquery/jquery/pull/1134

Thank you!

Change History (1)

comment:1 Changed 7 years ago by gibson042

Resolution: wontfix
Status: newclosed

Thank you again for the analysis. We hope that you'll continue to contribute!

Note: See TracTickets for help on using tickets.