2009-02-19  Simon Fraser  <simon.fraser@apple.com>

        Reviewed by Adele Peterson.

        Call documentWillBecomeInactive() from Document::detach to ensure that
        media elements are shut down, because they may be kept alive by references
        from JS past document teardown.

        documentWillBecomeInactive() calls  renderView()->willMoveOffscreen(), so no
        need to do that in detach() as well.

        We no longer need to call documentWillBecomeInactive() from ~Page() (which
        was added for <https://bugs.webkit.org/show_bug.cgi?id=21116>), since this
        supersedes that change.

        * dom/Document.cpp:
        (WebCore::Document::detach):
        * page/Page.cpp:
        (WebCore::Page::~Page):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@41080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
3 files changed