2008-09-26 Eric Carlson <eric.carlson@apple.com>
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Sep 2008 17:26:39 +0000 (17:26 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Sep 2008 17:26:39 +0000 (17:26 +0000)
        Reviewed by Antti

        https://bugs.webkit.org/show_bug.cgi?id=21116
        <rdar://problem/5726325> Audio from <video> can still be heard after navigating
        back to page with <video>, then closing tab

        Rename willSaveToCache/didRestoreFromCache callbacks to documentWillBecomeInactive/
        documentDidBecomeActive, and post documentWillBecomeInactive when a page is marked for
        deletion.

        * dom/Document.cpp:
        (WebCore::Document::documentWillBecomeInactive):
        (WebCore::Document::documentDidBecomeActive):
        (WebCore::Document::registerForDocumentActivationCallbacks):
        (WebCore::Document::unregisterForDocumentActivationCallbacks):
        * dom/Document.h:
        * dom/Element.h:
        (WebCore::Element::documentWillBecomeInactive):
        (WebCore::Element::documentDidBecomeActive):
        * history/CachedPage.cpp:
        (WebCore::CachedPage::CachedPage):
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::~HTMLFormElement):
        (WebCore::HTMLFormElement::parseMappedAttribute):
        (WebCore::HTMLFormElement::documentDidBecomeActive):
        (WebCore::HTMLFormElement::willMoveToNewOwnerDocument):
        (WebCore::HTMLFormElement::didMoveToNewOwnerDocument):
        * html/HTMLFormElement.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::~HTMLInputElement):
        (WebCore::HTMLInputElement::setInputType):
        (WebCore::HTMLInputElement::parseMappedAttribute):
        (WebCore::HTMLInputElement::needsActivationCallback):
        (WebCore::HTMLInputElement::registerForActivationCallbackIfNeeded):
        (WebCore::HTMLInputElement::unregisterForActivationCallbackIfNeeded):
        (WebCore::HTMLInputElement::documentDidBecomeActive):
        (WebCore::HTMLInputElement::willMoveToNewOwnerDocument):
        (WebCore::HTMLInputElement::didMoveToNewOwnerDocument):
        * html/HTMLInputElement.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
        (WebCore::HTMLMediaElement::~HTMLMediaElement):
        (WebCore::HTMLMediaElement::documentWillBecomeInactive):
        (WebCore::HTMLMediaElement::documentDidBecomeActive):
        * html/HTMLMediaElement.h:
        (WebCore::HTMLMediaElement::inActiveDocument):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::opened):
        * page/Page.cpp:
        (WebCore::Page::~Page):
        * rendering/RenderMedia.cpp:
        (WebCore::RenderMedia::updateControls):
        * rendering/RenderVideo.cpp:
        (WebCore::RenderVideo::updatePlayer):
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::SVGSVGElement):
        (WebCore::SVGSVGElement::~SVGSVGElement):
        (WebCore::SVGSVGElement::documentWillBecomeInactive):
        (WebCore::SVGSVGElement::documentDidBecomeActive):
        * svg/SVGSVGElement.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@36957 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
WebCore/ChangeLog
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/dom/Element.h
WebCore/history/CachedPage.cpp
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLFormElement.h
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLInputElement.h
WebCore/html/HTMLMediaElement.cpp
WebCore/html/HTMLMediaElement.h
WebCore/loader/FrameLoader.cpp
WebCore/page/Page.cpp
WebCore/rendering/RenderMedia.cpp
WebCore/rendering/RenderVideo.cpp
WebCore/svg/SVGSVGElement.cpp
WebCore/svg/SVGSVGElement.h

