Title: [217678] branches/safari-603-branch
Revision
217678
Author
[email protected]
Date
2017-06-01 12:52:28 -0700 (Thu, 01 Jun 2017)

Log Message

Cherry-pick r212173. rdar://problem/32080671

Modified Paths

Added Paths

Diff

Added: branches/safari-603-branch/0001-Cherry-pick-r216459.-rdar-problem-32119857.patch (0 => 217678)


--- branches/safari-603-branch/0001-Cherry-pick-r216459.-rdar-problem-32119857.patch	                        (rev 0)
+++ branches/safari-603-branch/0001-Cherry-pick-r216459.-rdar-problem-32119857.patch	2017-06-01 19:52:28 UTC (rev 217678)
@@ -0,0 +1,152 @@
+From 8e0d41070cccca08f148c317bde1ac1a8114e46a Mon Sep 17 00:00:00 2001
+From: "[email protected]"
+ <[email protected]@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
+Date: Mon, 8 May 2017 22:24:29 +0000
+Subject: [PATCH] Cherry-pick r216459. rdar://problem/32119857
+
+---
+ JSTests/ChangeLog                               | 14 ++++++++++++
+ JSTests/stress/bug-171786.js                    | 15 +++++++++++++
+ Source/_javascript_Core/ChangeLog                 | 29 +++++++++++++++++++++++++
+ Source/_javascript_Core/bytecode/BytecodeUseDef.h |  4 ++--
+ Source/_javascript_Core/bytecode/CodeBlock.cpp    |  4 ++--
+ Source/_javascript_Core/dfg/DFGByteCodeParser.cpp |  2 +-
+ 6 files changed, 63 insertions(+), 5 deletions(-)
+ create mode 100644 JSTests/stress/bug-171786.js
+
+diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog
+index 627a80b31c5..be722c32e19 100644
+--- a/JSTests/ChangeLog
++++ b/JSTests/ChangeLog
+@@ -1,3 +1,17 @@
++2017-06-01  Matthew Hanson  <[email protected]>
++
++        Cherry-pick r216459. rdar://problem/32119857
++
++    2017-05-08  Mark Lam  <[email protected]>
++
++            op_throw_static_error's use of its first operand should be reflected in DFG BytecodeUseDef as well.
++            https://bugs.webkit.org/show_bug.cgi?id=171786
++            <rdar://problem/32051023>
++
++            Reviewed by Saam Barati.
++
++            * stress/bug-171786.js: Added.
++
+ 2017-05-25  Saam Barati  <[email protected]>
+ 
+         Cherry-pick r217438. rdar://problem/32385704
+diff --git a/JSTests/stress/bug-171786.js b/JSTests/stress/bug-171786.js
+new file mode 100644
+index 00000000000..2e467557e74
+--- /dev/null
++++ b/JSTests/stress/bug-171786.js
+@@ -0,0 +1,15 @@
++
++function foo(i, x) {
++    return String.prototype.big.call(x);
++}
++noInline(foo);
++
++for (var i = 0; i < 1000; i++) {
++    try {
++        if (i < 200)
++            foo(i, "hello");
++        else
++            foo(i, undefined);
++    } catch(e) {
++    }
++}
+diff --git a/Source/_javascript_Core/ChangeLog b/Source/_javascript_Core/ChangeLog
+index 95139187833..b27ac5b6b33 100644
+--- a/Source/_javascript_Core/ChangeLog
++++ b/Source/_javascript_Core/ChangeLog
+@@ -1,3 +1,32 @@
++2017-06-01  Matthew Hanson  <[email protected]>
++
++        Cherry-pick r216459. rdar://problem/32119857
++
++    2017-05-08  Mark Lam  <[email protected]>
++
++            op_throw_static_error's use of its first operand should be reflected in DFG BytecodeUseDef as well.
++            https://bugs.webkit.org/show_bug.cgi?id=171786
++            <rdar://problem/32051023>
++
++            Reviewed by Saam Barati.
++
++            * bytecode/BytecodeDumper.cpp:
++            (JSC::BytecodeDumper<Block>::dumpBytecode):
++            - Fix BytecodeDumper to dump op_throw_static_error correctly.  Previously,
++              it was expecting op1 to always be a constant.  r206870 changed it to take a
++              variable string as well.
++
++            * bytecode/BytecodeUseDef.h:
++            (JSC::computeUsesForBytecodeOffset):
++            - Fix the bug.
++
++            * dfg/DFGByteCodeParser.cpp:
++            (JSC::DFG::ByteCodeParser::parseBlock):
++            - Move the Phantom of op1 after the ThrowStaticError node, because technically,
++              the ThrowStaticError represents op_throw_static_error, and op_throw_static_error
++              uses op1.  In practice, this probably doesn't matter, but let's have the code
++              accurately communicate the behavior we're expecting.
++
+ 2017-05-25  Saam Barati  <[email protected]>
+ 
+         Cherry-pick r217438. rdar://problem/32385704
+diff --git a/Source/_javascript_Core/bytecode/BytecodeUseDef.h b/Source/_javascript_Core/bytecode/BytecodeUseDef.h
+index 3a24d0f43a2..0f592cda233 100644
+--- a/Source/_javascript_Core/bytecode/BytecodeUseDef.h
++++ b/Source/_javascript_Core/bytecode/BytecodeUseDef.h
+@@ -40,7 +40,6 @@ void computeUsesForBytecodeOffset(Block* codeBlock, OpcodeID opcodeID, Instructi
+     // No uses.
+     case op_new_regexp:
+     case op_new_array_buffer:
+-    case op_throw_static_error:
+     case op_debug:
+     case op_jneq_ptr:
+     case op_loop_hint:
+@@ -71,7 +70,8 @@ void computeUsesForBytecodeOffset(Block* codeBlock, OpcodeID opcodeID, Instructi
+     case op_jneq_null:
+     case op_dec:
+     case op_inc:
+-    case op_log_shadow_chicken_prologue: {
++    case op_log_shadow_chicken_prologue:
++    case op_throw_static_error: {
+         ASSERT(opcodeLengths[opcodeID] > 1);
+         functor(codeBlock, instruction, opcodeID, instruction[1].u.operand);
+         return;
+diff --git a/Source/_javascript_Core/bytecode/CodeBlock.cpp b/Source/_javascript_Core/bytecode/CodeBlock.cpp
+index 7623887bc86..efb7629b7cf 100644
+--- a/Source/_javascript_Core/bytecode/CodeBlock.cpp
++++ b/Source/_javascript_Core/bytecode/CodeBlock.cpp
+@@ -1672,10 +1672,10 @@ void CodeBlock::dumpBytecode(
+             break;
+         }
+         case op_throw_static_error: {
+-            int k0 = (++it)->u.operand;
++            int r0 = (++it)->u.operand;
+             ErrorType k1 = static_cast<ErrorType>((++it)->u.unsignedValue);
+             printLocationAndOp(out, exec, location, it, "throw_static_error");
+-            out.printf("%s, ", constantName(k0).data());
++            out.printf("%s, ", registerName(r0).data());
+             out.print(k1);
+             break;
+         }
+diff --git a/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp b/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp
+index b38879df36b..2245ba3ca2a 100644
+--- a/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp
++++ b/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp
+@@ -4857,8 +4857,8 @@ bool ByteCodeParser::parseBlock(unsigned limit)
+             LAST_OPCODE(op_throw);
+             
+         case op_throw_static_error:
+-            addToGraph(Phantom, get(VirtualRegister(currentInstruction[1].u.operand))); // Keep argument live.
+             addToGraph(ThrowStaticError);
++            addToGraph(Phantom, get(VirtualRegister(currentInstruction[1].u.operand))); // Keep argument live.
+             flushForTerminal();
+             addToGraph(Unreachable);
+             LAST_OPCODE(op_throw_static_error);
+-- 
+2.12.2 (Apple Git-86)
+

Modified: branches/safari-603-branch/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html (217677 => 217678)


--- branches/safari-603-branch/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html	2017-06-01 19:52:28 UTC (rev 217678)
@@ -10,7 +10,6 @@
 if (window.testRunner) {
     testRunner.setCanOpenWindows();
     testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-    testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
 }
 
 // Window we will be controlling.

Modified: branches/safari-603-branch/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html (217677 => 217678)


--- branches/safari-603-branch/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html	2017-06-01 19:52:28 UTC (rev 217678)
@@ -22,7 +22,6 @@
         testRunner.waitUntilDone();
         testRunner.setCanOpenWindows();
         testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-        testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
     }
     log("open page with data urls");
     window.open("resources/cached-page-with-data-urls.html");

Modified: branches/safari-603-branch/LayoutTests/fast/harness/use-page-cache.html (217677 => 217678)


--- branches/safari-603-branch/LayoutTests/fast/harness/use-page-cache.html	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/LayoutTests/fast/harness/use-page-cache.html	2017-06-01 19:52:28 UTC (rev 217678)
@@ -28,7 +28,6 @@
         testRunner.waitUntilDone();
         testRunner.setCanOpenWindows();
         testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-        testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
     }
     log("open page-1");
     window.open("resources/cached-page-1.html");

Modified: branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html (217677 => 217678)


--- branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html	2017-06-01 19:52:28 UTC (rev 217678)
@@ -14,7 +14,6 @@
     if (window.testRunner) {
         testRunner.setCanOpenWindows();
         testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
-        testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
     }
     testWindow = window.open('resources/no-popstate-when-back-to-stateless-entry-1.html');
     if (!testWindow)

Modified: branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html (217677 => 217678)


--- branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html	2017-06-01 19:52:28 UTC (rev 217678)
@@ -14,7 +14,6 @@
     if (window.testRunner) {
         testRunner.setCanOpenWindows();
         testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
-        testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
     }
     testWindow = window.open('resources/popstate-fires-with-page-cache-1.html');
     if (!testWindow)

Modified: branches/safari-603-branch/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html (217677 => 217678)


--- branches/safari-603-branch/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html	2017-06-01 19:52:28 UTC (rev 217678)
@@ -7,7 +7,6 @@
             testRunner.waitUntilDone();
             testRunner.setCanOpenWindows();
             testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-            testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
         }
 
         window.finishedTest = function (layerTree)

Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/ChangeLog	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog	2017-06-01 19:52:28 UTC (rev 217678)
@@ -1,5 +1,72 @@
 2017-06-01  Matthew Hanson  <[email protected]>
 
+        Cherry-pick r212173. rdar://problem/32080671
+
+    2017-02-10  Daniel Bates  <[email protected]>
+
+            Detach frame from document when entering page cache
+            https://bugs.webkit.org/show_bug.cgi?id=166774
+            <rdar://problem/29904368>
+
+            Reviewed by Chris Dumez.
+
+            When a page enters the page cache it is unnecessary for it to hold a reference to its
+            associated frame because subsequent interactions with the page do not need to make use
+            of it. Once a page exits the page cache we associate it with its frame.
+
+            * dom/Document.cpp:
+            (WebCore::Document::frameDestroyed): Update comment to reflect the renaming of disconnectFromFrame().
+            (WebCore::Document::attachToCachedFrame): Added.
+            (WebCore::Document::detachFromCachedFrame): Added.
+            (WebCore::Document::prepareForDestruction): Only call CSSAnimationController::detachFromDocument() if
+            we have a frame. Substitute detachFromFrame() for disconnectFromFrame() as the latter was renamed to
+            the former.
+            (WebCore::Document::hasEverCalledWindowOpen): Deleted.
+            (WebCore::Document::markHasCalledWindowOpen): Deleted.
+            (WebCore::Document::disconnectFromFrame): Renamed to detachFromFrame.
+            * dom/Document.h:
+            (WebCore::Document::detachFromFrame): Renamed; formerly named disconnectFromFrame(). Changed
+            visibility from public to private and made this function inline.
+            * history/CachedFrame.cpp:
+            (WebCore::CachedFrameBase::pruneDetachedChildFrames): Remove cached child frames that were
+            removed from the page when it was in the page cache as there is no need to restore such frames.
+            (WebCore::CachedFrameBase::restore): Call pruneDetachedChildFrames() before restoring the
+            frame tree.
+            (WebCore::CachedFrame::CachedFrame): Detach from the frame.
+            (WebCore::CachedFrame::open): Assert that we have a document and re-attach the frame.
+            (WebCore::CachedFrame::destroy): Update assertion as this function should only be called for a
+            frameless document. Only detach the FrameView, DocumentLoader, and Page when the cached frame is for
+            subframe and is associated with a Page object. Call CSSAnimationController::detachFromDocument() to
+            detach the animation controller from the document as it is being destroyed. We have to do this here
+            because the document does not have a frame. And Document::prepareForDestruction() only calls
+            CSSAnimationController::detachFromDocument() if the document has a frame.
+            * history/CachedFrame.h:
+            * history/PageCache.cpp:
+            (WebCore::canCachePage): Remove logic that prevents caching of a page that called window.open()
+            or has an opener as it is feasible to keep such pages in the page cache.
+            * html/HTMLFrameElementBase.cpp:
+            (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Fix style nit.
+            * loader/FrameLoader.cpp:
+            (WebCore::FrameLoader::frameDetached): Only stop all loaders and stop active DOM objects if the
+            page is not in- or about to enter- the page cache. A page in the page cache has finished loading
+            and its active DOM objects are suspended. Also fix style nit in comment.
+            (WebCore::FrameLoader::detachFromParent): Only stop all loaders if the page is not in- or about to
+            enter- the page cache. A page in the page cache has finished loading. Also added a comment to explain
+            that we protect the frame because stopAllLoaders() can cause the frame to be deallocated.
+            * page/DOMWindow.cpp:
+            (WebCore::DOMWindow::createWindow): Remove logic to call markHasCalledWindowOpen() as this
+            function will be removed.
+            * page/DiagnosticLoggingKeys.cpp:
+            (WebCore::DiagnosticLoggingKeys::hasCalledWindowOpenKey): Deleted.
+            (WebCore::DiagnosticLoggingKeys::hasOpenerKey): Deleted.
+            * page/DiagnosticLoggingKeys.h:
+            * page/Page.cpp:
+            (WebCore::Page::openedByWindowOpen): Deleted.
+            * page/Page.h:
+            * page/Settings.in: Remove setting allowsPageCacheWithWindowOpener.
+
+2017-06-01  Matthew Hanson  <[email protected]>
+
         Cherry-pick r211501. rdar://problem/32080671
 
     2017-02-01  Antoine Quint  <[email protected]>

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


--- branches/safari-603-branch/Source/WebCore/dom/Document.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/dom/Document.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -36,6 +36,7 @@
 #include "CSSStyleDeclaration.h"
 #include "CSSStyleSheet.h"
 #include "CachedCSSStyleSheet.h"
+#include "CachedFrame.h"
 #include "CachedResourceLoader.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
@@ -835,23 +836,6 @@
     return documentElement() && documentElement()->hasTagName(htmlTag) && documentElement()->hasAttributeWithoutSynchronization(manifestAttr);
 }
 
-bool Document::hasEverCalledWindowOpen() const
-{
-    auto& topDocument = this->topDocument();
-    if (&topDocument == this)
-        return m_hasEverCalledWindowOpen;
-    return topDocument.hasEverCalledWindowOpen();
-}
-
-void Document::markHasCalledWindowOpen()
-{
-    auto& topDocument = this->topDocument();
-    if (&topDocument == this)
-        m_hasEverCalledWindowOpen = true;
-    else
-        topDocument.markHasCalledWindowOpen();
-}
-
 DocumentType* Document::doctype() const
 {
     for (Node* node = firstChild(); node; node = node->nextSibling()) {
@@ -2222,18 +2206,30 @@
     }
 }
 
-void Document::disconnectFromFrame()
-{
-    observeFrame(nullptr);
-}
-
 void Document::frameDestroyed()
 {
-    // disconnectFromFrame() must be called before destroying the Frame.
+    // detachFromFrame() must be called before destroying the Frame.
     ASSERT_WITH_SECURITY_IMPLICATION(!m_frame);
     FrameDestructionObserver::frameDestroyed();
 }
 
+void Document::attachToCachedFrame(CachedFrameBase& cachedFrame)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(cachedFrame.document() == this);
+    ASSERT(cachedFrame.view());
+    ASSERT(m_pageCacheState == Document::InPageCache);
+    observeFrame(&cachedFrame.view()->frame());
+}
+
+void Document::detachFromCachedFrame(CachedFrameBase& cachedFrame)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(cachedFrame.document() == this);
+    ASSERT(cachedFrame.view());
+    ASSERT(m_frame == &cachedFrame.view()->frame());
+    ASSERT(m_pageCacheState == Document::InPageCache);
+    detachFromFrame();
+}
+
 void Document::destroyRenderTree()
 {
     ASSERT(hasLivingRenderTree());
@@ -2284,7 +2280,8 @@
     if (m_hasPreparedForDestruction)
         return;
 
-    m_frame->animation().detachFromDocument(this);
+    if (m_frame)
+        m_frame->animation().detachFromDocument(this);
 
 #if ENABLE(IOS_TOUCH_EVENTS)
     clearTouchEventHandlersAndListeners();
@@ -2353,7 +2350,7 @@
     }
 #endif
 
