Title: [212601] branches/safari-603-branch/Source/WebCore
Revision
212601
Author
matthew_han...@apple.com
Date
2017-02-17 17:13:01 -0800 (Fri, 17 Feb 2017)

Log Message

Merge r212554. rdar://problem/30339638

Modified Paths

Diff

Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (212600 => 212601)


--- branches/safari-603-branch/Source/WebCore/ChangeLog	2017-02-18 01:12:58 UTC (rev 212600)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog	2017-02-18 01:13:01 UTC (rev 212601)
@@ -1,5 +1,31 @@
 2017-02-17  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r212554. rdar://problem/30339638
+
+    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-17  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r212354. rdar://problem/30450371
 
     2017-02-14  Ryosuke Niwa  <rn...@webkit.org>

Modified: branches/safari-603-branch/Source/WebCore/dom/Document.cpp (212600 => 212601)


--- branches/safari-603-branch/Source/WebCore/dom/Document.cpp	2017-02-18 01:12:58 UTC (rev 212600)
+++ branches/safari-603-branch/Source/WebCore/dom/Document.cpp	2017-02-18 01:13:01 UTC (rev 212601)
@@ -2227,6 +2227,13 @@
     observeFrame(nullptr);
 }
 
+void Document::didBecomeCurrentDocumentInView()
+{
+    ASSERT(view());
+    if (!hasLivingRenderTree())
+        createRenderTree();
+}
+
 void Document::frameDestroyed()
 {
     // disconnectFromFrame() must be called before destroying the Frame.

Modified: branches/safari-603-branch/Source/WebCore/dom/Document.h (212600 => 212601)


--- branches/safari-603-branch/Source/WebCore/dom/Document.h	2017-02-18 01:12:58 UTC (rev 212600)
+++ branches/safari-603-branch/Source/WebCore/dom/Document.h	2017-02-18 01:13:01 UTC (rev 212601)
@@ -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-branch/Source/WebCore/page/Frame.cpp (212600 => 212601)


--- branches/safari-603-branch/Source/WebCore/page/Frame.cpp	2017-02-18 01:12:58 UTC (rev 212600)
+++ branches/safari-603-branch/Source/WebCore/page/Frame.cpp	2017-02-18 01:13:01 UTC (rev 212601)
@@ -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