<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[212045] branches/safari-603-branch</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/212045">212045</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2017-02-09 22:35:52 -0800 (Thu, 09 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/211254">r211254</a>. rdar://problem/30188490</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari603branchLayoutTestsChangeLog">branches/safari-603-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari603branchLayoutTestseditingmacinputunconfirmedtextnavigationwithpagecachehtml">branches/safari-603-branch/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfastharnesspagecachecrashondataurlshtml">branches/safari-603-branch/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfastharnessusepagecachehtml">branches/safari-603-branch/LayoutTests/fast/harness/use-page-cache.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfastloaderstateobjectsnopopstatewhenbacktostatelessentrywithpagecachehtml">branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfastloaderstateobjectspopstatefireswithpagecachehtml">branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html</a></li>
<li><a href="#branchessafari603branchLayoutTeststileddrawingtileddrawingscrollpositionpagecacherestorationhtml">branches/safari-603-branch/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html</a></li>
<li><a href="#branchessafari603branchSourceWebCoreChangeLog">branches/safari-603-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebCoredomDocumentcpp">branches/safari-603-branch/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCoredomDocumenth">branches/safari-603-branch/Source/WebCore/dom/Document.h</a></li>
<li><a href="#branchessafari603branchSourceWebCorehistoryPageCachecpp">branches/safari-603-branch/Source/WebCore/history/PageCache.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCorepageDOMWindowcpp">branches/safari-603-branch/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCorepageDiagnosticLoggingKeyscpp">branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCorepageDiagnosticLoggingKeysh">branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.h</a></li>
<li><a href="#branchessafari603branchSourceWebCorepagePagecpp">branches/safari-603-branch/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCorepagePageh">branches/safari-603-branch/Source/WebCore/page/Page.h</a></li>
<li><a href="#branchessafari603branchSourceWebCorepageSettingsin">branches/safari-603-branch/Source/WebCore/page/Settings.in</a></li>
<li><a href="#branchessafari603branchSourceWebKitmacChangeLog">branches/safari-603-branch/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebKitmacWebViewWebPreferenceKeysPrivateh">branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h</a></li>
<li><a href="#branchessafari603branchSourceWebKitmacWebViewWebPreferencesmm">branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferences.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKitmacWebViewWebPreferencesPrivateh">branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h</a></li>
<li><a href="#branchessafari603branchSourceWebKitmacWebViewWebViewmm">branches/safari-603-branch/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#branchessafari603branchSourceWebKitwinChangeLog">branches/safari-603-branch/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebKitwinInterfacesIWebPreferencesPrivateidl">branches/safari-603-branch/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl</a></li>
<li><a href="#branchessafari603branchSourceWebKitwinWebPreferenceKeysPrivateh">branches/safari-603-branch/Source/WebKit/win/WebPreferenceKeysPrivate.h</a></li>
<li><a href="#branchessafari603branchSourceWebKitwinWebPreferencescpp">branches/safari-603-branch/Source/WebKit/win/WebPreferences.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebKitwinWebPreferencesh">branches/safari-603-branch/Source/WebKit/win/WebPreferences.h</a></li>
<li><a href="#branchessafari603branchSourceWebKitwinWebViewcpp">branches/safari-603-branch/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebKit2ChangeLog">branches/safari-603-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebKit2SharedWebPreferencesDefinitionsh">branches/safari-603-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessAPICWKPreferencescpp">branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh">branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h</a></li>
<li><a href="#branchessafari603branchSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp">branches/safari-603-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebKit2WebProcessWebPageWebPagecpp">branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#branchessafari603branchToolsChangeLog">branches/safari-603-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreemacDumpRenderTreemm">branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm</a></li>
<li><a href="#branchessafari603branchToolsDumpRenderTreewinDumpRenderTreecpp">branches/safari-603-branch/Tools/DumpRenderTree/win/DumpRenderTree.cpp</a></li>
<li><a href="#branchessafari603branchToolsWebKitTestRunnerTestControllercpp">branches/safari-603-branch/Tools/WebKitTestRunner/TestController.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari603branchLayoutTestsfasthistorypagecacheafterwindowopenexpectedtxt">branches/safari-603-branch/LayoutTests/fast/history/page-cache-after-window-open-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasthistorypagecacheafterwindowopenhtml">branches/safari-603-branch/LayoutTests/fast/history/page-cache-after-window-open.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasthistorypagecachebacknavigationcrashexpectedtxt">branches/safari-603-branch/LayoutTests/fast/history/page-cache-back-navigation-crash-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasthistorypagecachebacknavigationcrashhtml">branches/safari-603-branch/LayoutTests/fast/history/page-cache-back-navigation-crash.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasthistorypagecachewithopenerexpectedtxt">branches/safari-603-branch/LayoutTests/fast/history/page-cache-with-opener-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasthistorypagecachewithopenerhtml">branches/safari-603-branch/LayoutTests/fast/history/page-cache-with-opener.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasthistoryresourcespagecachewindowwithiframehtml">branches/safari-603-branch/LayoutTests/fast/history/resources/page-cache-window-with-iframe.html</a></li>
<li><a href="#branchessafari603branchLayoutTestsfasthistoryresourcespagecachewindowwithopenerhtml">branches/safari-603-branch/LayoutTests/fast/history/resources/page-cache-window-with-opener.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari603branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/ChangeLog (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/ChangeLog        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/LayoutTests/ChangeLog        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -1,5 +1,41 @@
</span><span class="cx"> 2017-02-09  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r211254. rdar://problem/30188490
+
+    2017-01-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+            Crash when navigating back to a page in PacheCache when one of its frames has been removed
+            https://bugs.webkit.org/show_bug.cgi?id=167421
+            &lt;rdar://problem/30188490&gt;
+
+            Reviewed by Darin Adler.
+
+            * fast/history/page-cache-after-window-open-expected.txt: Added.
+            * fast/history/page-cache-after-window-open.html: Added.
+            * fast/history/page-cache-back-navigation-crash-expected.txt: Added.
+            * fast/history/page-cache-back-navigation-crash.html: Added.
+            * fast/history/page-cache-with-opener-expected.txt: Added.
+            * fast/history/page-cache-with-opener.html: Added.
+            * fast/history/resources/page-cache-window-with-iframe.html: Added.
+            * fast/history/resources/page-cache-window-with-opener.html: Added.
+            Add layout test coverage.
+
+            * editing/mac/input/unconfirmed-text-navigation-with-page-cache.html:
+            * fast/harness/page-cache-crash-on-data-urls.html:
+            * fast/harness/use-page-cache.html:
+            * fast/history/page-cache-after-window-open-expected.txt: Added.
+            * fast/history/page-cache-after-window-open.html: Added.
+            * fast/history/page-cache-with-opener-expected.txt: Added.
+            * fast/history/page-cache-with-opener.html: Added.
+            * fast/history/resources/page-cache-window-with-opener.html: Added.
+            * fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html:
+            * fast/loader/stateobjects/popstate-fires-with-page-cache.html:
+            * tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:
+            These tests relied on using window.open() to test PageCache for convenience. They now
+            need to override a setting in order to be allowed to do so.
+
+2017-02-09  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r211041. rdar://problem/29931587
</span><span class="cx"> 
</span><span class="cx">     2017-01-23  Megan Gardner  &lt;megan_gardner@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestseditingmacinputunconfirmedtextnavigationwithpagecachehtml"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -10,6 +10,7 @@
</span><span class="cx"> if (window.testRunner) {
</span><span class="cx">     testRunner.setCanOpenWindows();
</span><span class="cx">     testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
</span><ins>+    testRunner.overridePreference(&quot;WebKitAllowsPageCacheWithWindowOpenerKey&quot;, 1);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Window we will be controlling.
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestsfastharnesspagecachecrashondataurlshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx">         testRunner.waitUntilDone();
</span><span class="cx">         testRunner.setCanOpenWindows();
</span><span class="cx">         testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
</span><ins>+        testRunner.overridePreference(&quot;WebKitAllowsPageCacheWithWindowOpenerKey&quot;, 1);
</ins><span class="cx">     }
</span><span class="cx">     log(&quot;open page with data urls&quot;);
</span><span class="cx">     window.open(&quot;resources/cached-page-with-data-urls.html&quot;);
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestsfastharnessusepagecachehtml"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/fast/harness/use-page-cache.html (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/harness/use-page-cache.html        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/LayoutTests/fast/harness/use-page-cache.html        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">         testRunner.waitUntilDone();
</span><span class="cx">         testRunner.setCanOpenWindows();
</span><span class="cx">         testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
</span><ins>+        testRunner.overridePreference(&quot;WebKitAllowsPageCacheWithWindowOpenerKey&quot;, 1);
</ins><span class="cx">     }
</span><span class="cx">     log(&quot;open page-1&quot;);
</span><span class="cx">     window.open(&quot;resources/cached-page-1.html&quot;);
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasthistorypagecacheafterwindowopenexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/history/page-cache-after-window-open-expected.txt (0 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/history/page-cache-after-window-open-expected.txt                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/history/page-cache-after-window-open-expected.txt        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Tests that a page that has called window.open() does not go into the page cache.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+pageshow - not from cache
+PASS Page was not restored from page cache
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasthistorypagecacheafterwindowopenhtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/history/page-cache-after-window-open.html (0 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/history/page-cache-after-window-open.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/history/page-cache-after-window-open.html        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description('Tests that a page that has called window.open() does not go into the page cache.');
+window.jsTestIsAsync = true;
+
+if (window.testRunner) {
+    testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
+    testRunner.setCanOpenWindows();
+}
+
+window.addEventListener(&quot;pageshow&quot;, function(event) {
+    debug(&quot;pageshow - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;from cache&quot;);
+
+    if (!window.sessionStorage.page_cache_after_window_open_test_started)
+        return;
+
+    delete window.sessionStorage.page_cache_after_window_open_test_started;
+
+    if (event.persisted)
+        testFailed(&quot;Page did enter and was restored from the page cache&quot;);
+    else
+        testPassed(&quot;Page was not restored from page cache&quot;);
+
+    finishJSTest();
+}, false);
+
+window.addEventListener(&quot;pagehide&quot;, function(event) {
+    debug(&quot;pagehide - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;entering cache&quot;);
+    if (event.persisted) {
+        testFailed(&quot;Page entered the page cache.&quot;);
+        finishJSTest();
+    }
+}, false);
+
+window.addEventListener('load', function() {
+    newWindow = open(&quot;about:blank&quot;, &quot;one&quot;);
+    otherWindowDocument = newWindow.document;
+
+    setTimeout(function() {
+        // Force a back navigation back to this page.
+        window.sessionStorage.page_cache_after_window_open_test_started = true;
+        window.location.href = &quot;resources/page-cache-helper.html&quot;;
+    }, 0);
+}, false);
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasthistorypagecachebacknavigationcrashexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/history/page-cache-back-navigation-crash-expected.txt (0 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/history/page-cache-back-navigation-crash-expected.txt                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/history/page-cache-back-navigation-crash-expected.txt        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Tests that removing a frame in a detached document after navigation does not cause a crash on navigating back
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasthistorypagecachebacknavigationcrashhtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/history/page-cache-back-navigation-crash.html (0 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/history/page-cache-back-navigation-crash.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/history/page-cache-back-navigation-crash.html        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description('Tests that removing a frame in a detached document after navigation does not cause a crash on navigating back');
+window.jsTestIsAsync = true;
+
+if (window.testRunner) {
+    testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
+    testRunner.setCanOpenWindows();
+}
+
+function removeFrameInChild()
+{
+    setTimeout(function() {
+        testFrame.remove();
+    }, 0);
+}
+
+window.addEventListener('load', function() {
+    newWindow = open(&quot;resources/page-cache-window-with-iframe.html&quot;, &quot;one&quot;);
+    newWindow.onload = function () {
+        newWindow.onload = null;
+        otherWindowDocument = newWindow.document;
+        testFrame = otherWindowDocument.getElementsByTagName(&quot;iframe&quot;)[0];
+    }
+}, false);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasthistorypagecachewithopenerexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/history/page-cache-with-opener-expected.txt (0 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/history/page-cache-with-opener-expected.txt                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/history/page-cache-with-opener-expected.txt        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Tests that a page that has a window opener does not go into the page cache.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS Page was not restored from page cache
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasthistorypagecachewithopenerhtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/history/page-cache-with-opener.html (0 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/history/page-cache-with-opener.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/history/page-cache-with-opener.html        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description('Tests that a page that has a window opener does not go into the page cache.');
+window.jsTestIsAsync = true;
+
+if (window.testRunner) {
+    testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
+    testRunner.setCanOpenWindows();
+}
+
+window.addEventListener('load', function() {
+    newWindow = open(&quot;resources/page-cache-window-with-opener.html&quot;, &quot;one&quot;);
+    otherWindowDocument = newWindow.document;
+}, false);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasthistoryresourcespagecachewindowwithiframehtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/history/resources/page-cache-window-with-iframe.html (0 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/history/resources/page-cache-window-with-iframe.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/history/resources/page-cache-window-with-iframe.html        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;iframe src=&quot;about:blank&quot;&gt;&lt;/iframe&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
+
+window.addEventListener(&quot;pageshow&quot;, function(event) {
+    debug(&quot;pageshow - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;from cache&quot;);
+
+    if (!window.sessionStorage.page_cache_window_iframe_removed_test_started)
+        return;
+
+    delete window.sessionStorage.page_cache_window_iframe_removed_test_started;
+
+    setTimeout(function() {
+        window.opener.finishJSTest();
+    }, 0);
+}, false);
+
+window.addEventListener(&quot;pagehide&quot;, function(event) {
+    debug(&quot;pagehide - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;entering cache&quot;);
+}, false);
+
+window.addEventListener('load', function() {
+    setTimeout(function() {
+         window.opener.removeFrameInChild();
+        // Force a back navigation back to this page.
+        window.sessionStorage.page_cache_window_iframe_removed_test_started = true;
+        window.location.href = &quot;page-cache-helper.html&quot;;
+    }, 0);
+}, false);
+&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfasthistoryresourcespagecachewindowwithopenerhtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/fast/history/resources/page-cache-window-with-opener.html (0 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/history/resources/page-cache-window-with-opener.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/history/resources/page-cache-window-with-opener.html        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
+
+window.addEventListener(&quot;pageshow&quot;, function(event) {
+    debug(&quot;pageshow - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;from cache&quot;);
+
+    if (!window.sessionStorage.page_cache_window_opener_test_started)
+        return;
+
+    delete window.sessionStorage.page_cache_window_opener_test_started;
+
+    if (event.persisted)
+        window.opener.testFailed(&quot;Page did enter and was restored from the page cache&quot;);
+    else
+        window.opener.testPassed(&quot;Page was not restored from page cache&quot;);
+
+    window.opener.finishJSTest();
+}, false);
+
+window.addEventListener(&quot;pagehide&quot;, function(event) {
+    debug(&quot;pagehide - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;entering cache&quot;);
+    if (event.persisted) {
+        window.opener.testFailed(&quot;Page entered the page cache.&quot;);
+        window.opener.finishJSTest();
+    }
+}, false);
+
+window.addEventListener('load', function() {
+    setTimeout(function() {
+        // Force a back navigation back to this page.
+        window.sessionStorage.page_cache_window_opener_test_started = true;
+        window.location.href = &quot;page-cache-helper.html&quot;;
+    }, 0);
+}, false);
+&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfastloaderstateobjectsnopopstatewhenbacktostatelessentrywithpagecachehtml"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -14,6 +14,7 @@
</span><span class="cx">     if (window.testRunner) {
</span><span class="cx">         testRunner.setCanOpenWindows();
</span><span class="cx">         testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
</span><ins>+        testRunner.overridePreference(&quot;WebKitAllowsPageCacheWithWindowOpenerKey&quot;, 1);
</ins><span class="cx">     }
</span><span class="cx">     testWindow = window.open('resources/no-popstate-when-back-to-stateless-entry-1.html');
</span><span class="cx">     if (!testWindow)
</span><span class="lines">@@ -62,4 +63,4 @@
</span><span class="cx"> var jsTestIsAsync = true;
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;/html&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfastloaderstateobjectspopstatefireswithpagecachehtml"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -14,6 +14,7 @@
</span><span class="cx">     if (window.testRunner) {
</span><span class="cx">         testRunner.setCanOpenWindows();
</span><span class="cx">         testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
</span><ins>+        testRunner.overridePreference(&quot;WebKitAllowsPageCacheWithWindowOpenerKey&quot;, 1);
</ins><span class="cx">     }
</span><span class="cx">     testWindow = window.open('resources/popstate-fires-with-page-cache-1.html');
</span><span class="cx">     if (!testWindow)
</span></span></pre></div>
<a id="branchessafari603branchLayoutTeststileddrawingtileddrawingscrollpositionpagecacherestorationhtml"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -7,6 +7,7 @@
</span><span class="cx">             testRunner.waitUntilDone();
</span><span class="cx">             testRunner.setCanOpenWindows();
</span><span class="cx">             testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
</span><ins>+            testRunner.overridePreference(&quot;WebKitAllowsPageCacheWithWindowOpenerKey&quot;, 1);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         window.finishedTest = function (layerTree)
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/ChangeLog        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2017-02-09  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
+        Merge r211254. rdar://problem/30188490
+
+    2017-01-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+            Crash when navigating back to a page in PacheCache when one of its frames has been removed
+            https://bugs.webkit.org/show_bug.cgi?id=167421
+            &lt;rdar://problem/30188490&gt;
+
+            Reviewed by Darin Adler.
+
+            Disallow page caching of a page if:
+            1. The main window has an opener (i.e. it was opened via window.open)
+            2. It has ever used window.open()
+
+            This is because allowing page caching in this case would allow such
+            windows to script each other even after one of them entered Page
+            Cache. Allowing this is dangerous and easily causes crashes.
+
+            This is a short term workaround until we find a better solution to
+            the problem. One issue is this workaround is that navigating back
+            to a page that has an opener or used window.open() will not longer
+            get the page from PageCache. As a result, state may be lost upon
+            navigating back. However, we never guarantee that pages get page
+            cached, and Chrome does not have a PageCache.
+
+            Tests: fast/history/page-cache-after-window-open.html
+                   fast/history/page-cache-back-navigation-crash.html
+                   fast/history/page-cache-with-opener.html
+
+            * dom/Document.cpp:
+            (WebCore::Document::hasEverCalledWindowOpen):
+            (WebCore::Document::markHasCalledWindowOpen):
+            * dom/Document.h:
+            * history/PageCache.cpp:
+            (WebCore::canCachePage):
+            * page/DOMWindow.cpp:
+            (WebCore::DOMWindow::createWindow):
+            * page/DiagnosticLoggingKeys.cpp:
+            (WebCore::DiagnosticLoggingKeys::hasCalledWindowOpenKey):
+            (WebCore::DiagnosticLoggingKeys::hasOpenerKey):
+            * page/DiagnosticLoggingKeys.h:
+            * page/Page.cpp:
+            (WebCore::Page::openedByWindowOpen):
+            * page/Page.h:
+            * page/Settings.in:
+
</ins><span class="cx"> 2017-02-06  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r211653. rdar://problem/29872943
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/dom/Document.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/dom/Document.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebCore/dom/Document.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -835,6 +835,23 @@
</span><span class="cx">     return documentElement() &amp;&amp; documentElement()-&gt;hasTagName(htmlTag) &amp;&amp; documentElement()-&gt;hasAttributeWithoutSynchronization(manifestAttr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool Document::hasEverCalledWindowOpen() const
+{
+    auto&amp; topDocument = this-&gt;topDocument();
+    if (&amp;topDocument == this)
+        return m_hasEverCalledWindowOpen;
+    return topDocument.hasEverCalledWindowOpen();
+}
+
+void Document::markHasCalledWindowOpen()
+{
+    auto&amp; topDocument = this-&gt;topDocument();
+    if (&amp;topDocument == this)
+        m_hasEverCalledWindowOpen = true;
+    else
+        topDocument.markHasCalledWindowOpen();
+}
+
</ins><span class="cx"> DocumentType* Document::doctype() const
</span><span class="cx"> {
</span><span class="cx">     for (Node* node = firstChild(); node; node = node-&gt;nextSibling()) {
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/dom/Document.h (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/dom/Document.h        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebCore/dom/Document.h        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -375,6 +375,9 @@
</span><span class="cx">     WEBCORE_EXPORT bool hasFocus() const;
</span><span class="cx"> 
</span><span class="cx">     bool hasManifest() const;
</span><ins>+
+    bool hasEverCalledWindowOpen() const;
+    void markHasCalledWindowOpen();
</ins><span class="cx">     
</span><span class="cx">     WEBCORE_EXPORT ExceptionOr&lt;Ref&lt;Element&gt;&gt; createElementForBindings(const AtomicString&amp; tagName);
</span><span class="cx">     WEBCORE_EXPORT Ref&lt;DocumentFragment&gt; createDocumentFragment();
</span><span class="lines">@@ -1490,6 +1493,7 @@
</span><span class="cx">     bool m_bParsing;
</span><span class="cx"> 
</span><span class="cx">     Timer m_styleRecalcTimer;
</span><ins>+    bool m_hasEverCalledWindowOpen { false };
</ins><span class="cx">     bool m_pendingStyleRecalcShouldForce;
</span><span class="cx">     bool m_inStyleRecalc;
</span><span class="cx">     bool m_closeAfterStyleRecalc;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorehistoryPageCachecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/history/PageCache.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/history/PageCache.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebCore/history/PageCache.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -193,6 +193,19 @@
</span><span class="cx"> 
</span><span class="cx">     DiagnosticLoggingClient&amp; diagnosticLoggingClient = page.diagnosticLoggingClient();
</span><span class="cx">     bool isCacheable = canCacheFrame(page.mainFrame(), diagnosticLoggingClient, indentLevel + 1);
</span><ins>+
+    if (page.openedByWindowOpen() &amp;&amp; !page.settings().allowsPageCacheWithWindowOpener()) {
+        PCLOG(&quot;   -Page has been opened via window.open()&quot;);
+        logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::hasOpenerKey());
+        isCacheable = false;
+    }
+
+    auto* topDocument = page.mainFrame().document();
+    if (topDocument &amp;&amp; topDocument-&gt;hasEverCalledWindowOpen()) {
+        PCLOG(&quot;   -Page has called window.open()&quot;);
+        logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::hasCalledWindowOpenKey());
+        isCacheable = false;
+    }
</ins><span class="cx">     
</span><span class="cx">     if (!page.settings().usesPageCache() || page.isResourceCachingDisabled()) {
</span><span class="cx">         PCLOG(&quot;   -Page settings says b/f cache disabled&quot;);
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/page/DOMWindow.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/page/DOMWindow.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebCore/page/DOMWindow.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -2196,6 +2196,8 @@
</span><span class="cx"> 
</span><span class="cx">     newFrame-&gt;loader().setOpener(&amp;openerFrame);
</span><span class="cx">     newFrame-&gt;page()-&gt;setOpenedByDOM();
</span><ins>+    if (auto* openerDocument = openerFrame.document())
+        openerDocument-&gt;markHasCalledWindowOpen();
</ins><span class="cx"> 
</span><span class="cx">     if (newFrame-&gt;document()-&gt;domWindow()-&gt;isInsecureScriptAccess(activeWindow, completedURL))
</span><span class="cx">         return newFrame;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorepageDiagnosticLoggingKeyscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -663,6 +663,16 @@
</span><span class="cx">     return ASCIILiteral(&quot;font&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String DiagnosticLoggingKeys::hasCalledWindowOpenKey()
+{
+    return ASCIILiteral(&quot;hasCalledWindowOpen&quot;);
+}
+
+String DiagnosticLoggingKeys::hasOpenerKey()
+{
+    return ASCIILiteral(&quot;hasOpener&quot;);
+}
+
</ins><span class="cx"> String DiagnosticLoggingKeys::prunedDueToMemoryPressureKey()
</span><span class="cx"> {
</span><span class="cx">     return ASCIILiteral(&quot;pruned.memoryPressure&quot;);
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorepageDiagnosticLoggingKeysh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.h (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.h        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebCore/page/DiagnosticLoggingKeys.h        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -55,6 +55,8 @@
</span><span class="cx">     WEBCORE_EXPORT static String entryWronglyNotWarmedUpKey();
</span><span class="cx">     static String expiredKey();
</span><span class="cx">     static String fontKey();
</span><ins>+    static String hasCalledWindowOpenKey();
+    static String hasOpenerKey();
</ins><span class="cx">     static String hasPluginsKey();
</span><span class="cx">     static String httpsNoStoreKey();
</span><span class="cx">     static String imageKey();
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/page/Page.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/page/Page.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebCore/page/Page.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -461,6 +461,17 @@
</span><span class="cx">     m_openedByDOM = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool Page::openedByWindowOpen() const
+{
+    auto* document = m_mainFrame-&gt;document();
+    if (!document)
+        return false;
+    auto* window = document-&gt;domWindow();
+    if (!window)
+        return false;
+    return window-&gt;opener();
+}
+
</ins><span class="cx"> void Page::goToItem(HistoryItem&amp; item, FrameLoadType type)
</span><span class="cx"> {
</span><span class="cx">     // stopAllLoaders may end up running onload handlers, which could cause further history traversals that may lead to the passed in HistoryItem
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/page/Page.h (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/page/Page.h        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebCore/page/Page.h        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -180,6 +180,8 @@
</span><span class="cx">     bool openedByDOM() const;
</span><span class="cx">     void setOpenedByDOM();
</span><span class="cx"> 
</span><ins>+    bool openedByWindowOpen() const;
+
</ins><span class="cx">     WEBCORE_EXPORT void goToItem(HistoryItem&amp;, FrameLoadType);
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void setGroupName(const String&amp;);
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorepageSettingsin"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/page/Settings.in (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/page/Settings.in        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebCore/page/Settings.in        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -295,3 +295,5 @@
</span><span class="cx"> es6ModulesEnabled initial=false
</span><span class="cx"> 
</span><span class="cx"> shouldSuppressKeyboardInputDuringProvisionalNavigation initial=false
</span><ins>+
+allowsPageCacheWithWindowOpener initial=false
</ins></span></pre></div>
<a id="branchessafari603branchSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/mac/ChangeLog (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/mac/ChangeLog        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit/mac/ChangeLog        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2017-02-09  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
+        Merge r211254. rdar://problem/30188490
+
+    2017-01-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+            Crash when navigating back to a page in PacheCache when one of its frames has been removed
+            https://bugs.webkit.org/show_bug.cgi?id=167421
+            &lt;rdar://problem/30188490&gt;
+
+            Reviewed by Darin Adler.
+
+            Add a new setting allowing layout tests to enable PageCache in a window
+            that has an opener, for convenience.
+
+            * WebView/WebPreferenceKeysPrivate.h:
+            * WebView/WebPreferences.mm:
+            (+[WebPreferences initialize]):
+            (-[WebPreferences allowsPageCacheWithWindowOpener]):
+            (-[WebPreferences setAllowsPageCacheWithWindowOpener:]):
+            * WebView/WebPreferencesPrivate.h:
+            * WebView/WebView.mm:
+            (-[WebView _preferencesChanged:]):
+
</ins><span class="cx"> 2017-02-06  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r211653. rdar://problem/29872943
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitmacWebViewWebPreferenceKeysPrivateh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx"> #define WebAutomaticSpellingCorrectionEnabled @&quot;WebAutomaticSpellingCorrectionEnabled&quot;
</span><span class="cx"> #define WebKitDOMPasteAllowedPreferenceKey @&quot;WebKitDOMPasteAllowedPreferenceKey&quot;
</span><span class="cx"> #define WebKitUsesPageCachePreferenceKey @&quot;WebKitUsesPageCachePreferenceKey&quot;
</span><ins>+#define WebKitAllowsPageCacheWithWindowOpenerKey @&quot;WebKitAllowsPageCacheWithWindowOpenerKey&quot;
</ins><span class="cx"> #define WebKitPageCacheSupportsPluginsPreferenceKey @&quot;WebKitPageCacheSupportsPluginsPreferenceKey&quot;
</span><span class="cx"> #define WebKitFTPDirectoryTemplatePath @&quot;WebKitFTPDirectoryTemplatePath&quot;
</span><span class="cx"> #define WebKitForceFTPDirectoryListings @&quot;WebKitForceFTPDirectoryListings&quot;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitmacWebViewWebPreferencesmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferences.mm (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferences.mm        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferences.mm        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -478,6 +478,7 @@
</span><span class="cx">         [NSNumber numberWithBool:NO],   WebKitDOMPasteAllowedPreferenceKey,
</span><span class="cx"> #endif
</span><span class="cx">         [NSNumber numberWithBool:YES],  WebKitUsesPageCachePreferenceKey,
</span><ins>+        [NSNumber numberWithBool:NO],   WebKitAllowsPageCacheWithWindowOpenerKey,
</ins><span class="cx">         [NSNumber numberWithInt:cacheModelForMainBundle()], WebKitCacheModelPreferenceKey,
</span><span class="cx">         [NSNumber numberWithBool:YES],  WebKitPageCacheSupportsPluginsPreferenceKey,
</span><span class="cx">         [NSNumber numberWithBool:NO],   WebKitDeveloperExtrasEnabledPreferenceKey,
</span><span class="lines">@@ -2431,6 +2432,16 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (BOOL)allowsPageCacheWithWindowOpener
+{
+    return [self _boolValueForKey:WebKitAllowsPageCacheWithWindowOpenerKey];
+}
+
+- (void)setAllowsPageCacheWithWindowOpener:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitAllowsPageCacheWithWindowOpenerKey];
+}
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> - (void)_invalidateCachedPreferences
</span><span class="cx"> {
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitmacWebViewWebPreferencesPrivateh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebPreferencesPrivate.h        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -295,6 +295,9 @@
</span><span class="cx"> - (NSString *)pictographFontFamily;
</span><span class="cx"> - (void)setPictographFontFamily:(NSString *)family;
</span><span class="cx"> 
</span><ins>+- (BOOL)allowsPageCacheWithWindowOpener;
+- (void)setAllowsPageCacheWithWindowOpener:(BOOL)flag;
+
</ins><span class="cx"> - (BOOL)pageCacheSupportsPlugins;
</span><span class="cx"> - (void)setPageCacheSupportsPlugins:(BOOL)flag;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/mac/WebView/WebView.mm (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/mac/WebView/WebView.mm        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit/mac/WebView/WebView.mm        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -2667,6 +2667,7 @@
</span><span class="cx">     settings.setTextDirectionSubmenuInclusionBehavior(core([preferences textDirectionSubmenuInclusionBehavior]));
</span><span class="cx">     settings.setDOMPasteAllowed([preferences isDOMPasteAllowed]);
</span><span class="cx">     settings.setUsesPageCache([self usesPageCache]);
</span><ins>+    settings.setAllowsPageCacheWithWindowOpener([preferences allowsPageCacheWithWindowOpener]);
</ins><span class="cx">     settings.setPageCacheSupportsPlugins([preferences pageCacheSupportsPlugins]);
</span><span class="cx">     settings.setBackForwardCacheExpirationInterval([preferences _backForwardCacheExpirationInterval]);
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/win/ChangeLog (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/win/ChangeLog        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit/win/ChangeLog        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2017-02-09  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
+        Merge r211254. rdar://problem/30188490
+
+    2017-01-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+            Crash when navigating back to a page in PacheCache when one of its frames has been removed
+            https://bugs.webkit.org/show_bug.cgi?id=167421
+            &lt;rdar://problem/30188490&gt;
+
+            Reviewed by Darin Adler.
+
+            Add a new setting allowing layout tests to enable PageCache in a window
+            that has an opener, for convenience.
+
+            * WebPreferenceKeysPrivate.h:
+            * WebPreferences.cpp:
+            (WebPreferences::initializeDefaultSettings):
+            * WebPreferences.h:
+
</ins><span class="cx"> 2017-02-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r211569. rdar://problem/30229990
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitwinInterfacesIWebPreferencesPrivateidl"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -91,6 +91,9 @@
</span><span class="cx">     HRESULT experimentalNotificationsEnabled([out, retval] BOOL *enabled);
</span><span class="cx">     HRESULT setExperimentalNotificationsEnabled([in] BOOL enabled);
</span><span class="cx"> 
</span><ins>+    HRESULT allowsPageCacheWithWindowOpener([out, retval] BOOL* usesPageCache);
+    HRESULT setAllowsPageCacheWithWindowOpener([in] BOOL usesPageCache);
+
</ins><span class="cx">     HRESULT setShouldUseHighResolutionTimers([in] BOOL useHighResolutionTimers);
</span><span class="cx">     HRESULT shouldUseHighResolutionTimers([out, retval] BOOL* useHighResolutionTimers);
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitwinWebPreferenceKeysPrivateh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/win/WebPreferenceKeysPrivate.h (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/win/WebPreferenceKeysPrivate.h        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit/win/WebPreferenceKeysPrivate.h        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx"> #define WebKitIconDatabaseLocationKey &quot;WebKitIconDatabaseLocation&quot;
</span><span class="cx"> #define WebKitIconDatabaseEnabledPreferenceKey &quot;WebKitIconDatabaseEnabled&quot;
</span><span class="cx"> #define WebKitUsesPageCachePreferenceKey &quot;WebKitUsesPageCachePreferenceKey&quot;
</span><ins>+#define WebKitAllowsPageCacheWithWindowOpenerKey &quot;WebKitAllowsPageCacheWithWindowOpenerKey&quot;
</ins><span class="cx"> #define WebKitCacheModelPreferenceKey &quot;WebKitCacheModelPreferenceKey&quot;
</span><span class="cx"> #define WebKitLocalStorageDatabasePathPreferenceKey &quot;WebKitLocalStorageDatabasePath&quot;
</span><span class="cx"> #define WebKitHyperlinkAuditingEnabledPreferenceKey &quot;WebKitHyperlinkAuditingEnabled&quot;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitwinWebPreferencescpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/win/WebPreferences.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/win/WebPreferences.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit/win/WebPreferences.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -262,6 +262,7 @@
</span><span class="cx">     CFDictionaryAddValue(defaults, CFSTR(WebGrammarCheckingEnabledPreferenceKey), kCFBooleanFalse);
</span><span class="cx">     CFDictionaryAddValue(defaults, CFSTR(AllowContinuousSpellCheckingPreferenceKey), kCFBooleanTrue);
</span><span class="cx">     CFDictionaryAddValue(defaults, CFSTR(WebKitUsesPageCachePreferenceKey), kCFBooleanTrue);
</span><ins>+    CFDictionaryAddValue(defaults, CFSTR(WebKitAllowsPageCacheWithWindowOpenerKey), kCFBooleanFalse);
</ins><span class="cx">     CFDictionaryAddValue(defaults, CFSTR(WebKitLocalStorageDatabasePathPreferenceKey), CFSTR(&quot;&quot;));
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;CFStringRef&gt; cacheModelRef = adoptCF(CFStringCreateWithFormat(0, 0, CFSTR(&quot;%d&quot;), WebCacheModelDocumentViewer));
</span><span class="lines">@@ -1604,6 +1605,20 @@
</span><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+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;
+}
+
</ins><span class="cx"> HRESULT WebPreferences::setZoomsTextOnly(BOOL zoomsTextOnly)
</span><span class="cx"> {
</span><span class="cx">     setBoolValue(WebKitZoomsTextOnlyPreferenceKey, zoomsTextOnly);
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitwinWebPreferencesh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/win/WebPreferences.h (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/win/WebPreferences.h        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit/win/WebPreferences.h        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -159,6 +159,8 @@
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE setLocalStorageDatabasePath(_In_ BSTR);
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE experimentalNotificationsEnabled(_Out_ BOOL*);
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE setExperimentalNotificationsEnabled(BOOL);
</span><ins>+    virtual HRESULT STDMETHODCALLTYPE allowsPageCacheWithWindowOpener(_Out_ BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE setAllowsPageCacheWithWindowOpener(BOOL);
</ins><span class="cx"> 
</span><span class="cx">     // These two methods are no-ops, and only retained to keep
</span><span class="cx">     // the Interface consistent. DO NOT USE THEM.
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit/win/WebView.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit/win/WebView.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit/win/WebView.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -5401,6 +5401,11 @@
</span><span class="cx">         return hr;
</span><span class="cx">     settings.setExperimentalNotificationsEnabled(enabled);
</span><span class="cx"> 
</span><ins>+    hr = prefsPrivate-&gt;allowsPageCacheWithWindowOpener(&amp;enabled);
+    if (FAILED(hr))
+        return hr;
+    settings.setAllowsPageCacheWithWindowOpener(enabled);
+
</ins><span class="cx">     hr = prefsPrivate-&gt;isWebSecurityEnabled(&amp;enabled);
</span><span class="cx">     if (FAILED(hr))
</span><span class="cx">         return hr;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/ChangeLog (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/ChangeLog        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit2/ChangeLog        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2017-02-09  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
+        Merge r211254. rdar://problem/30188490
+
+    2017-01-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+            Crash when navigating back to a page in PacheCache when one of its frames has been removed
+            https://bugs.webkit.org/show_bug.cgi?id=167421
+            &lt;rdar://problem/30188490&gt;
+
+            Reviewed by Darin Adler.
+
+            Add a new setting allowing layout tests to enable PageCache in a window
+            that has an opener, for convenience.
+
+            * Shared/WebPreferencesDefinitions.h:
+            * UIProcess/API/C/WKPreferences.cpp:
+            (WKPreferencesSetAllowsPageCacheWithWindowOpener):
+            (WKPreferencesGetAllowsPageCacheWithWindowOpener):
+            * UIProcess/API/C/WKPreferencesRefPrivate.h:
+            * WebProcess/InjectedBundle/InjectedBundle.cpp:
+            (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::updatePreferences):
+
</ins><span class="cx"> 2017-02-06  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r211666. rdar://problem/30167791
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2SharedWebPreferencesDefinitionsh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -138,6 +138,7 @@
</span><span class="cx">     macro(WebArchiveDebugModeEnabled, webArchiveDebugModeEnabled, Bool, bool, false, &quot;&quot;, &quot;&quot;) \
</span><span class="cx">     macro(LocalFileContentSniffingEnabled, localFileContentSniffingEnabled, Bool, bool, false, &quot;&quot;, &quot;&quot;) \
</span><span class="cx">     macro(UsesPageCache, usesPageCache, Bool, bool, true, &quot;&quot;, &quot;&quot;) \
</span><ins>+    macro(AllowsPageCacheWithWindowOpener, allowsPageCacheWithWindowOpener, Bool, bool, false, &quot;&quot;, &quot;&quot;) \
</ins><span class="cx">     macro(PageCacheSupportsPlugins, pageCacheSupportsPlugins, Bool, bool, true, &quot;&quot;, &quot;&quot;) \
</span><span class="cx">     macro(AuthorAndUserStylesEnabled, authorAndUserStylesEnabled, Bool, bool, true, &quot;&quot;, &quot;&quot;) \
</span><span class="cx">     macro(PaginateDuringLayoutEnabled, paginateDuringLayoutEnabled, Bool, bool, false, &quot;&quot;, &quot;&quot;) \
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessAPICWKPreferencescpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -623,6 +623,16 @@
</span><span class="cx">     return toImpl(preferencesRef)-&gt;usesPageCache();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WKPreferencesSetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)-&gt;setAllowsPageCacheWithWindowOpener(enabled);
+}
+
+bool WKPreferencesGetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)-&gt;allowsPageCacheWithWindowOpener();
+}
+
</ins><span class="cx"> void WKPreferencesSetPageCacheSupportsPlugins(WKPreferencesRef preferencesRef, bool pageCacheSupportsPlugins)
</span><span class="cx"> {
</span><span class="cx">     toImpl(preferencesRef)-&gt;setPageCacheSupportsPlugins(pageCacheSupportsPlugins);
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -143,6 +143,10 @@
</span><span class="cx"> WK_EXPORT void WKPreferencesSetPageCacheEnabled(WKPreferencesRef preferences, bool enabled);
</span><span class="cx"> WK_EXPORT bool WKPreferencesGetPageCacheEnabled(WKPreferencesRef preferences);
</span><span class="cx"> 
</span><ins>+// Defaults to false.
+WK_EXPORT void WKPreferencesSetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferences);
+
</ins><span class="cx"> // Defaults to true.
</span><span class="cx"> WK_EXPORT void WKPreferencesSetPageCacheSupportsPlugins(WKPreferencesRef preferences, bool pageCacheSupportsPlugins);
</span><span class="cx"> WK_EXPORT bool WKPreferencesGetPageCacheSupportsPlugins(WKPreferencesRef preferences);
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -246,6 +246,7 @@
</span><span class="cx">     macro(WebKitPageCacheSupportsPluginsPreferenceKey, PageCacheSupportsPlugins, pageCacheSupportsPlugins) \
</span><span class="cx">     macro(WebKitPluginsEnabled, PluginsEnabled, pluginsEnabled) \
</span><span class="cx">     macro(WebKitUsesPageCachePreferenceKey, UsesPageCache, usesPageCache) \
</span><ins>+    macro(WebKitAllowsPageCacheWithWindowOpenerKey, AllowsPageCacheWithWindowOpener, allowsPageCacheWithWindowOpener) \
</ins><span class="cx">     macro(WebKitWebAudioEnabled, WebAudioEnabled, webAudioEnabled) \
</span><span class="cx">     macro(WebKitWebGLEnabled, WebGLEnabled, webGLEnabled) \
</span><span class="cx">     macro(WebKitXSSAuditorEnabled, XSSAuditorEnabled, xssAuditorEnabled) \
</span></span></pre></div>
<a id="branchessafari603branchSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -2992,6 +2992,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     settings.setLocalFileContentSniffingEnabled(store.getBoolValueForKey(WebPreferencesKey::localFileContentSniffingEnabledKey()));
</span><span class="cx">     settings.setUsesPageCache(store.getBoolValueForKey(WebPreferencesKey::usesPageCacheKey()));
</span><ins>+    settings.setAllowsPageCacheWithWindowOpener(store.getBoolValueForKey(WebPreferencesKey::allowsPageCacheWithWindowOpenerKey()));
</ins><span class="cx">     settings.setPageCacheSupportsPlugins(store.getBoolValueForKey(WebPreferencesKey::pageCacheSupportsPluginsKey()));
</span><span class="cx">     settings.setAuthorAndUserStylesEnabled(store.getBoolValueForKey(WebPreferencesKey::authorAndUserStylesEnabledKey()));
</span><span class="cx">     settings.setPaginateDuringLayoutEnabled(store.getBoolValueForKey(WebPreferencesKey::paginateDuringLayoutEnabledKey()));
</span></span></pre></div>
<a id="branchessafari603branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/ChangeLog (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/ChangeLog        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Tools/ChangeLog        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2017-02-09  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
+        Merge r211254. rdar://problem/30188490
+
+    2017-01-26  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+            Crash when navigating back to a page in PacheCache when one of its frames has been removed
+            https://bugs.webkit.org/show_bug.cgi?id=167421
+            &lt;rdar://problem/30188490&gt;
+
+            Reviewed by Darin Adler.
+
+            Add a new setting allowing layout tests to enable PageCache in a window
+            that has an opener, for convenience.
+
+            * DumpRenderTree/mac/DumpRenderTree.mm:
+            (resetWebPreferencesToConsistentValues):
+            * DumpRenderTree/win/DumpRenderTree.cpp:
+            (resetWebPreferencesToConsistentValues):
+            * WebKitTestRunner/TestController.cpp:
+            (WTR::TestController::resetPreferencesToConsistentValues):
+
</ins><span class="cx"> 2017-02-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r211656. rdar://problem/30102568
</span></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreemacDumpRenderTreemm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -968,6 +968,7 @@
</span><span class="cx">     // The back/forward cache is causing problems due to layouts during transition from one page to another.
</span><span class="cx">     // So, turn it off for now, but we might want to turn it back on some day.
</span><span class="cx">     [preferences setUsesPageCache:NO];
</span><ins>+    [preferences setAllowsPageCacheWithWindowOpener:NO];
</ins><span class="cx">     [preferences setAcceleratedCompositingEnabled:YES];
</span><span class="cx"> #if USE(CA)
</span><span class="cx">     [preferences setCanvasUsesAcceleratedDrawing:YES];
</span></span></pre></div>
<a id="branchessafari603branchToolsDumpRenderTreewinDumpRenderTreecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/DumpRenderTree/win/DumpRenderTree.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -811,6 +811,7 @@
</span><span class="cx">     preferences-&gt;setPlugInsEnabled(TRUE);
</span><span class="cx">     preferences-&gt;setTextAreasAreResizable(TRUE);
</span><span class="cx">     preferences-&gt;setUsesPageCache(FALSE);
</span><ins>+    prefsPrivate-&gt;setAllowsPageCacheWithWindowOpener(FALSE);
</ins><span class="cx"> 
</span><span class="cx">     preferences-&gt;setPrivateBrowsingEnabled(FALSE);
</span><span class="cx">     prefsPrivate-&gt;setAuthorAndUserStylesEnabled(TRUE);
</span></span></pre></div>
<a id="branchessafari603branchToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/WebKitTestRunner/TestController.cpp (212044 => 212045)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/WebKitTestRunner/TestController.cpp        2017-02-10 06:35:37 UTC (rev 212044)
+++ branches/safari-603-branch/Tools/WebKitTestRunner/TestController.cpp        2017-02-10 06:35:52 UTC (rev 212045)
</span><span class="lines">@@ -655,6 +655,7 @@
</span><span class="cx">     WKPreferencesSetFullScreenEnabled(preferences, true);
</span><span class="cx"> #endif
</span><span class="cx">     WKPreferencesSetPageCacheEnabled(preferences, false);
</span><ins>+    WKPreferencesSetAllowsPageCacheWithWindowOpener(preferences, false);
</ins><span class="cx">     WKPreferencesSetAsynchronousPluginInitializationEnabled(preferences, false);
</span><span class="cx">     WKPreferencesSetAsynchronousPluginInitializationEnabledForAllPlugins(preferences, false);
</span><span class="cx">     WKPreferencesSetArtificialPluginInitializationDelayEnabled(preferences, false);
</span></span></pre>
</div>
</div>

</body>
</html>