-    disconnectFromFrame();
+    detachFromFrame();
 
     m_hasPreparedForDestruction = true;
 

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


--- branches/safari-603-branch/Source/WebCore/dom/Document.h	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/dom/Document.h	2017-06-01 19:52:28 UTC (rev 217678)
@@ -81,6 +81,7 @@
 class CSSStyleDeclaration;
 class CSSStyleSheet;
 class CachedCSSStyleSheet;
+class CachedFrameBase;
 class CachedResourceLoader;
 class CachedScript;
 class CanvasRenderingContext;
@@ -375,9 +376,6 @@
     WEBCORE_EXPORT bool hasFocus() const;
 
     bool hasManifest() const;
-
-    bool hasEverCalledWindowOpen() const;
-    void markHasCalledWindowOpen();
     
     WEBCORE_EXPORT ExceptionOr<Ref<Element>> createElementForBindings(const AtomicString& tagName);
     WEBCORE_EXPORT Ref<DocumentFragment> createDocumentFragment();
@@ -564,7 +562,6 @@
 
     void didBecomeCurrentDocumentInFrame();
     void destroyRenderTree();
-    void disconnectFromFrame();
     void prepareForDestruction();
 
     // Override ScriptExecutionContext methods to do additional work
@@ -1304,6 +1301,9 @@
     void didRemoveInDocumentShadowRoot(ShadowRoot&);
     const HashSet<ShadowRoot*>& inDocumentShadowRoots() const { return m_inDocumentShadowRoots; }
 
