Created attachment 184478 [details] Test page After http://trac.webkit.org/changeset/133044/trunk/Source/WebCore/bindings/v8/V8GCController.cpp each js node wrapper became a root of a separate detached DOM tree. On the attached page we have a detached DOM tree with 3 divs. Each of them becomes a seperate DOM tree(see screenshot).
Created attachment 184480 [details] Heap profiler screenshot
Created attachment 184491 [details] Patch
Comment on attachment 184491 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184491&action=review > Source/WebCore/bindings/v8/V8GCController.cpp:106 > + OwnPtr<RetainedObjectInfo> retainedObjectInfo; > + if (group[0].WrapperClassId() == v8DOMNodeClassId) > + retainedObjectInfo = adoptPtr(new RetainedDOMInfo(static_cast<Node*>(root))); Why is this static cast valid?
Comment on attachment 184491 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184491&action=review >> Source/WebCore/bindings/v8/V8GCController.cpp:106 >> + retainedObjectInfo = adoptPtr(new RetainedDOMInfo(static_cast<Node*>(root))); > > Why is this static cast valid? Because V8DOMWrapper::associateObjectWithWrapper will set wrapper class id to v8DOMNodeClassId only if the wrapped object is a DOM node and the opaque root for DOM nodes is always a node. I started with a patch that introduced NodeImplicitConnection and ObjectImplicitConnection derived from ImplicitConnection and made the compiler control that the root is a node. But it looked unnecessarily complicated.
Created attachment 184715 [details] Patch without static_cast<Node*>
Comment on attachment 184715 [details] Patch without static_cast<Node*> Yay for no static_cast. Thanks!
Comment on attachment 184491 [details] Patch IMHO the later patch is better.
Committed r140949: <http://trac.webkit.org/changeset/140949>