[Webkit-unassigned] [Bug 137651] WeakMap reference w/ DOM element as key does not survive long enough

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 14 11:53:09 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=137651





--- Comment #3 from Geoffrey Garen <ggaren at apple.com>  2014-10-14 11:53:04 PST ---
In this test case, the JavaScript wrapper for the p element is garbage collected because there are no explicit references to it -- even though its underlying C++ DOM object is still present in the document.

I guess the behavior you expected was for the JavaScript wrapper's lifetime to be identical to its underlying DOM object, as observed by a WeakMap. 

Ironically, implementing that feature would require a WeakMap to strongly reference a DOM object.

I'm not sure what the correct behavior is in this case. Perhaps the optimization to throw away unobservable DOM wrappers is invalid in a world where WeakMap can observe the lifetime of any object.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list