+    void attachToCachedFrame(CachedFrameBase&);
+    void detachFromCachedFrame(CachedFrameBase&);
+
 protected:
     enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 };
     Document(Frame*, const URL&, unsigned = DefaultDocumentClass, unsigned constructionFlags = 0);
@@ -1317,6 +1317,8 @@
     friend class IgnoreDestructiveWriteCountIncrementer;
     friend class IgnoreOpensDuringUnloadCountIncrementer;
 
+    void detachFromFrame() { observeFrame(nullptr); }
+
     void updateTitleElement(Element* newTitleElement);
     void frameDestroyed() final;
 
@@ -1495,7 +1497,6 @@
     bool m_bParsing;
 
     Timer m_styleRecalcTimer;
-    bool m_hasEverCalledWindowOpen { false };
     bool m_pendingStyleRecalcShouldForce;
     bool m_inStyleRecalc;
     bool m_closeAfterStyleRecalc;

Modified: branches/safari-603-branch/Source/WebCore/history/CachedFrame.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/history/CachedFrame.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/history/CachedFrame.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -72,6 +72,17 @@
     ASSERT(!m_document);
 }
 
+void CachedFrameBase::pruneDetachedChildFrames()
+{
+    for (size_t i = m_childFrames.size(); i;) {
+        --i;
+        if (m_childFrames[i]->view()->frame().page())
+            continue;
+        m_childFrames[i]->destroy();
+        m_childFrames.remove(i);
+    }
+}
+
 void CachedFrameBase::restore()
 {
     ASSERT(m_document->view() == m_view);
@@ -95,8 +106,11 @@
 
     frame.loader().client().didRestoreFromPageCache();
 
+    pruneDetachedChildFrames();
+
     // Reconstruct the FrameTree. And open the child CachedFrames in their respective FrameLoaders.
     for (unsigned i = 0; i < m_childFrames.size(); ++i) {
+        ASSERT(m_childFrames[i]->view()->frame().page());
         frame.tree().appendChild(&m_childFrames[i]->view()->frame());
         m_childFrames[i]->open();
         ASSERT_WITH_SECURITY_IMPLICATION(m_document == frame.document());
@@ -182,6 +196,8 @@
     }
 #endif
 
+    m_document->detachFromCachedFrame(*this);
+
     ASSERT_WITH_SECURITY_IMPLICATION(!m_documentLoader->isLoading());
 }
 
