Title: [156274] trunk/Source/WebCore
Revision
156274
Author
[email protected]
Date
2013-09-23 09:32:18 -0700 (Mon, 23 Sep 2013)

Log Message

Document::destroyRenderTree() shouldn't do anything but.
<https://webkit.org/b/121786>

Reviewed by Anders Carlsson.

Move everything in destroyRenderTree() that doesn't actually destroy
render trees to prepareForDestruction() instead.

Destroying the render tree is now a reparable operation.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (156273 => 156274)


--- trunk/Source/WebCore/ChangeLog	2013-09-23 15:47:44 UTC (rev 156273)
+++ trunk/Source/WebCore/ChangeLog	2013-09-23 16:32:18 UTC (rev 156274)
@@ -1,3 +1,15 @@
+2013-09-23  Andreas Kling  <[email protected]>
+
+        Document::destroyRenderTree() shouldn't do anything but.
+        <https://webkit.org/b/121786>
+
+        Reviewed by Anders Carlsson.
+
+        Move everything in destroyRenderTree() that doesn't actually destroy
+        render trees to prepareForDestruction() instead.
+
+        Destroying the render tree is now a reparable operation.
+
 2013-09-23  Allan Sandfeld Jensen  <[email protected]>
 
         [Qt] Tiled backing-store causes wrong translation

Modified: trunk/Source/WebCore/dom/Document.cpp (156273 => 156274)


--- trunk/Source/WebCore/dom/Document.cpp	2013-09-23 15:47:44 UTC (rev 156273)
+++ trunk/Source/WebCore/dom/Document.cpp	2013-09-23 16:32:18 UTC (rev 156274)
@@ -2073,41 +2073,14 @@
 
     TemporaryChange<bool> change(m_renderTreeBeingDestroyed, true);
 
-    if (isPluginDocument())
-        toPluginDocument(this)->detachFromPluginElement();
-
-#if ENABLE(POINTER_LOCK)
-    if (page())
-        page()->pointerLockController()->documentDetached(this);
-#endif
-
     if (this == topDocument())
         clearAXObjectCache();
 
-    stopActiveDOMObjects();
-    m_eventQueue.close();
-#if ENABLE(FULLSCREEN_API)
-    m_fullScreenChangeEventTargetQueue.clear();
-    m_fullScreenErrorEventTargetQueue.clear();
-#endif
-
-#if ENABLE(REQUEST_ANIMATION_FRAME)
-    clearScriptedAnimationController();
-#endif
-
     documentWillBecomeInactive();
 
-#if ENABLE(SHARED_WORKERS)
-    SharedWorkerRepository::documentDetached(this);
-#endif
+    if (FrameView* frameView = view())
+        frameView->detachCustomScrollbars();
 
-    if (m_frame) {
-        FrameView* view = m_frame->view();
-        if (view)
-            view->detachCustomScrollbars();
-
-    }
-
 #if ENABLE(FULLSCREEN_API)
     if (m_fullScreenRenderer)
         setFullScreenRenderer(0);
@@ -2129,20 +2102,12 @@
         renderView()->destroy();
     setRenderView(0);
 
-#if ENABLE(TOUCH_EVENTS)
-    if (m_touchEventTargets && m_touchEventTargets->size() && parentDocument())
-        parentDocument()->didRemoveEventTargetNode(this);
-#endif
-
 #if ENABLE(IOS_TEXT_AUTOSIZING)
     // Do this before the arena is cleared, which is needed to deref the RenderStyle on TextAutoSizingKey.
     m_textAutoSizedNodes.clear();
 #endif
 
     m_renderArena.clear();
-
-    if (m_mediaQueryMatcher)
-        m_mediaQueryMatcher->documentDestroyed();
 }
 
 void Document::prepareForDestruction()
@@ -2150,7 +2115,40 @@
     disconnectDescendantFrames();
     if (m_domWindow && m_frame)
         m_domWindow->willDetachDocumentFromFrame();
+
     destroyRenderTree();
+
+    if (isPluginDocument())
+        toPluginDocument(this)->detachFromPluginElement();
+
+#if ENABLE(POINTER_LOCK)
+    if (page())
+        page()->pointerLockController()->documentDetached(this);
+#endif
+
+    stopActiveDOMObjects();
+    m_eventQueue.close();
+#if ENABLE(FULLSCREEN_API)
+    m_fullScreenChangeEventTargetQueue.clear();
+    m_fullScreenErrorEventTargetQueue.clear();
+#endif
+
+#if ENABLE(REQUEST_ANIMATION_FRAME)
+    clearScriptedAnimationController();
+#endif
+
+#if ENABLE(SHARED_WORKERS)
+    SharedWorkerRepository::documentDetached(this);
+#endif
+
+#if ENABLE(TOUCH_EVENTS)
+    if (m_touchEventTargets && m_touchEventTargets->size() && parentDocument())
+        parentDocument()->didRemoveEventTargetNode(this);
+#endif
+
+    if (m_mediaQueryMatcher)
+        m_mediaQueryMatcher->documentDestroyed();
+
     disconnectFromFrame();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to