Title: [212587] branches/safari-603-branch
Revision
212587
Author
matthew_han...@apple.com
Date
2017-02-17 15:39:30 -0800 (Fri, 17 Feb 2017)

Log Message

Roll out r212173 via r212500. rdar://problem/29904368

Modified Paths

Diff

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


--- branches/safari-603-branch/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html	2017-02-17 23:39:30 UTC (rev 212587)
@@ -10,6 +10,7 @@
 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 (212586 => 212587)


--- branches/safari-603-branch/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html	2017-02-17 23:39:30 UTC (rev 212587)
@@ -22,6 +22,7 @@
         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 (212586 => 212587)


--- branches/safari-603-branch/LayoutTests/fast/harness/use-page-cache.html	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/LayoutTests/fast/harness/use-page-cache.html	2017-02-17 23:39:30 UTC (rev 212587)
@@ -28,6 +28,7 @@
         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 (212586 => 212587)


--- branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html	2017-02-17 23:39:30 UTC (rev 212587)
@@ -14,6 +14,7 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html	2017-02-17 23:39:30 UTC (rev 212587)
@@ -14,6 +14,7 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html	2017-02-17 23:39:30 UTC (rev 212587)
@@ -7,6 +7,7 @@
             testRunner.waitUntilDone();
             testRunner.setCanOpenWindows();
             testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+            testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
         }
 
         window.finishedTest = function (layerTree)

Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (212586 => 212587)


--- branches/safari-603-branch/Source/WebCore/ChangeLog	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog	2017-02-17 23:39:30 UTC (rev 212587)
@@ -1,5 +1,9 @@
 2017-02-17  Matthew Hanson  <matthew_han...@apple.com>
 
+        Rollout r212500. rdar://problem/29904368
+
+2017-02-17  Matthew Hanson  <matthew_han...@apple.com>
+
         Rollout r212501. rdar://problem/29904368
 
 2017-02-16  Matthew Hanson  <matthew_han...@apple.com>

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


--- branches/safari-603-branch/Source/WebCore/dom/Document.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/dom/Document.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -36,7 +36,6 @@
 #include "CSSStyleDeclaration.h"
 #include "CSSStyleSheet.h"
 #include "CachedCSSStyleSheet.h"
-#include "CachedFrame.h"
 #include "CachedResourceLoader.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
@@ -836,6 +835,23 @@
     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()) {
@@ -2206,30 +2222,18 @@
     }
 }
 
+void Document::disconnectFromFrame()
+{
+    observeFrame(nullptr);
+}
+
 void Document::frameDestroyed()
 {
-    // detachFromFrame() must be called before destroying the Frame.
+    // disconnectFromFrame() 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());
@@ -2346,7 +2350,7 @@
     }
 #endif
 
-    detachFromFrame();
+    disconnectFromFrame();
 
     m_hasPreparedForDestruction = true;
 }

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


--- branches/safari-603-branch/Source/WebCore/dom/Document.h	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/dom/Document.h	2017-02-17 23:39:30 UTC (rev 212587)
@@ -81,7 +81,6 @@
 class CSSStyleDeclaration;
 class CSSStyleSheet;
 class CachedCSSStyleSheet;
-class CachedFrameBase;
 class CachedResourceLoader;
 class CachedScript;
 class CanvasRenderingContext;
@@ -376,6 +375,9 @@
     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();
@@ -562,6 +564,7 @@
 
     void didBecomeCurrentDocumentInFrame();
     void destroyRenderTree();
+    void disconnectFromFrame();
     void prepareForDestruction();
 
     // Override ScriptExecutionContext methods to do additional work
@@ -1299,9 +1302,6 @@
     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);
@@ -1315,8 +1315,6 @@
     friend class IgnoreDestructiveWriteCountIncrementer;
     friend class IgnoreOpensDuringUnloadCountIncrementer;
 
-    void detachFromFrame() { observeFrame(nullptr); }
-
     void updateTitleElement(Element* newTitleElement);
     void frameDestroyed() final;
 
@@ -1495,6 +1493,7 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebCore/history/CachedFrame.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/history/CachedFrame.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -75,17 +75,6 @@
     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);
@@ -109,11 +98,8 @@
 
     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();
     }