index 28a5912..a839e66 100644 (file)
@@ -1,3 +1,66 @@
+2008-09-26  Eric Carlson  <eric.carlson@apple.com>
+
+        Reviewed by Antti
+
+        https://bugs.webkit.org/show_bug.cgi?id=21116
+        <rdar://problem/5726325> Audio from <video> can still be heard after navigating 
+        back to page with <video>, then closing tab
+
+        Rename willSaveToCache/didRestoreFromCache callbacks to documentWillBecomeInactive/
+        documentDidBecomeActive, and post documentWillBecomeInactive when a page is marked for
+        deletion.
+
+        * dom/Document.cpp:
+        (WebCore::Document::documentWillBecomeInactive):
+        (WebCore::Document::documentDidBecomeActive):
+        (WebCore::Document::registerForDocumentActivationCallbacks):
+        (WebCore::Document::unregisterForDocumentActivationCallbacks):
+        * dom/Document.h:
+        * dom/Element.h:
+        (WebCore::Element::documentWillBecomeInactive):
+        (WebCore::Element::documentDidBecomeActive):
+        * history/CachedPage.cpp:
+        (WebCore::CachedPage::CachedPage):
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::~HTMLFormElement):
+        (WebCore::HTMLFormElement::parseMappedAttribute):
+        (WebCore::HTMLFormElement::documentDidBecomeActive):
+        (WebCore::HTMLFormElement::willMoveToNewOwnerDocument):
+        (WebCore::HTMLFormElement::didMoveToNewOwnerDocument):
+        * html/HTMLFormElement.h:
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::~HTMLInputElement):
+        (WebCore::HTMLInputElement::setInputType):
+        (WebCore::HTMLInputElement::parseMappedAttribute):
+        (WebCore::HTMLInputElement::needsActivationCallback):
+        (WebCore::HTMLInputElement::registerForActivationCallbackIfNeeded):
+        (WebCore::HTMLInputElement::unregisterForActivationCallbackIfNeeded):
+        (WebCore::HTMLInputElement::documentDidBecomeActive):
+        (WebCore::HTMLInputElement::willMoveToNewOwnerDocument):
+        (WebCore::HTMLInputElement::didMoveToNewOwnerDocument):
+        * html/HTMLInputElement.h:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement):
+        (WebCore::HTMLMediaElement::~HTMLMediaElement):
+        (WebCore::HTMLMediaElement::documentWillBecomeInactive):
+        (WebCore::HTMLMediaElement::documentDidBecomeActive):
+        * html/HTMLMediaElement.h:
+        (WebCore::HTMLMediaElement::inActiveDocument):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::opened):
+        * page/Page.cpp:
+        (WebCore::Page::~Page):
+        * rendering/RenderMedia.cpp:
+        (WebCore::RenderMedia::updateControls):
+        * rendering/RenderVideo.cpp:
+        (WebCore::RenderVideo::updatePlayer):
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::SVGSVGElement):
+        (WebCore::SVGSVGElement::~SVGSVGElement):
+        (WebCore::SVGSVGElement::documentWillBecomeInactive):
+        (WebCore::SVGSVGElement::documentDidBecomeActive):
+        * svg/SVGSVGElement.h:
+
 2008-09-26  Ariya Hidayat  <ariya.hidayat@trolltech.com>
 
         Reviewed by Simon
index 90823c9..d03d091 100644 (file)
@@ -3144,28 +3144,28 @@ void Document::setInPageCache(bool flag)
     }
 }
 
-void Document::willSaveToCache() 
+void Document::documentWillBecomeInactive() 
 {
-    HashSet<Element*>::iterator end = m_pageCacheCallbackElements.end();
-    for (HashSet<Element*>::iterator i = m_pageCacheCallbackElements.begin(); i != end; ++i)
-        (*i)->willSaveToCache();
+    HashSet<Element*>::iterator end = m_documentActivationCallbackElements.end();
+    for (HashSet<Element*>::iterator i = m_documentActivationCallbackElements.begin(); i != end; ++i)
+        (*i)->documentWillBecomeInactive();
 }
 
-void Document::didRestoreFromCache() 
+void Document::documentDidBecomeActive() 
 {
-    HashSet<Element*>::iterator end = m_pageCacheCallbackElements.end();
-    for (HashSet<Element*>::iterator i = m_pageCacheCallbackElements.begin(); i != end; ++i)
-        (*i)->didRestoreFromCache();
+    HashSet<Element*>::iterator end = m_documentActivationCallbackElements.end();
+    for (HashSet<Element*>::iterator i = m_documentActivationCallbackElements.begin(); i != end; ++i)
+        (*i)->documentDidBecomeActive();
 }
 