@@ -188,9 +204,12 @@
 void CachedFrame::open()
 {
     ASSERT(m_view);
+    ASSERT(m_document);
     if (!m_isMainFrame)
         m_view->frame().page()->incrementSubframeCount();
 
+    m_document->attachToCachedFrame(*this);
+
     m_view->frame().loader().open(*this);
 }
 
@@ -226,11 +245,11 @@
     // Only CachedFrames that are still in the PageCache should be destroyed in this manner
     ASSERT(m_document->pageCacheState() == Document::InPageCache);
     ASSERT(m_view);
-    ASSERT(m_document->frame() == &m_view->frame());
+    ASSERT(!m_document->frame());
 
     m_document->domWindow()->willDestroyCachedFrame();
 
-    if (!m_isMainFrame) {
+    if (!m_isMainFrame && m_view->frame().page()) {
         m_view->frame().loader().detachViewsAndDocumentLoader();
         m_view->frame().detachFromPage();
     }
@@ -243,6 +262,8 @@
 
     Frame::clearTimers(m_view.get(), m_document.get());
 
+    m_view->frame().animation().detachFromDocument(m_document.get());
+
     // FIXME: Why do we need to call removeAllEventListeners here? When the document is in page cache, this method won't work
     // fully anyway, because the document won't be able to access its DOMWindow object (due to being frameless).
     m_document->removeAllEventListeners();

Modified: branches/safari-603-branch/Source/WebCore/history/CachedFrame.h (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/history/CachedFrame.h	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/history/CachedFrame.h	2017-06-01 19:52:28 UTC (rev 217678)
@@ -52,7 +52,9 @@
 protected:
     CachedFrameBase(Frame&);
     ~CachedFrameBase();
-    
+
+    void pruneDetachedChildFrames();
+
     RefPtr<Document> m_document;
     RefPtr<DocumentLoader> m_documentLoader;
     RefPtr<FrameView> m_view;

Modified: branches/safari-603-branch/Source/WebCore/history/PageCache.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/history/PageCache.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/history/PageCache.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -193,19 +193,6 @@
 
     DiagnosticLoggingClient& diagnosticLoggingClient = page.diagnosticLoggingClient();
     bool isCacheable = canCacheFrame(page.mainFrame(), diagnosticLoggingClient, indentLevel + 1);
-
-    if (page.openedByWindowOpen() && !page.settings().allowsPageCacheWithWindowOpener()) {
-        PCLOG("   -Page has been opened via window.open()");
-        logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::hasOpenerKey());
-        isCacheable = false;
-    }
-
-    auto* topDocument = page.mainFrame().document();
-    if (topDocument && topDocument->hasEverCalledWindowOpen()) {
-        PCLOG("   -Page has called window.open()");
-        logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::hasCalledWindowOpenKey());
-        isCacheable = false;
-    }
     
     if (!page.settings().usesPageCache() || page.isResourceCachingDisabled()) {
         PCLOG("   -Page settings says b/f cache disabled");

Modified: branches/safari-603-branch/Source/WebCore/html/HTMLFrameElementBase.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/html/HTMLFrameElementBase.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/html/HTMLFrameElementBase.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -151,7 +151,7 @@
     if (!inDocument())
         return;
 
-    // DocumentFragments don't kick of any loads.
+    // DocumentFragments don't kick off any loads.
     if (!document().frame())
         return;
 

Modified: branches/safari-603-branch/Source/WebCore/loader/FrameLoader.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/loader/FrameLoader.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/loader/FrameLoader.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -2522,25 +2522,31 @@
 
 void FrameLoader::frameDetached()
 {
-    // Calling stopAllLoaders can cause the frame to be deallocated, including the frame loader.
+    // Calling stopAllLoaders() can cause the frame to be deallocated, including the frame loader.
     Ref<Frame> protectedFrame(m_frame);
 
-    stopAllLoaders();
-    m_frame.document()->stopActiveDOMObjects();
+    if (m_frame.document()->pageCacheState() != Document::InPageCache) {
+        stopAllLoaders();
+        m_frame.document()->stopActiveDOMObjects();
+    }
+
     detachFromParent();
 }
 
 void FrameLoader::detachFromParent()
 {
+    // Calling stopAllLoaders() can cause the frame to be deallocated, including the frame loader.
     Ref<Frame> protect(m_frame);
 
     closeURL();
     history().saveScrollPositionAndViewStateToItem(history().currentItem());
     detachChildren();
-    // stopAllLoaders() needs to be called after detachChildren(), because detachedChildren()
-    // will trigger the unload event handlers of any child frames, and those event
-    // handlers might start a new subresource load in this frame.
-    stopAllLoaders();
+    if (m_frame.document()->pageCacheState() != Document::InPageCache) {
+        // stopAllLoaders() needs to be called after detachChildren() if the document is not in the page cache,
+        // because detachedChildren() will trigger the unload event handlers of any child frames, and those event
+        // handlers might start a new subresource load in this frame.
+        stopAllLoaders();
+    }
 
     InspectorInstrumentation::frameDetachedFromParent(m_frame);
 

Modified: branches/safari-603-branch/Source/WebCore/page/DOMWindow.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/page/DOMWindow.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/page/DOMWindow.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -2196,8 +2196,6 @@
 
     newFrame->loader().setOpener(&openerFrame);
     newFrame->page()->setOpenedByDOM();
-    if (auto* openerDocument = openerFrame.document())
-        openerDocument->markHasCalledWindowOpen();
 
     if (newFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL))
         return newFrame;

Modified: branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -673,16 +673,6 @@
     return ASCIILiteral("font");
 }
 
