Skip to main content

Bug Tracker

Side navigation

#13212 closed feature (wontfix)

Opened January 15, 2013 06:57AM UTC

Closed January 15, 2013 03:14PM UTC

Immediate call removeAttr on jQuery.attr when value is null

Reported by: igor.kalashnikov@me.com 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!

Attachments (0)
Change History (1)

Changed January 15, 2013 03:14PM UTC by gibson042 comment:1

resolution: → wontfix
status: newclosed

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