RESOLVED FIXED 107819
Web Inspector: each node in a detached DOM tree is shown in its own "detached DOM tree" entry in heap profiler
https://bugs.webkit.org/show_bug.cgi?id=107819
Summary Web Inspector: each node in a detached DOM tree is shown in its own "detached...
Yury Semikhatsky
Reported 2013-01-24 06:16:32 PST
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).
Attachments
Test page (287 bytes, text/html)
2013-01-24 06:16 PST, Yury Semikhatsky
no flags
Heap profiler screenshot (43.49 KB, image/png)
2013-01-24 06:17 PST, Yury Semikhatsky
no flags
Patch (2.12 KB, patch)
2013-01-24 07:35 PST, Yury Semikhatsky
no flags
Patch without static_cast<Node*> (5.73 KB, patch)
2013-01-25 03:23 PST, Yury Semikhatsky
abarth: review+
Yury Semikhatsky
Comment 1 2013-01-24 06:17:03 PST
Created attachment 184480 [details] Heap profiler screenshot
Yury Semikhatsky
Comment 2 2013-01-24 07:35:10 PST
Adam Barth
Comment 3 2013-01-24 19:15:07 PST
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?
Yury Semikhatsky
Comment 4 2013-01-25 02:57:25 PST
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.
Yury Semikhatsky
Comment 5 2013-01-25 03:23:10 PST
Created attachment 184715 [details] Patch without static_cast<Node*>
Adam Barth
Comment 6 2013-01-25 09:28:43 PST
Comment on attachment 184715 [details] Patch without static_cast<Node*> Yay for no static_cast. Thanks!
Adam Barth
Comment 7 2013-01-25 09:29:09 PST
Comment on attachment 184491 [details] Patch IMHO the later patch is better.
Yury Semikhatsky
Comment 8 2013-01-28 00:07:14 PST
Note You need to log in before you can comment on or make changes to this bug.