@@ -205,8 +191,6 @@
     }
 #endif
 
-    m_document->detachFromCachedFrame(*this);
-
     ASSERT_WITH_SECURITY_IMPLICATION(!m_documentLoader->isLoading());
 }
 
@@ -213,12 +197,9 @@
 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);
 }
 
@@ -254,11 +235,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());
+    ASSERT(m_document->frame() == &m_view->frame());
 
     m_document->domWindow()->willDestroyCachedFrame();
 
-    if (!m_isMainFrame && m_view->frame().page()) {
+    if (!m_isMainFrame) {
         m_view->frame().loader().detachViewsAndDocumentLoader();
         m_view->frame().detachFromPage();
     }
@@ -271,8 +252,6 @@
 
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebCore/history/CachedFrame.h	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/history/CachedFrame.h	2017-02-17 23:39:30 UTC (rev 212587)
@@ -52,9 +52,7 @@
 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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebCore/history/PageCache.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/history/PageCache.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -193,6 +193,19 @@
 
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebCore/html/HTMLFrameElementBase.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/html/HTMLFrameElementBase.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -151,7 +151,7 @@
     if (!inDocument())
         return;
 
-    // DocumentFragments don't kick off any loads.
+    // DocumentFragments don't kick of any loads.
     if (!document().frame())
         return;
 

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


--- branches/safari-603-branch/Source/WebCore/loader/FrameLoader.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/loader/FrameLoader.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -2511,31 +2511,25 @@
 
 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);
 
-    if (m_frame.document()->pageCacheState() != Document::InPageCache) {
-        stopAllLoaders();
-        m_frame.document()->stopActiveDOMObjects();
-    }
-
+    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();
-    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();
-    }
+    // 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();
 
     InspectorInstrumentation::frameDetachedFromParent(m_frame);
 

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


--- branches/safari-603-branch/Source/WebCore/page/DOMWindow.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/page/DOMWindow.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -2196,6 +2196,8 @@
 
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -663,6 +663,16 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.h	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.h	2017-02-17 23:39:30 UTC (rev 212587)
@@ -55,6 +55,8 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebCore/page/Page.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/page/Page.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -461,6 +461,17 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebCore/page/Page.h	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/page/Page.h	2017-02-17 23:39:30 UTC (rev 212587)
@@ -180,6 +180,8 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebCore/page/Settings.in	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebCore/page/Settings.in	2017-02-17 23:39:30 UTC (rev 212587)
@@ -297,3 +297,5 @@
 es6ModulesEnabled initial=false
 
 shouldSuppressKeyboardInputDuringProvisionalNavigation initial=false
+
+allowsPageCacheWithWindowOpener initial=false

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


--- branches/safari-603-branch/Source/WebKit/mac/ChangeLog	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit/mac/ChangeLog	2017-02-17 23:39:30 UTC (rev 212587)
@@ -1,3 +1,7 @@
+2017-02-17  Matthew Hanson  <matthew_han...@apple.com>
+
+        Rollout r212500. rdar://problem/29904368
+
 2017-02-16  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r212518. rdar://problem/30541748

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


--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2017-02-17 23:39:30 UTC (rev 212587)
@@ -83,6 +83,7 @@
 #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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferences.mm	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferences.mm	2017-02-17 23:39:30 UTC (rev 212587)
@@ -478,6 +478,7 @@
         [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,
@@ -2431,6 +2432,16 @@
 
 }
 
