Opened 10 years ago
Closed 10 years ago
#13212 closed feature (wontfix)
Immediate call removeAttr on jQuery.attr when value is null
Reported by: | 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!
Note: See
TracTickets for help on using
tickets.
Thank you again for the analysis. We hope that you'll continue to contribute!