Bug Tracker

Opened 8 years ago

Last modified 7 years ago

#8792 closed enhancement

Attach data objects directly to DOM elements — at Version 10

Reported by: dmethvin Owned by:
Priority: blocker Milestone: 1.7
Component: data Version: 1.5.2
Keywords: 1.7-discuss Cc:
Blocked by: Blocking:

Description (last modified by timmywil)

Only IE6 and IE7 are unable to garbage-collect JavaScript objects, I think the other browsers can handle cleanup themselves.

Switch to direct attach for those cases. This means we don't need to clean up data and events when elements are removed from the DOM, should be a perf boost.

This will require a change to global events since there will jQuery.cache will no longer contain all data for all objects and jQuery.event.trigger can't sneak a peek into the cache to trigger them.

Need a feature detect I can use to determine whether it's safe to attach data to a DOM object.

Change History (9)

comment:1 Changed 8 years ago by timmywil

Component: unfiledevent
Milestone: 1.next1.6
Owner: set to dmethvin
Priority: undecidedhigh
Status: newassigned

comment:2 Changed 8 years ago by dmethvin

Milestone: 1.61.7
Priority: highlow

Deferred for discussion in 1.7; due to the remaining cases that need to be handled (i.e., removing special events and triggering global events) it may not offer enough benefits to be worthwhile.

comment:3 Changed 8 years ago by john

Milestone: 1.71.next
Owner: dmethvin deleted
Status: assignedopen

Let's discuss this in the roadmap meeting.

comment:4 Changed 8 years ago by john

Keywords: 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:6 Changed 8 years ago by Rick Waldron

+1,

comment:7 Changed 8 years ago by jaubourg

-1, I don't see any possible feature test, hence why I'll vote negatively

comment:8 Changed 8 years ago by Rick Waldron

I might be way off here but if we know that UAs that support deleting expandos are safe, then could we assume jQuery.support.deleteExpando is safe way to determine which browser to use internal cache (false) or attach directly (true)?

comment:9 Changed 8 years ago by Rick Waldron

Component: eventdata

comment:10 Changed 8 years ago by timmywil

Description: modified (diff)

+0,

Note: See TracTickets for help on using tickets.