diff options
author | olehougaard@google.com <olehougaard@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-14 10:02:42 +0000 |
---|---|---|
committer | olehougaard@google.com <olehougaard@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-14 10:02:42 +0000 |
commit | 28964759b5c023b457ca6c8bd96a7e10e5bc5852 (patch) | |
tree | da4f881cb3e9fb32d33ad459bfbc799013407f25 /webkit | |
parent | df1c7700fea7346bf60fa48d494691bb58ecec41 (diff) | |
download | chromium_src-28964759b5c023b457ca6c8bd96a7e10e5bc5852.zip chromium_src-28964759b5c023b457ca6c8bd96a7e10e5bc5852.tar.gz chromium_src-28964759b5c023b457ca6c8bd96a7e10e5bc5852.tar.bz2 |
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
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/port/bindings/v8/v8_proxy.cpp | 17 | ||||
-rw-r--r-- | webkit/tools/layout_tests/test_lists/tests_fixable.txt | 1 |
2 files changed, 13 insertions, 5 deletions
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<HTMLImageElement*>(node)->haveFiredLoadEvent()) ) { - Document* doc = node->document(); - v8::Persistent<v8::Object> 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<v8::Object> 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 |