From 28964759b5c023b457ca6c8bd96a7e10e5bc5852 Mon Sep 17 00:00:00 2001 From: "olehougaard@google.com" Date: Tue, 14 Oct 2008 10:02:42 +0000 Subject: Fix for issue 81 Putting all peers of DOM nodes in an object group, so they won't be garbage collected too soon. Review URL: http://codereview.chromium.org/7228 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3341 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/port/bindings/v8/v8_proxy.cpp | 17 +++++++++++++---- webkit/tools/layout_tests/test_lists/tests_fixable.txt | 1 - 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'webkit') diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp index 76b475b..d6055ea 100644 --- a/webkit/port/bindings/v8/v8_proxy.cpp +++ b/webkit/port/bindings/v8/v8_proxy.cpp @@ -457,14 +457,23 @@ static void GCPrologue() // it is not in a document. However, if the load event has not // been fired (still onloading), it is treated as in the document. // + // Otherwise, the node is put in an object group identified by the root + // elment of the tree to which it belongs. + void* group_id; if (node->inDocument() || (node->hasTagName(HTMLNames::imgTag) && !static_cast(node)->haveFiredLoadEvent()) ) { - Document* doc = node->document(); - v8::Persistent wrapper = dom_node_map().get(node); - if (!wrapper.IsEmpty()) - v8::V8::AddObjectToGroup(doc, wrapper); + group_id = node->document(); + } else { + Node* root = node; + while (root->parent()) { + root = root->parent(); + } + group_id = root; } + v8::Persistent wrapper = dom_node_map().get(node); + if (!wrapper.IsEmpty()) + v8::V8::AddObjectToGroup(group_id, wrapper); } } diff --git a/webkit/tools/layout_tests/test_lists/tests_fixable.txt b/webkit/tools/layout_tests/test_lists/tests_fixable.txt index 441a1a6..816665c 100644 --- a/webkit/tools/layout_tests/test_lists/tests_fixable.txt +++ b/webkit/tools/layout_tests/test_lists/tests_fixable.txt @@ -910,7 +910,6 @@ V8 | KJS # LayoutTests/fast/borders/inline-mask-overlay-image.html = FAIL V8 | KJS # LayoutTests/fast/canvas/canvas-text-alignment.html = FAIL V8 | KJS # LayoutTests/fast/canvas/canvas-text-baseline.html = FAIL V8 | KJS # LayoutTests/fast/dom/documenturi-assigned-junk-implies-relative-urls-do-not-resolve.html = FAIL -V8 | KJS # LayoutTests/fast/dom/gc-acid3.html = FAIL V8 | KJS # LayoutTests/fast/dom/SelectorAPI/NSResolver-exceptions.xhtml = FAIL V8 | KJS # LayoutTests/fast/dom/SelectorAPI/resig-SelectorsAPI-test.xhtml = FAIL V8 | KJS # LayoutTests/fast/text/align-center-rtl-spill.html = FAIL -- cgit v1.1