-void Document::registerForCacheCallbacks(Element* e)
+void Document::registerForDocumentActivationCallbacks(Element* e)
 {
-    m_pageCacheCallbackElements.add(e);
+    m_documentActivationCallbackElements.add(e);
 }
 
-void Document::unregisterForCacheCallbacks(Element* e)
+void Document::unregisterForDocumentActivationCallbacks(Element* e)
 {
-    m_pageCacheCallbackElements.remove(e);
+    m_documentActivationCallbackElements.remove(e);
 }
 
 void Document::setShouldCreateRenderers(bool f)
index 9dbfc22..90c2041 100644 (file)
@@ -933,12 +933,12 @@ public:
     bool inPageCache();
     void setInPageCache(bool flag);
     
-    // Elements can register themselves for the "willSaveToCache()" and  
-    // "didRestoreFromCache()" callbacks
-    void registerForCacheCallbacks(Element*);
-    void unregisterForCacheCallbacks(Element*);
-    void willSaveToCache();
-    void didRestoreFromCache();
+    // Elements can register themselves for the "documentWillBecomeInactive()" and  
+    // "documentDidBecomeActive()" callbacks
+    void registerForDocumentActivationCallbacks(Element*);
+    void unregisterForDocumentActivationCallbacks(Element*);
+    void documentWillBecomeInactive();
+    void documentDidBecomeActive();
 
     void setShouldCreateRenderers(bool);
     bool shouldCreateRenderers();
@@ -1043,7 +1043,7 @@ private:
     bool m_inPageCache;
     String m_iconURL;
     
-    HashSet<Element*> m_pageCacheCallbackElements;
+    HashSet<Element*> m_documentActivationCallbackElements;
 
     bool m_useSecureKeyboardEntryWhenActive;
 
index 27551fe..3ed3369 100644 (file)
@@ -181,9 +181,9 @@ public:
     IntSize minimumSizeForResizing() const;
     void setMinimumSizeForResizing(const IntSize&);
 
-    // Use Document::registerForPageCacheCallbacks() to subscribe these
-    virtual void willSaveToCache() { }
-    virtual void didRestoreFromCache() { }
+    // Use Document::registerForDocumentActivationCallbacks() to subscribe these
+    virtual void documentWillBecomeInactive() { }
+    virtual void documentDidBecomeActive() { }
     
     bool isFinishedParsingChildren() const { return m_parsingChildrenFinished; }
     virtual void finishParsingChildren();
index bdd75d5..8c7dca1 100644 (file)
@@ -76,7 +76,7 @@ CachedPage::CachedPage(Page* page)
     cachedPageCounter.increment();
 #endif
     
-    m_document->willSaveToCache(); 
+    m_document->documentWillBecomeInactive(); 
     
     Frame* mainFrame = page->mainFrame();
     mainFrame->clearTimers();
index 3c69ccb..1a83d3a 100644 (file)
@@ -83,7 +83,7 @@ HTMLFormElement::HTMLFormElement(Document* doc)
 HTMLFormElement::~HTMLFormElement()
 {
     if (!m_autocomplete)
-        document()->unregisterForCacheCallbacks(this);
+        document()->unregisterForDocumentActivationCallbacks(this);
 
     delete m_elementAliases;
     delete collectionInfo;
@@ -557,9 +557,9 @@ void HTMLFormElement::parseMappedAttribute(MappedAttribute* attr)
     } else if (attr->name() == autocompleteAttr) {
         m_autocomplete = !equalIgnoringCase(attr->value(), "off");
         if (!m_autocomplete)
-            document()->registerForCacheCallbacks(this);    
+            document()->registerForDocumentActivationCallbacks(this);    
         else
-            document()->unregisterForCacheCallbacks(this);
+            document()->unregisterForDocumentActivationCallbacks(this);
     } else if (attr->name() == onsubmitAttr)
         setEventListenerForTypeAndAttribute(submitEvent, attr);
     else if (attr->name() == onresetAttr)
@@ -733,7 +733,7 @@ void HTMLFormElement::getNamedElements(const AtomicString& name, Vector<RefPtr<N
         addElementAlias(static_cast<HTMLFormControlElement*>(namedItems.first().get()), name);        
 }
 
