[v8] when a named item on document goes out of scope, actually remove it
authorjochen@chromium.org <jochen@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2012 13:41:02 +0000 (13:41 +0000)
committerjochen@chromium.org <jochen@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2012 13:41:02 +0000 (13:41 +0000)
commit4e58d20e24273eb27d580348ff23ccbbe73d2cbd
treee072cafd3a23c1b4fba38700357849fc6e479569
parent08411d92695f9348821371a40982e0c5d6e16dc3
[v8] when a named item on document goes out of scope, actually remove it
https://bugs.webkit.org/show_bug.cgi?id=79409

Reviewed by Adam Barth.

Source/WebCore:

The original change already included the code, but it led to some
problems, so it was reverted in http://trac.webkit.org/changeset/63845.
However, not removing the items leaks a considerable amount of memory,
so I'm adding the code back. The bug that led to the revert was that
the accessor was removed unconditionally. I'm now only removing it,
when the last item with that name is removed.

Test: fast/dom/HTMLDocument/named-item.html

* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::V8DOMWindowShell::namedItemRemoved):

LayoutTests:

* fast/dom/HTMLDocument/named-item-expected.txt: Added.
* fast/dom/HTMLDocument/named-item.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLDocument/named-item-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/HTMLDocument/named-item.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/V8DOMWindowShell.cpp