Title: [156270] trunk/Source/WebCore
Revision
156270
Author
[email protected]
Date
2013-09-23 06:04:43 -0700 (Mon, 23 Sep 2013)

Log Message

Unify code paths leading to render tree teardown.
<https://webkit.org/b/121785>

Reviewed by Antti Koivisto.

Make Document::prepareForDestruction() fit all the call sites that were
doing destroyRenderTree() + disconnectFromFrame().

- disconnectDescendantFrames() is already a no-op if there are no frames.
- willDetachDocumentFromFrame() will only run if there is a frame.

This is another step towards making tree rebuild possible.

Removed some age-old FIXMEs about why we aren't calling willRemove(),
a long-gone function.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (156269 => 156270)


--- trunk/Source/WebCore/ChangeLog	2013-09-23 12:03:37 UTC (rev 156269)
+++ trunk/Source/WebCore/ChangeLog	2013-09-23 13:04:43 UTC (rev 156270)
@@ -1,3 +1,21 @@
+2013-09-23  Andreas Kling  <[email protected]>
+
+        Unify code paths leading to render tree teardown.
+        <https://webkit.org/b/121785>
+
+        Reviewed by Antti Koivisto.
+
+        Make Document::prepareForDestruction() fit all the call sites that were
+        doing destroyRenderTree() + disconnectFromFrame().
+
+        - disconnectDescendantFrames() is already a no-op if there are no frames.
+        - willDetachDocumentFromFrame() will only run if there is a frame.
+
+        This is another step towards making tree rebuild possible.
+
+        Removed some age-old FIXMEs about why we aren't calling willRemove(),
+        a long-gone function.
+
 2013-09-23  Patrick Gansterer  <[email protected]>
 
         Cleanup CMake files in WebCore

Modified: trunk/Source/WebCore/dom/Document.cpp (156269 => 156270)


--- trunk/Source/WebCore/dom/Document.cpp	2013-09-23 12:03:37 UTC (rev 156269)
+++ trunk/Source/WebCore/dom/Document.cpp	2013-09-23 13:04:43 UTC (rev 156270)
@@ -2148,7 +2148,7 @@
 void Document::prepareForDestruction()
 {
     disconnectDescendantFrames();
-    if (m_domWindow)
+    if (m_domWindow && m_frame)
         m_domWindow->willDetachDocumentFromFrame();
     destroyRenderTree();
     disconnectFromFrame();

Modified: trunk/Source/WebCore/history/CachedFrame.cpp (156269 => 156270)


--- trunk/Source/WebCore/history/CachedFrame.cpp	2013-09-23 12:03:37 UTC (rev 156269)
+++ trunk/Source/WebCore/history/CachedFrame.cpp	2013-09-23 13:04:43 UTC (rev 156270)
@@ -275,9 +275,7 @@
     m_document->removeAllEventListeners();
 
     m_document->setInPageCache(false);
-    // FIXME: We don't call willRemove here. Why is that OK?
-    m_document->destroyRenderTree();
-    m_document->disconnectFromFrame();
+    m_document->prepareForDestruction();
 
     clear();
 }

Modified: trunk/Source/WebCore/page/Frame.cpp (156269 => 156270)


--- trunk/Source/WebCore/page/Frame.cpp	2013-09-23 12:03:37 UTC (rev 156269)
+++ trunk/Source/WebCore/page/Frame.cpp	2013-09-23 13:04:43 UTC (rev 156270)
@@ -246,10 +246,8 @@
     // Prepare for destruction now, so any unload event handlers get run and the DOMWindow is
     // notified. If we wait until the view is destroyed, then things won't be hooked up enough for
     // these calls to work.
-    if (!view && m_doc && m_doc->attached() && !m_doc->inPageCache()) {
-        // FIXME: We don't call willRemove here. Why is that OK?
+    if (!view && m_doc && m_doc->attached() && !m_doc->inPageCache())
         m_doc->prepareForDestruction();
-    }
     
     if (m_view)
         m_view->unscheduleRelayout();
@@ -273,11 +271,8 @@
 {
     ASSERT(!newDocument || newDocument->frame() == this);
 
-    if (m_doc && m_doc->attached() && !m_doc->inPageCache()) {
-        // FIXME: We don't call willRemove here. Why is that OK?
-        m_doc->destroyRenderTree();
-        m_doc->disconnectFromFrame();
-    }
+    if (m_doc && m_doc->attached() && !m_doc->inPageCache())
+        m_doc->prepareForDestruction();
 
     m_doc = newDocument.get();
     ASSERT(!m_doc || m_doc->domWindow());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to