[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 19:18:40 PDT 2014
https://bugs.webkit.org/show_bug.cgi?id=137651
--- Comment #4 from Tim Guan-tin Chien [:timdream] <timdream at gmail.com> 2014-10-14 19:18:34 PST ---
Thanks for the comment,
(In reply to comment #3)
> 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.
>
Web Developers shouldn't be worry about how the DOM object is implemented right :) ?
> 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.
FWIW Gecko and Chrome does not fail when I run this test case.
--
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