Title: [212886] branches/safari-603.1.30.0-branch/Source/WebCore

Diff

Modified: branches/safari-603.1.30.0-branch/Source/WebCore/ChangeLog (212885 => 212886)


--- branches/safari-603.1.30.0-branch/Source/WebCore/ChangeLog	2017-02-23 16:15:18 UTC (rev 212885)
+++ branches/safari-603.1.30.0-branch/Source/WebCore/ChangeLog	2017-02-23 16:15:22 UTC (rev 212886)
@@ -1,3 +1,29 @@
+2017-02-22  Brent Fulgham  <bfulg...@apple.com>
+
+        Merge r212554. rdar://problem/30636115
+
+    2017-02-16  Brent Fulgham  <bfulg...@apple.com>
+
+            RenderView needs to be updated when FrameView changes
+            https://bugs.webkit.org/show_bug.cgi?id=168481
+            <rdar://problem/30339638>
+
+            Reviewed by Andreas Kling.
+
+            The state of the Document's RenderView can get out of sync with the Frame's FrameView.
+            We need a notification mechanism so that modifications to the Frame's view are properly
+            relayed to Document so that it can have a correct RenderView.
+
+            * dom/Document.cpp:
+            (WebCore::Document::didBecomeCurrentDocumentInView): Create an updated render tree (if
+            one does not already exist).
+            (WebCore::Document::destroyRenderTree): Remove an incorrect ASSERT. We may enter this
+            code when the Frame uses 'setView(nullptr)', which happens during certain  updates.
+            * dom/Document.h:
+            * page/Frame.cpp:
+            (WebCore::Frame::setView): Destroy the old render tree (if present) before switching to
+            the new view. Then notify the document that it is now the current document in the new view.
+
 2017-02-22  Matthew Hanson  <matthew_han...@apple.com>
 
         rdar://problem/30657889

Modified: branches/safari-603.1.30.0-branch/Source/WebCore/dom/Document.cpp (212885 => 212886)


--- branches/safari-603.1.30.0-branch/Source/WebCore/dom/Document.cpp	2017-02-23 16:15:18 UTC (rev 212885)
+++ branches/safari-603.1.30.0-branch/Source/WebCore/dom/Document.cpp	2017-02-23 16:15:22 UTC (rev 212886)
@@ -2234,10 +2234,16 @@
     FrameDestructionObserver::frameDestroyed();
 }
 
+void Document::didBecomeCurrentDocumentInView()
+{
+    ASSERT(view());
+    if (!hasLivingRenderTree())
+        createRenderTree();
+}
+
 void Document::destroyRenderTree()
 {
     ASSERT(hasLivingRenderTree());
-    ASSERT(m_pageCacheState != InPageCache);
 
     FrameView* frameView = frame()->document() == this ? frame()->view() : nullptr;
 

Modified: branches/safari-603.1.30.0-branch/Source/WebCore/dom/Document.h (212885 => 212886)


--- branches/safari-603.1.30.0-branch/Source/WebCore/dom/Document.h	2017-02-23 16:15:18 UTC (rev 212885)
+++ branches/safari-603.1.30.0-branch/Source/WebCore/dom/Document.h	2017-02-23 16:15:22 UTC (rev 212886)
@@ -566,6 +566,7 @@
     void destroyRenderTree();
     void disconnectFromFrame();
     void prepareForDestruction();
+    void didBecomeCurrentDocumentInView();
 
     // Override ScriptExecutionContext methods to do additional work
     bool shouldBypassMainWorldContentSecurityPolicy() const final;

Modified: branches/safari-603.1.30.0-branch/Source/WebCore/page/Frame.cpp (212885 => 212886)


--- branches/safari-603.1.30.0-branch/Source/WebCore/page/Frame.cpp	2017-02-23 16:15:18 UTC (rev 212885)
+++ branches/safari-603.1.30.0-branch/Source/WebCore/page/Frame.cpp	2017-02-23 16:15:22 UTC (rev 212886)
@@ -256,8 +256,15 @@
     if (m_eventHandler)
         m_eventHandler->clear();
 
+    bool hadLivingRenderTree = m_doc ? m_doc->hasLivingRenderTree() : false;
+    if (hadLivingRenderTree)
+        m_doc->destroyRenderTree();
+
     m_view = WTFMove(view);
 
+    if (hadLivingRenderTree && m_view)
+        m_doc->didBecomeCurrentDocumentInView();
+
     // Only one form submission is allowed per view of a part.
     // Since this part may be getting reused as a result of being
     // pulled from the back/forward cache, reset this flag.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to