-void HTMLFormElement::didRestoreFromCache()
+void HTMLFormElement::documentDidBecomeActive()
 {
     ASSERT(!m_autocomplete);
     
@@ -744,13 +744,13 @@ void HTMLFormElement::didRestoreFromCache()
 void HTMLFormElement::willMoveToNewOwnerDocument()
 {
     if (!m_autocomplete)
-        document()->unregisterForCacheCallbacks(this);
+        document()->unregisterForDocumentActivationCallbacks(this);
 }
 
 void HTMLFormElement::didMoveToNewOwnerDocument()
 {
     if(m_autocomplete)
-        document()->registerForCacheCallbacks(this);
+        document()->registerForDocumentActivationCallbacks(this);
 }
 
 void HTMLFormElement::CheckedRadioButtons::addButton(HTMLFormControlElement* element)
index 9c0f8b3..d3db7a5 100644 (file)
@@ -121,7 +121,7 @@ public:
     
     CheckedRadioButtons& checkedRadioButtons() { return m_checkedRadioButtons; }
     
-    virtual void didRestoreFromCache();
+    virtual void documentDidBecomeActive();
 
 protected:
     virtual void willMoveToNewOwnerDocument();
index 34609d6..4bed85f 100644 (file)
@@ -139,8 +139,8 @@ void HTMLInputElement::init()
 
 HTMLInputElement::~HTMLInputElement()
 {
-    if (needsCacheCallback())
-        document()->unregisterForCacheCallbacks(this);
+    if (needsActivationCallback())
+        document()->unregisterForDocumentActivationCallbacks(this);
 
     document()->checkedRadioButtons().removeButton(this);
 
@@ -337,9 +337,9 @@ void HTMLInputElement::setInputType(const String& t)
                 recheckValue();
 
             if (wasPasswordField && !isPasswordField)
-                unregisterForCacheCallbackIfNeeded();
+                unregisterForActivationCallbackIfNeeded();
             else if (!wasPasswordField && isPasswordField)
-                registerForCacheCallbackIfNeeded();
+                registerForActivationCallbackIfNeeded();
 
             if (didRespectHeightAndWidth != willRespectHeightAndWidth) {
                 NamedMappedAttrMap* map = mappedAttributes();
@@ -605,10 +605,10 @@ void HTMLInputElement::parseMappedAttribute(MappedAttribute *attr)
     } else if (attr->name() == autocompleteAttr) {
         if (equalIgnoringCase(attr->value(), "off")) {
             m_autocomplete = Off;
-            registerForCacheCallbackIfNeeded();
+            registerForActivationCallbackIfNeeded();
         } else {
             if (m_autocomplete == Off)
-                unregisterForCacheCallbackIfNeeded();
+                unregisterForActivationCallbackIfNeeded();
             if (attr->isEmpty())
                 m_autocomplete = Uninitialized;
             else
@@ -1533,21 +1533,21 @@ void HTMLInputElement::recheckValue()
         setValue(newValue);
 }
 
-bool HTMLInputElement::needsCacheCallback()
+bool HTMLInputElement::needsActivationCallback()
 {
     return inputType() == PASSWORD || m_autocomplete == Off;
 }
 
-void HTMLInputElement::registerForCacheCallbackIfNeeded()
+void HTMLInputElement::registerForActivationCallbackIfNeeded()
 {
-    if (needsCacheCallback())
-        document()->registerForCacheCallbacks(this);
+    if (needsActivationCallback())
+        document()->registerForDocumentActivationCallbacks(this);
 }
 
-void HTMLInputElement::unregisterForCacheCallbackIfNeeded()
+void HTMLInputElement::unregisterForActivationCallbackIfNeeded()
 {
-    if (!needsCacheCallback())
-        document()->unregisterForCacheCallbacks(this);
+    if (!needsActivationCallback())
+        document()->unregisterForDocumentActivationCallbacks(this);
 }
 
 String HTMLInputElement::constrainValue(const String& proposedValue, int maxLen) const
@@ -1590,17 +1590,17 @@ Selection HTMLInputElement::selection() const
    return static_cast<RenderTextControl*>(renderer())->selection(cachedSelStart, cachedSelEnd);
 }
 
-void HTMLInputElement::didRestoreFromCache()
+void HTMLInputElement::documentDidBecomeActive()
 {
-    ASSERT(needsCacheCallback());
+    ASSERT(needsActivationCallback());
     reset();
 }
 
 void HTMLInputElement::willMoveToNewOwnerDocument()
 {
     // Always unregister for cache callbacks when leaving a document, even if we would otherwise like to be registered
-    if (needsCacheCallback())
-        document()->unregisterForCacheCallbacks(this);
+    if (needsActivationCallback())
+        document()->unregisterForDocumentActivationCallbacks(this);
         
     document()->checkedRadioButtons().removeButton(this);
     
@@ -1609,7 +1609,7 @@ void HTMLInputElement::willMoveToNewOwnerDocument()
 
 void HTMLInputElement::didMoveToNewOwnerDocument()
 {
-    registerForCacheCallbackIfNeeded();
+    registerForActivationCallbackIfNeeded();
         
     HTMLFormControlElementWithState::didMoveToNewOwnerDocument();
 }
index 92ae6f6..85f6b91 100644 (file)
@@ -198,7 +198,7 @@ public:
 
     String constrainValue(const String& proposedValue) const;
 
-    virtual void didRestoreFromCache();
+    virtual void documentDidBecomeActive();
 
     virtual void getSubresourceAttributeStrings(Vector<String>&) const;
     
@@ -216,9 +216,9 @@ private:
     String constrainValue(const String& proposedValue, int maxLen) const;
     void recheckValue();
     
-    bool needsCacheCallback();
-    void registerForCacheCallbackIfNeeded();
-    void unregisterForCacheCallbackIfNeeded();
+    bool needsActivationCallback();
+    void registerForActivationCallbackIfNeeded();
+    void unregisterForActivationCallbackIfNeeded();
 
     String m_value;
     String m_originalValue;
index 5ffa9b8..a8b068e 100644 (file)
@@ -80,15 +80,15 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* doc)
     , m_loadNestingLevel(0)
     , m_terminateLoadBelowNestingLevel(0)
     , m_pausedInternal(false)
-    , m_inPageCache(false)
+    , m_inActiveDocument(true)
     , m_player(0)
 {
-    document()->registerForCacheCallbacks(this);
+    document()->registerForDocumentActivationCallbacks(this);
 }
 
 HTMLMediaElement::~HTMLMediaElement()
 {
-    document()->unregisterForCacheCallbacks(this);
+    document()->unregisterForDocumentActivationCallbacks(this);
 }
 
 bool HTMLMediaElement::checkDTD(const Node* newChild)
@@ -998,8 +998,8 @@ void HTMLMediaElement::setPausedInternal(bool b)
     m_pausedInternal = b;
     updatePlayState();
 }
-    
-void HTMLMediaElement::willSaveToCache()
+
+void HTMLMediaElement::documentWillBecomeInactive()
 {
     // 3.14.9.4. Loading the media resource
     // 14
@@ -1017,7 +1017,7 @@ void HTMLMediaElement::willSaveToCache()
             dispatchEventForType(emptiedEvent, false, true);
         }
     }