+- (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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2017-02-17 23:39:30 UTC (rev 212587)
@@ -295,6 +295,9 @@
 - (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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebView.mm	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebView.mm	2017-02-17 23:39:30 UTC (rev 212587)
@@ -2667,6 +2667,7 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit/win/ChangeLog	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit/win/ChangeLog	2017-02-17 23:39:30 UTC (rev 212587)
@@ -1,5 +1,9 @@
 2017-02-17  Matthew Hanson  <matthew_han...@apple.com>
 
+        Rollout r212500. rdar://problem/29904368
+
+2017-02-17  Matthew Hanson  <matthew_han...@apple.com>
+
         Rollout r212502. rdar://problem/29904368
 
 2017-02-16  Matthew Hanson  <matthew_han...@apple.com>

Modified: branches/safari-603-branch/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl	2017-02-17 23:39:30 UTC (rev 212587)
@@ -91,6 +91,9 @@
     HRESULT experimentalNotificationsEnabled([out, retval] BOOL *enabled);
     HRESULT setExperimentalNotificationsEnabled([in] BOOL enabled);
 
+    HRESULT allowsPageCacheWithWindowOpener([out, retval] BOOL* usesPageCache);
+    HRESULT setAllowsPageCacheWithWindowOpener([in] BOOL usesPageCache);
+
     HRESULT setShouldUseHighResolutionTimers([in] BOOL useHighResolutionTimers);
     HRESULT shouldUseHighResolutionTimers([out, retval] BOOL* useHighResolutionTimers);
 

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


--- branches/safari-603-branch/Source/WebKit/win/WebPreferenceKeysPrivate.h	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit/win/WebPreferenceKeysPrivate.h	2017-02-17 23:39:30 UTC (rev 212587)
@@ -68,6 +68,7 @@
 #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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit/win/WebPreferences.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit/win/WebPreferences.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -262,6 +262,7 @@
     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));
@@ -1604,6 +1605,20 @@
     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/WebPreferences.h (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit/win/WebPreferences.h	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit/win/WebPreferences.h	2017-02-17 23:39:30 UTC (rev 212587)
@@ -159,6 +159,8 @@
     virtual HRESULT STDMETHODCALLTYPE setLocalStorageDatabasePath(_In_ BSTR);
     virtual HRESULT STDMETHODCALLTYPE experimentalNotificationsEnabled(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setExperimentalNotificationsEnabled(BOOL);
+    virtual HRESULT STDMETHODCALLTYPE allowsPageCacheWithWindowOpener(_Out_ BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE setAllowsPageCacheWithWindowOpener(BOOL);
 
     // These two methods are no-ops, and only retained to keep
     // the Interface consistent. DO NOT USE THEM.

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


--- branches/safari-603-branch/Source/WebKit/win/WebView.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit/win/WebView.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -5401,6 +5401,11 @@
         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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit2/ChangeLog	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit2/ChangeLog	2017-02-17 23:39:30 UTC (rev 212587)
@@ -1,3 +1,7 @@
+2017-02-17  Matthew Hanson  <matthew_han...@apple.com>
+
+        Rollout r212500. rdar://problem/29904368
+
 2017-02-16  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r212518. rdar://problem/30541748

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


--- branches/safari-603-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2017-02-17 23:39:30 UTC (rev 212587)
@@ -138,6 +138,7 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -623,6 +623,16 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2017-02-17 23:39:30 UTC (rev 212587)
@@ -143,6 +143,10 @@
 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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -246,6 +246,7 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -2992,6 +2992,7 @@
 #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 (212586 => 212587)


--- branches/safari-603-branch/Tools/ChangeLog	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Tools/ChangeLog	2017-02-17 23:39:30 UTC (rev 212587)
@@ -1,3 +1,7 @@
+2017-02-17  Matthew Hanson  <matthew_han...@apple.com>
+
+        Rollout r212500. rdar://problem/29904368
+
 2017-02-16  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r212513. rdar://problem/30301317

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


--- branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2017-02-17 23:39:30 UTC (rev 212587)
@@ -973,6 +973,7 @@
     // 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 (212586 => 212587)


--- branches/safari-603-branch/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -811,6 +811,7 @@
     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 (212586 => 212587)


--- branches/safari-603-branch/Tools/WebKitTestRunner/TestController.cpp	2017-02-17 23:39:18 UTC (rev 212586)
+++ branches/safari-603-branch/Tools/WebKitTestRunner/TestController.cpp	2017-02-17 23:39:30 UTC (rev 212587)
@@ -655,6 +655,7 @@
     WKPreferencesSetFullScreenEnabled(preferences, true);
 #endif
     WKPreferencesSetPageCacheEnabled(preferences, false);
+    WKPreferencesSetAllowsPageCacheWithWindowOpener(preferences, false);
     WKPreferencesSetAsynchronousPluginInitializationEnabled(preferences, false);
     WKPreferencesSetAsynchronousPluginInitializationEnabledForAllPlugins(preferences, false);
     WKPreferencesSetArtificialPluginInitializationDelayEnabled(preferences, false);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to