-String DiagnosticLoggingKeys::hasCalledWindowOpenKey()
-{
-    return ASCIILiteral("hasCalledWindowOpen");
-}
-
-String DiagnosticLoggingKeys::hasOpenerKey()
-{
-    return ASCIILiteral("hasOpener");
-}
-
 String DiagnosticLoggingKeys::prunedDueToMemoryPressureKey()
 {
     return ASCIILiteral("pruned.memoryPressure");

Modified: branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.h (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.h	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.h	2017-06-01 19:52:28 UTC (rev 217678)
@@ -57,8 +57,6 @@
     WEBCORE_EXPORT static String entryWronglyNotWarmedUpKey();
     static String expiredKey();
     static String fontKey();
-    static String hasCalledWindowOpenKey();
-    static String hasOpenerKey();
     static String hasPluginsKey();
     static String httpsNoStoreKey();
     static String imageKey();

Modified: branches/safari-603-branch/Source/WebCore/page/Page.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/page/Page.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/page/Page.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -461,17 +461,6 @@
     m_openedByDOM = true;
 }
 
-bool Page::openedByWindowOpen() const
-{
-    auto* document = m_mainFrame->document();
-    if (!document)
-        return false;
-    auto* window = document->domWindow();
-    if (!window)
-        return false;
-    return window->opener();
-}
-
 void Page::goToItem(HistoryItem& item, FrameLoadType type)
 {
     // stopAllLoaders may end up running onload handlers, which could cause further history traversals that may lead to the passed in HistoryItem

Modified: branches/safari-603-branch/Source/WebCore/page/Page.h (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/page/Page.h	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/page/Page.h	2017-06-01 19:52:28 UTC (rev 217678)
@@ -180,8 +180,6 @@
     bool openedByDOM() const;
     void setOpenedByDOM();
 
-    bool openedByWindowOpen() const;
-
     WEBCORE_EXPORT void goToItem(HistoryItem&, FrameLoadType);
 
     WEBCORE_EXPORT void setGroupName(const String&);

Modified: branches/safari-603-branch/Source/WebCore/page/Settings.in (217677 => 217678)


--- branches/safari-603-branch/Source/WebCore/page/Settings.in	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebCore/page/Settings.in	2017-06-01 19:52:28 UTC (rev 217678)
@@ -297,5 +297,3 @@
 es6ModulesEnabled initial=false
 
 shouldSuppressKeyboardInputDuringProvisionalNavigation initial=false
-
-allowsPageCacheWithWindowOpener initial=false

Modified: branches/safari-603-branch/Source/WebKit/mac/ChangeLog (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit/mac/ChangeLog	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit/mac/ChangeLog	2017-06-01 19:52:28 UTC (rev 217678)
@@ -1,3 +1,24 @@
+2017-06-01  Matthew Hanson  <[email protected]>
+
+        Cherry-pick r212173. rdar://problem/32080671
+
+    2017-02-10  Daniel Bates  <[email protected]>
+
+            Detach frame from document when entering page cache
+            https://bugs.webkit.org/show_bug.cgi?id=166774
+            <rdar://problem/29904368>
+
+            Reviewed by Chris Dumez.
+
+            * WebView/WebPreferenceKeysPrivate.h:
+            * WebView/WebPreferences.mm:
+            (+[WebPreferences initialize]):
+            (-[WebPreferences allowsPageCacheWithWindowOpener]): Deleted.
+            (-[WebPreferences setAllowsPageCacheWithWindowOpener:]): Deleted.
+            * WebView/WebPreferencesPrivate.h:
+            * WebView/WebView.mm:
+            (-[WebView _preferencesChanged:]):
+
 2017-05-10  Matthew Hanson  <[email protected]>
 
         Cherry-pick r215429. rdar://problem/32057106

Modified: branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2017-06-01 19:52:28 UTC (rev 217678)
@@ -83,7 +83,6 @@
 #define WebAutomaticSpellingCorrectionEnabled @"WebAutomaticSpellingCorrectionEnabled"
 #define WebKitDOMPasteAllowedPreferenceKey @"WebKitDOMPasteAllowedPreferenceKey"
 #define WebKitUsesPageCachePreferenceKey @"WebKitUsesPageCachePreferenceKey"
-#define WebKitAllowsPageCacheWithWindowOpenerKey @"WebKitAllowsPageCacheWithWindowOpenerKey"
 #define WebKitPageCacheSupportsPluginsPreferenceKey @"WebKitPageCacheSupportsPluginsPreferenceKey"
 #define WebKitFTPDirectoryTemplatePath @"WebKitFTPDirectoryTemplatePath"
 #define WebKitForceFTPDirectoryListings @"WebKitForceFTPDirectoryListings"

Modified: branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferences.mm (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferences.mm	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferences.mm	2017-06-01 19:52:28 UTC (rev 217678)
@@ -478,7 +478,6 @@
         [NSNumber numberWithBool:NO],   WebKitDOMPasteAllowedPreferenceKey,
 #endif
         [NSNumber numberWithBool:YES],  WebKitUsesPageCachePreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitAllowsPageCacheWithWindowOpenerKey,
         [NSNumber numberWithInt:cacheModelForMainBundle()], WebKitCacheModelPreferenceKey,
         [NSNumber numberWithBool:YES],  WebKitPageCacheSupportsPluginsPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitDeveloperExtrasEnabledPreferenceKey,
@@ -2436,16 +2435,6 @@
 
 }
 
-- (BOOL)allowsPageCacheWithWindowOpener
-{
-    return [self _boolValueForKey:WebKitAllowsPageCacheWithWindowOpenerKey];
-}
-
-- (void)setAllowsPageCacheWithWindowOpener:(BOOL)flag
-{
-    [self _setBoolValue:flag forKey:WebKitAllowsPageCacheWithWindowOpenerKey];
-}
-
 #if PLATFORM(IOS)
 - (void)_invalidateCachedPreferences
 {

Modified: branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2017-06-01 19:52:28 UTC (rev 217678)
@@ -295,9 +295,6 @@
 - (NSString *)pictographFontFamily;
 - (void)setPictographFontFamily:(NSString *)family;
 
-- (BOOL)allowsPageCacheWithWindowOpener;
-- (void)setAllowsPageCacheWithWindowOpener:(BOOL)flag;
-
 - (BOOL)pageCacheSupportsPlugins;
 - (void)setPageCacheSupportsPlugins:(BOOL)flag;
 

Modified: branches/safari-603-branch/Source/WebKit/mac/WebView/WebView.mm (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebView.mm	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebView.mm	2017-06-01 19:52:28 UTC (rev 217678)
@@ -2667,7 +2667,6 @@
     settings.setTextDirectionSubmenuInclusionBehavior(core([preferences textDirectionSubmenuInclusionBehavior]));
     settings.setDOMPasteAllowed([preferences isDOMPasteAllowed]);
     settings.setUsesPageCache([self usesPageCache]);
-    settings.setAllowsPageCacheWithWindowOpener([preferences allowsPageCacheWithWindowOpener]);
     settings.setPageCacheSupportsPlugins([preferences pageCacheSupportsPlugins]);
     settings.setBackForwardCacheExpirationInterval([preferences _backForwardCacheExpirationInterval]);
 

Modified: branches/safari-603-branch/Source/WebKit/win/ChangeLog (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit/win/ChangeLog	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit/win/ChangeLog	2017-06-01 19:52:28 UTC (rev 217678)
@@ -1,3 +1,25 @@
+2017-06-01  Matthew Hanson  <[email protected]>
+
+        Cherry-pick r212173. rdar://problem/32080671
+
+    2017-02-10  Daniel Bates  <[email protected]>
+
+            Detach frame from document when entering page cache
+            https://bugs.webkit.org/show_bug.cgi?id=166774
+            <rdar://problem/29904368>
+
+            Reviewed by Chris Dumez.
+
+            * Interfaces/IWebPreferencesPrivate.idl:
+            * WebPreferenceKeysPrivate.h:
+            * WebPreferences.cpp:
+            (WebPreferences::initializeDefaultSettings):
+            (WebPreferences::setAllowsPageCacheWithWindowOpener): Deleted.
+            (WebPreferences::allowsPageCacheWithWindowOpener): Deleted.
+            * WebPreferences.h:
+            * WebView.cpp:
+            (WebView::notifyPreferencesChanged):
+
 2017-05-17  Jason Marcell  <[email protected]>
 
         Cherry-pick r216554. rdar://problem/31971362

Modified: branches/safari-603-branch/Source/WebKit/win/WebPreferenceKeysPrivate.h (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit/win/WebPreferenceKeysPrivate.h	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit/win/WebPreferenceKeysPrivate.h	2017-06-01 19:52:28 UTC (rev 217678)
@@ -68,7 +68,6 @@
 #define WebKitIconDatabaseLocationKey "WebKitIconDatabaseLocation"
 #define WebKitIconDatabaseEnabledPreferenceKey "WebKitIconDatabaseEnabled"
 #define WebKitUsesPageCachePreferenceKey "WebKitUsesPageCachePreferenceKey"
-#define WebKitAllowsPageCacheWithWindowOpenerKey "WebKitAllowsPageCacheWithWindowOpenerKey"
 #define WebKitCacheModelPreferenceKey "WebKitCacheModelPreferenceKey"
 #define WebKitLocalStorageDatabasePathPreferenceKey "WebKitLocalStorageDatabasePath"
 #define WebKitHyperlinkAuditingEnabledPreferenceKey "WebKitHyperlinkAuditingEnabled"

Modified: branches/safari-603-branch/Source/WebKit/win/WebPreferences.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit/win/WebPreferences.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit/win/WebPreferences.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -262,7 +262,6 @@
     CFDictionaryAddValue(defaults, CFSTR(WebGrammarCheckingEnabledPreferenceKey), kCFBooleanFalse);
     CFDictionaryAddValue(defaults, CFSTR(AllowContinuousSpellCheckingPreferenceKey), kCFBooleanTrue);
     CFDictionaryAddValue(defaults, CFSTR(WebKitUsesPageCachePreferenceKey), kCFBooleanTrue);
-    CFDictionaryAddValue(defaults, CFSTR(WebKitAllowsPageCacheWithWindowOpenerKey), kCFBooleanFalse);
     CFDictionaryAddValue(defaults, CFSTR(WebKitLocalStorageDatabasePathPreferenceKey), CFSTR(""));
 
     RetainPtr<CFStringRef> cacheModelRef = adoptCF(CFStringCreateWithFormat(0, 0, CFSTR("%d"), WebCacheModelDocumentViewer));
@@ -1605,20 +1604,6 @@
     return S_OK;
 }
 
-HRESULT WebPreferences::setAllowsPageCacheWithWindowOpener(BOOL value)
-{
-    setBoolValue(WebKitAllowsPageCacheWithWindowOpenerKey, value);
-    return S_OK;
-}
-
-HRESULT WebPreferences::allowsPageCacheWithWindowOpener(_Out_ BOOL* enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-    *enabled = boolValueForKey(WebKitAllowsPageCacheWithWindowOpenerKey);
-    return S_OK;
-}
-
 HRESULT WebPreferences::setZoomsTextOnly(BOOL zoomsTextOnly)
 {
     setBoolValue(WebKitZoomsTextOnlyPreferenceKey, zoomsTextOnly);

Modified: branches/safari-603-branch/Source/WebKit/win/WebView.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit/win/WebView.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit/win/WebView.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -5401,11 +5401,6 @@
         return hr;
     settings.setExperimentalNotificationsEnabled(enabled);
 
-    hr = prefsPrivate->allowsPageCacheWithWindowOpener(&enabled);
-    if (FAILED(hr))
-        return hr;
-    settings.setAllowsPageCacheWithWindowOpener(enabled);
-
     hr = prefsPrivate->isWebSecurityEnabled(&enabled);
     if (FAILED(hr))
         return hr;

Modified: branches/safari-603-branch/Source/WebKit2/ChangeLog (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit2/ChangeLog	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit2/ChangeLog	2017-06-01 19:52:28 UTC (rev 217678)
@@ -1,3 +1,25 @@
+2017-06-01  Matthew Hanson  <[email protected]>
+
+        Cherry-pick r212173. rdar://problem/32080671
+
+    2017-02-10  Daniel Bates  <[email protected]>
+
+            Detach frame from document when entering page cache
+            https://bugs.webkit.org/show_bug.cgi?id=166774
+            <rdar://problem/29904368>
+
+            Reviewed by Chris Dumez.
+
+            * Shared/WebPreferencesDefinitions.h:
+            * UIProcess/API/C/WKPreferences.cpp:
+            (WKPreferencesSetAllowsPageCacheWithWindowOpener): Deleted.
+            (WKPreferencesGetAllowsPageCacheWithWindowOpener): Deleted.
+            * UIProcess/API/C/WKPreferencesRefPrivate.h:
+            * WebProcess/InjectedBundle/InjectedBundle.cpp:
+            (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::updatePreferences):
+
 2017-05-18  Dean Jackson  <[email protected]>
 
         Restrict SVG filters to accessible security origins

Modified: branches/safari-603-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2017-06-01 19:52:28 UTC (rev 217678)
@@ -138,7 +138,6 @@
     macro(WebArchiveDebugModeEnabled, webArchiveDebugModeEnabled, Bool, bool, false, "", "") \
     macro(LocalFileContentSniffingEnabled, localFileContentSniffingEnabled, Bool, bool, false, "", "") \
     macro(UsesPageCache, usesPageCache, Bool, bool, true, "", "") \
-    macro(AllowsPageCacheWithWindowOpener, allowsPageCacheWithWindowOpener, Bool, bool, false, "", "") \
     macro(PageCacheSupportsPlugins, pageCacheSupportsPlugins, Bool, bool, true, "", "") \
     macro(AuthorAndUserStylesEnabled, authorAndUserStylesEnabled, Bool, bool, true, "", "") \
     macro(PaginateDuringLayoutEnabled, paginateDuringLayoutEnabled, Bool, bool, false, "", "") \

Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -623,16 +623,6 @@
     return toImpl(preferencesRef)->usesPageCache();
 }
 
-void WKPreferencesSetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferencesRef, bool enabled)
-{
-    toImpl(preferencesRef)->setAllowsPageCacheWithWindowOpener(enabled);
-}
-
-bool WKPreferencesGetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferencesRef)
-{
-    return toImpl(preferencesRef)->allowsPageCacheWithWindowOpener();
-}
-
 void WKPreferencesSetPageCacheSupportsPlugins(WKPreferencesRef preferencesRef, bool pageCacheSupportsPlugins)
 {
     toImpl(preferencesRef)->setPageCacheSupportsPlugins(pageCacheSupportsPlugins);

Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2017-06-01 19:52:28 UTC (rev 217678)
@@ -143,10 +143,6 @@
 WK_EXPORT void WKPreferencesSetPageCacheEnabled(WKPreferencesRef preferences, bool enabled);
 WK_EXPORT bool WKPreferencesGetPageCacheEnabled(WKPreferencesRef preferences);
 
-// Defaults to false.
-WK_EXPORT void WKPreferencesSetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferences, bool enabled);
-WK_EXPORT bool WKPreferencesGetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferences);
-
 // Defaults to true.
 WK_EXPORT void WKPreferencesSetPageCacheSupportsPlugins(WKPreferencesRef preferences, bool pageCacheSupportsPlugins);
 WK_EXPORT bool WKPreferencesGetPageCacheSupportsPlugins(WKPreferencesRef preferences);

Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -253,7 +253,6 @@
     macro(WebKitPageCacheSupportsPluginsPreferenceKey, PageCacheSupportsPlugins, pageCacheSupportsPlugins) \
     macro(WebKitPluginsEnabled, PluginsEnabled, pluginsEnabled) \
     macro(WebKitUsesPageCachePreferenceKey, UsesPageCache, usesPageCache) \
-    macro(WebKitAllowsPageCacheWithWindowOpenerKey, AllowsPageCacheWithWindowOpener, allowsPageCacheWithWindowOpener) \
     macro(WebKitWebAudioEnabled, WebAudioEnabled, webAudioEnabled) \
     macro(WebKitWebGLEnabled, WebGLEnabled, webGLEnabled) \
     macro(WebKitXSSAuditorEnabled, XSSAuditorEnabled, xssAuditorEnabled) \

Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (217677 => 217678)


--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -2992,7 +2992,6 @@
 #endif
     settings.setLocalFileContentSniffingEnabled(store.getBoolValueForKey(WebPreferencesKey::localFileContentSniffingEnabledKey()));
     settings.setUsesPageCache(store.getBoolValueForKey(WebPreferencesKey::usesPageCacheKey()));
-    settings.setAllowsPageCacheWithWindowOpener(store.getBoolValueForKey(WebPreferencesKey::allowsPageCacheWithWindowOpenerKey()));
     settings.setPageCacheSupportsPlugins(store.getBoolValueForKey(WebPreferencesKey::pageCacheSupportsPluginsKey()));
     settings.setAuthorAndUserStylesEnabled(store.getBoolValueForKey(WebPreferencesKey::authorAndUserStylesEnabledKey()));
     settings.setPaginateDuringLayoutEnabled(store.getBoolValueForKey(WebPreferencesKey::paginateDuringLayoutEnabledKey()));

Modified: branches/safari-603-branch/Tools/ChangeLog (217677 => 217678)


--- branches/safari-603-branch/Tools/ChangeLog	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Tools/ChangeLog	2017-06-01 19:52:28 UTC (rev 217678)
@@ -1,3 +1,22 @@
+2017-06-01  Matthew Hanson  <[email protected]>
+
+        Cherry-pick r212173. rdar://problem/32080671
+
+    2017-02-10  Daniel Bates  <[email protected]>
+
+            Detach frame from document when entering page cache
+            https://bugs.webkit.org/show_bug.cgi?id=166774
+            <rdar://problem/29904368>
+
+            Reviewed by Chris Dumez.
+
+            * DumpRenderTree/mac/DumpRenderTree.mm:
+            (resetWebPreferencesToConsistentValues):
+            * DumpRenderTree/win/DumpRenderTree.cpp:
+            (resetWebPreferencesToConsistentValues):
+            * WebKitTestRunner/TestController.cpp:
+            (WTR::TestController::resetPreferencesToConsistentValues):
+
 2017-05-10  Matthew Hanson  <[email protected]>
 
         Cherry-pick r215429. rdar://problem/32057106

Modified: branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm (217677 => 217678)


--- branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2017-06-01 19:52:28 UTC (rev 217678)
@@ -973,7 +973,6 @@
     // The back/forward cache is causing problems due to layouts during transition from one page to another.
     // So, turn it off for now, but we might want to turn it back on some day.
     [preferences setUsesPageCache:NO];
-    [preferences setAllowsPageCacheWithWindowOpener:NO];
     [preferences setAcceleratedCompositingEnabled:YES];
 #if USE(CA)
     [preferences setCanvasUsesAcceleratedDrawing:YES];

Modified: branches/safari-603-branch/Tools/DumpRenderTree/win/DumpRenderTree.cpp (217677 => 217678)


--- branches/safari-603-branch/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -811,7 +811,6 @@
     preferences->setPlugInsEnabled(TRUE);
     preferences->setTextAreasAreResizable(TRUE);
     preferences->setUsesPageCache(FALSE);
-    prefsPrivate->setAllowsPageCacheWithWindowOpener(FALSE);
 
     preferences->setPrivateBrowsingEnabled(FALSE);
     prefsPrivate->setAuthorAndUserStylesEnabled(TRUE);

Modified: branches/safari-603-branch/Tools/WebKitTestRunner/TestController.cpp (217677 => 217678)


--- branches/safari-603-branch/Tools/WebKitTestRunner/TestController.cpp	2017-06-01 19:52:06 UTC (rev 217677)
+++ branches/safari-603-branch/Tools/WebKitTestRunner/TestController.cpp	2017-06-01 19:52:28 UTC (rev 217678)
@@ -655,7 +655,6 @@
     WKPreferencesSetFullScreenEnabled(preferences, true);
 #endif
     WKPreferencesSetPageCacheEnabled(preferences, false);
-    WKPreferencesSetAllowsPageCacheWithWindowOpener(preferences, false);
     WKPreferencesSetAsynchronousPluginInitializationEnabled(preferences, false);
     WKPreferencesSetAsynchronousPluginInitializationEnabledForAllPlugins(preferences, false);
     WKPreferencesSetArtificialPluginInitializationDelayEnabled(preferences, false);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to