-    m_inPageCache = true;
+    m_inActiveDocument = false;
     // Stop the playback without generating events
     setPausedInternal(true);
 
@@ -1025,9 +1025,9 @@ void HTMLMediaElement::willSaveToCache()
         renderer()->updateFromElement();
 }
 
-void HTMLMediaElement::didRestoreFromCache()
+void HTMLMediaElement::documentDidBecomeActive()
 {
-    m_inPageCache = false;
+    m_inActiveDocument = true;
     setPausedInternal(false);
 
     if (m_error && m_error->code() == MediaError::MEDIA_ERR_ABORTED) {
index 6fd5de3..c368f54 100644 (file)
@@ -65,7 +65,7 @@ public:
     // Pauses playback without changing any states or generating events
     void setPausedInternal(bool);
     
-    bool inPageCache() const { return m_inPageCache; }
+    bool inActiveDocument() const { return m_inActiveDocument; }
     
 // DOM API
 // error state
@@ -132,8 +132,8 @@ protected:
     float getTimeOffsetAttribute(const QualifiedName&, float valueOnError) const;
     void setTimeOffsetAttribute(const QualifiedName&, float value);
     
-    virtual void willSaveToCache();
-    virtual void didRestoreFromCache();
+    virtual void documentWillBecomeInactive();
+    virtual void documentDidBecomeActive();
     
     void initAndDispatchProgressEvent(const AtomicString& eventName);
     void dispatchEventAsync(const AtomicString& eventName);
@@ -199,7 +199,7 @@ protected:
     unsigned m_terminateLoadBelowNestingLevel;
     
     bool m_pausedInternal;
-    bool m_inPageCache;
+    bool m_inActiveDocument;
 
     OwnPtr<MediaPlayer> m_player;
 };
index 2d371e2..277028a 100644 (file)
@@ -3662,7 +3662,7 @@ void FrameLoader::opened()
         updateHistoryForClientRedirect();
 
     if (m_documentLoader->isLoadingFromCachedPage()) {
-        m_frame->document()->didRestoreFromCache();
+        m_frame->document()->documentDidBecomeActive();
         
         // Force a layout to update view size and thereby update scrollbars.
         m_client->forceLayout();
index 6492fae..80758c7 100644 (file)
@@ -148,8 +148,11 @@ Page::~Page()
     setGroupName(String());
     allPages->remove(this);
     
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+        if (frame->document())
+            frame->document()->documentWillBecomeInactive();
         frame->pageDestroyed();
+    }
     m_editorClient->pageDestroyed();
     if (m_parentInspectorController)
         m_parentInspectorController->pageDestroyed();
index e32d978..52cae08 100644 (file)
@@ -224,7 +224,7 @@ void RenderMedia::updateFromElement()
 void RenderMedia::updateControls()
 {
     HTMLMediaElement* media = mediaElement();
-    if (!media->controls() || media->inPageCache()) {
+    if (!media->controls() || !media->inActiveDocument()) {
         if (m_controlsShadowRoot) {
             m_controlsShadowRoot->detach();
             m_panel = 0;
index 09619f0..d677725 100644 (file)
@@ -120,7 +120,7 @@ void RenderVideo::updatePlayer()
     MediaPlayer* mediaPlayer = player();
     if (!mediaPlayer)
         return;
-    if (mediaElement()->inPageCache()) {
+    if (!mediaElement()->inActiveDocument()) {
         mediaPlayer->setVisible(false);
         return;
     }
index a56c48d..e469955 100644 (file)
@@ -71,12 +71,12 @@ SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc)
     , m_containerSize(300, 150)
     , m_hasSetContainerSize(false)
 {
-    doc->registerForCacheCallbacks(this);
+    doc->registerForDocumentActivationCallbacks(this);
 }
 
 SVGSVGElement::~SVGSVGElement()
 {
-    document()->unregisterForCacheCallbacks(this);
+    document()->unregisterForDocumentActivationCallbacks(this);
     // There are cases where removedFromDocument() is not called.
     // see ContainerNode::removeAllChildren, called by it's destructor.
     document()->accessSVGExtensions()->removeTimeContainer(this);
@@ -519,12 +519,12 @@ void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement)
     renderer()->setNeedsLayout(true);
 }
     
-void SVGSVGElement::willSaveToCache()
+void SVGSVGElement::documentWillBecomeInactive()
 {
     pauseAnimations();
 }
 
-void SVGSVGElement::willRestoreFromCache()
+void SVGSVGElement::documentDidBecomeActive()
 {
     unpauseAnimations();
 }
index 4aa5d3e..bd8b7f9 100644 (file)
@@ -150,8 +150,8 @@ namespace WebCore
         ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGNames::svgTagString, SVGNames::widthAttrString, SVGLength, Width, width)
         ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGNames::svgTagString, SVGNames::heightAttrString, SVGLength, Height, height)
 
-        virtual void willSaveToCache();
-        virtual void willRestoreFromCache();
+        virtual void documentWillBecomeInactive();
+        virtual void documentDidBecomeActive();
 
         bool m_useCurrentView;
         RefPtr<SMILTimeContainer> m_timeContainer;