<!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>[211254] trunk</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/211254">211254</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-01-26 21:36:19 -0800 (Thu, 26 Jan 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>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
<rdar://problem/30188490>
Reviewed by Darin Adler.
Source/WebCore:
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:
Source/WebKit/mac:
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:]):
Source/WebKit/win:
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:
Source/WebKit2:
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):
Tools:
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):
LayoutTests:
* 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.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestseditingmacinputunconfirmedtextnavigationwithpagecachehtml">trunk/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html</a></li>
<li><a href="#trunkLayoutTestsfastharnesspagecachecrashondataurlshtml">trunk/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html</a></li>
<li><a href="#trunkLayoutTestsfastharnessusepagecachehtml">trunk/LayoutTests/fast/harness/use-page-cache.html</a></li>
<li><a href="#trunkLayoutTestsfastloaderstateobjectsnopopstatewhenbacktostatelessentrywithpagecachehtml">trunk/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html</a></li>
<li><a href="#trunkLayoutTestsfastloaderstateobjectspopstatefireswithpagecachehtml">trunk/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html</a></li>
<li><a href="#trunkLayoutTeststileddrawingtileddrawingscrollpositionpagecacherestorationhtml">trunk/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCorehistoryPageCachecpp">trunk/Source/WebCore/history/PageCache.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDiagnosticLoggingKeyscpp">trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDiagnosticLoggingKeysh">trunk/Source/WebCore/page/DiagnosticLoggingKeys.h</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebCorepageSettingsin">trunk/Source/WebCore/page/Settings.in</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferenceKeysPrivateh">trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferencesmm">trunk/Source/WebKit/mac/WebView/WebPreferences.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferencesPrivateh">trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinInterfacesIWebPreferencesPrivateidl">trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl</a></li>
<li><a href="#trunkSourceWebKitwinWebPreferenceKeysPrivateh">trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h</a></li>
<li><a href="#trunkSourceWebKitwinWebPreferencescpp">trunk/Source/WebKit/win/WebPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebPreferencesh">trunk/Source/WebKit/win/WebPreferences.h</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPreferencesDefinitionsh">trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencescpp">trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh">trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreemacDumpRenderTreemm">trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreewinDumpRenderTreecpp">trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasthistorypagecacheafterwindowopenexpectedtxt">trunk/LayoutTests/fast/history/page-cache-after-window-open-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasthistorypagecacheafterwindowopenhtml">trunk/LayoutTests/fast/history/page-cache-after-window-open.html</a></li>
<li><a href="#trunkLayoutTestsfasthistorypagecachebacknavigationcrashexpectedtxt">trunk/LayoutTests/fast/history/page-cache-back-navigation-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasthistorypagecachebacknavigationcrashhtml">trunk/LayoutTests/fast/history/page-cache-back-navigation-crash.html</a></li>
<li><a href="#trunkLayoutTestsfasthistorypagecachewithopenerexpectedtxt">trunk/LayoutTests/fast/history/page-cache-with-opener-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasthistorypagecachewithopenerhtml">trunk/LayoutTests/fast/history/page-cache-with-opener.html</a></li>
<li><a href="#trunkLayoutTestsfasthistoryresourcespagecachewindowwithiframehtml">trunk/LayoutTests/fast/history/resources/page-cache-window-with-iframe.html</a></li>
<li><a href="#trunkLayoutTestsfasthistoryresourcespagecachewindowwithopenerhtml">trunk/LayoutTests/fast/history/resources/page-cache-window-with-opener.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/LayoutTests/ChangeLog        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2017-01-26 Chris Dumez <cdumez@apple.com>
+
+ 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
+ <rdar://problem/30188490>
+
+ 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.
+
</ins><span class="cx"> 2017-01-26 Youenn Fablet <youennf@gmail.com>
</span><span class="cx">
</span><span class="cx"> [WebRTC] Add a LibWebRTC mock for testing
</span></span></pre></div>
<a id="trunkLayoutTestseditingmacinputunconfirmedtextnavigationwithpagecachehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html        2017-01-27 05:36:19 UTC (rev 211254)
</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("WebKitUsesPageCachePreferenceKey", 1);
</span><ins>+ testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Window we will be controlling.
</span></span></pre></div>
<a id="trunkLayoutTestsfastharnesspagecachecrashondataurlshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html        2017-01-27 05:36:19 UTC (rev 211254)
</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("WebKitUsesPageCachePreferenceKey", 1);
</span><ins>+ testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
</ins><span class="cx"> }
</span><span class="cx"> log("open page with data urls");
</span><span class="cx"> window.open("resources/cached-page-with-data-urls.html");
</span></span></pre></div>
<a id="trunkLayoutTestsfastharnessusepagecachehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/harness/use-page-cache.html (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/harness/use-page-cache.html        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/LayoutTests/fast/harness/use-page-cache.html        2017-01-27 05:36:19 UTC (rev 211254)
</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("WebKitUsesPageCachePreferenceKey", 1);
</span><ins>+ testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
</ins><span class="cx"> }
</span><span class="cx"> log("open page-1");
</span><span class="cx"> window.open("resources/cached-page-1.html");
</span></span></pre></div>
<a id="trunkLayoutTestsfasthistorypagecacheafterwindowopenexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/history/page-cache-after-window-open-expected.txt (0 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/history/page-cache-after-window-open-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/history/page-cache-after-window-open-expected.txt        2017-01-27 05:36:19 UTC (rev 211254)
</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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+pageshow - not from cache
+PASS Page was not restored from page cache
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasthistorypagecacheafterwindowopenhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/history/page-cache-after-window-open.html (0 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/history/page-cache-after-window-open.html         (rev 0)
+++ trunk/LayoutTests/fast/history/page-cache-after-window-open.html        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+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("WebKitUsesPageCachePreferenceKey", 1);
+ testRunner.setCanOpenWindows();
+}
+
+window.addEventListener("pageshow", function(event) {
+ debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
+
+ 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("Page did enter and was restored from the page cache");
+ else
+ testPassed("Page was not restored from page cache");
+
+ finishJSTest();
+}, false);
+
+window.addEventListener("pagehide", function(event) {
+ debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache");
+ if (event.persisted) {
+ testFailed("Page entered the page cache.");
+ finishJSTest();
+ }
+}, false);
+
+window.addEventListener('load', function() {
+ newWindow = open("about:blank", "one");
+ 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 = "resources/page-cache-helper.html";
+ }, 0);
+}, false);
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfasthistorypagecachebacknavigationcrashexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/history/page-cache-back-navigation-crash-expected.txt (0 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/history/page-cache-back-navigation-crash-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/history/page-cache-back-navigation-crash-expected.txt        2017-01-27 05:36:19 UTC (rev 211254)
</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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasthistorypagecachebacknavigationcrashhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/history/page-cache-back-navigation-crash.html (0 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/history/page-cache-back-navigation-crash.html         (rev 0)
+++ trunk/LayoutTests/fast/history/page-cache-back-navigation-crash.html        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+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("WebKitUsesPageCachePreferenceKey", 1);
+ testRunner.setCanOpenWindows();
+}
+
+function removeFrameInChild()
+{
+ setTimeout(function() {
+ testFrame.remove();
+ }, 0);
+}
+
+window.addEventListener('load', function() {
+ newWindow = open("resources/page-cache-window-with-iframe.html", "one");
+ newWindow.onload = function () {
+ newWindow.onload = null;
+ otherWindowDocument = newWindow.document;
+ testFrame = otherWindowDocument.getElementsByTagName("iframe")[0];
+ }
+}, false);
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfasthistorypagecachewithopenerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/history/page-cache-with-opener-expected.txt (0 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/history/page-cache-with-opener-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/history/page-cache-with-opener-expected.txt        2017-01-27 05:36:19 UTC (rev 211254)
</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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Page was not restored from page cache
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasthistorypagecachewithopenerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/history/page-cache-with-opener.html (0 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/history/page-cache-with-opener.html         (rev 0)
+++ trunk/LayoutTests/fast/history/page-cache-with-opener.html        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+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("WebKitUsesPageCachePreferenceKey", 1);
+ testRunner.setCanOpenWindows();
+}
+
+window.addEventListener('load', function() {
+ newWindow = open("resources/page-cache-window-with-opener.html", "one");
+ otherWindowDocument = newWindow.document;
+}, false);
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfasthistoryresourcespagecachewindowwithiframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/history/resources/page-cache-window-with-iframe.html (0 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/history/resources/page-cache-window-with-iframe.html         (rev 0)
+++ trunk/LayoutTests/fast/history/resources/page-cache-window-with-iframe.html        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../../resources/js-test-pre.js"></script>
+<iframe src="about:blank"></iframe>
+<script>
+if (window.testRunner)
+ testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+
+window.addEventListener("pageshow", function(event) {
+ debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
+
+ 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("pagehide", function(event) {
+ debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache");
+}, 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 = "page-cache-helper.html";
+ }, 0);
+}, false);
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfasthistoryresourcespagecachewindowwithopenerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/history/resources/page-cache-window-with-opener.html (0 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/history/resources/page-cache-window-with-opener.html         (rev 0)
+++ trunk/LayoutTests/fast/history/resources/page-cache-window-with-opener.html        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../../resources/js-test-pre.js"></script>
+<script>
+if (window.testRunner)
+ testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+
+window.addEventListener("pageshow", function(event) {
+ debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
+
+ 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("Page did enter and was restored from the page cache");
+ else
+ window.opener.testPassed("Page was not restored from page cache");
+
+ window.opener.finishJSTest();
+}, false);
+
+window.addEventListener("pagehide", function(event) {
+ debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache");
+ if (event.persisted) {
+ window.opener.testFailed("Page entered the page cache.");
+ 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 = "page-cache-helper.html";
+ }, 0);
+}, false);
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastloaderstateobjectsnopopstatewhenbacktostatelessentrywithpagecachehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html        2017-01-27 05:36:19 UTC (rev 211254)
</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("WebKitAllowsPageCacheWithWindowOpenerKey", 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"> </script>
</span><span class="cx"> <script src="../../../resources/js-test-post.js"></script>
</span><del>-</html>
</del><span class="cx">\ No newline at end of file
</span><ins>+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastloaderstateobjectspopstatefireswithpagecachehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html        2017-01-27 05:36:19 UTC (rev 211254)
</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("WebKitAllowsPageCacheWithWindowOpenerKey", 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="trunkLayoutTeststileddrawingtileddrawingscrollpositionpagecacherestorationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html        2017-01-27 05:36:19 UTC (rev 211254)
</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("WebKitUsesPageCachePreferenceKey", 1);
</span><ins>+ testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> window.finishedTest = function (layerTree)
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebCore/ChangeLog        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -1,3 +1,47 @@
</span><ins>+2017-01-26 Chris Dumez <cdumez@apple.com>
+
+ 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
+ <rdar://problem/30188490>
+
+ 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-01-26 Youenn Fablet <youennf@gmail.com>
</span><span class="cx">
</span><span class="cx"> [WebRTC] Add a LibWebRTC mock for testing
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebCore/dom/Document.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -835,6 +835,23 @@
</span><span class="cx"> return documentElement() && documentElement()->hasTagName(htmlTag) && documentElement()->hasAttributeWithoutSynchronization(manifestAttr);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+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();
+}
+
</ins><span class="cx"> DocumentType* Document::doctype() const
</span><span class="cx"> {
</span><span class="cx"> for (Node* node = firstChild(); node; node = node->nextSibling()) {
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebCore/dom/Document.h        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -367,6 +367,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<Ref<Element>> createElementForBindings(const AtomicString& tagName);
</span><span class="cx"> WEBCORE_EXPORT Ref<DocumentFragment> createDocumentFragment();
</span><span class="lines">@@ -1469,6 +1472,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="trunkSourceWebCorehistoryPageCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/PageCache.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/PageCache.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebCore/history/PageCache.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -191,6 +191,19 @@
</span><span class="cx">
</span><span class="cx"> DiagnosticLoggingClient& diagnosticLoggingClient = page.diagnosticLoggingClient();
</span><span class="cx"> bool isCacheable = canCacheFrame(page.mainFrame(), diagnosticLoggingClient, indentLevel + 1);
</span><ins>+
+ 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;
+ }
</ins><span class="cx">
</span><span class="cx"> if (!page.settings().usesPageCache() || page.isResourceCachingDisabled()) {
</span><span class="cx"> PCLOG(" -Page settings says b/f cache disabled");
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -2195,6 +2195,8 @@
</span><span class="cx">
</span><span class="cx"> newFrame->loader().setOpener(&openerFrame);
</span><span class="cx"> newFrame->page()->setOpenedByDOM();
</span><ins>+ if (auto* openerDocument = openerFrame.document())
+ openerDocument->markHasCalledWindowOpen();
</ins><span class="cx">
</span><span class="cx"> if (newFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL))
</span><span class="cx"> return newFrame;
</span></span></pre></div>
<a id="trunkSourceWebCorepageDiagnosticLoggingKeyscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -663,6 +663,16 @@
</span><span class="cx"> return ASCIILiteral("font");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+String DiagnosticLoggingKeys::hasCalledWindowOpenKey()
+{
+ return ASCIILiteral("hasCalledWindowOpen");
+}
+
+String DiagnosticLoggingKeys::hasOpenerKey()
+{
+ return ASCIILiteral("hasOpener");
+}
+
</ins><span class="cx"> String DiagnosticLoggingKeys::prunedDueToMemoryPressureKey()
</span><span class="cx"> {
</span><span class="cx"> return ASCIILiteral("pruned.memoryPressure");
</span></span></pre></div>
<a id="trunkSourceWebCorepageDiagnosticLoggingKeysh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.h (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.h        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.h        2017-01-27 05:36:19 UTC (rev 211254)
</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="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebCore/page/Page.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -467,6 +467,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->document();
+ if (!document)
+ return false;
+ auto* window = document->domWindow();
+ if (!window)
+ return false;
+ return window->opener();
+}
+
</ins><span class="cx"> void Page::goToItem(HistoryItem& 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="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebCore/page/Page.h        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -179,6 +179,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&, FrameLoadType);
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void setGroupName(const String&);
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.in (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.in        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebCore/page/Settings.in        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -285,3 +285,5 @@
</span><span class="cx"> shouldSuppressKeyboardInputDuringProvisionalNavigation initial=false
</span><span class="cx">
</span><span class="cx"> langAttributeAwareFormControlUIEnabled initial=false
</span><ins>+
+allowsPageCacheWithWindowOpener initial=false
</ins></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit/mac/ChangeLog        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2017-01-26 Chris Dumez <cdumez@apple.com>
+
+ 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
+ <rdar://problem/30188490>
+
+ 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-01-26 Keith Miller <keith_miller@apple.com>
</span><span class="cx">
</span><span class="cx"> classInfo should take a VM so it is not materialized from the object on each call
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebPreferenceKeysPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx"> #define WebAutomaticSpellingCorrectionEnabled @"WebAutomaticSpellingCorrectionEnabled"
</span><span class="cx"> #define WebKitDOMPasteAllowedPreferenceKey @"WebKitDOMPasteAllowedPreferenceKey"
</span><span class="cx"> #define WebKitUsesPageCachePreferenceKey @"WebKitUsesPageCachePreferenceKey"
</span><ins>+#define WebKitAllowsPageCacheWithWindowOpenerKey @"WebKitAllowsPageCacheWithWindowOpenerKey"
</ins><span class="cx"> #define WebKitPageCacheSupportsPluginsPreferenceKey @"WebKitPageCacheSupportsPluginsPreferenceKey"
</span><span class="cx"> #define WebKitFTPDirectoryTemplatePath @"WebKitFTPDirectoryTemplatePath"
</span><span class="cx"> #define WebKitForceFTPDirectoryListings @"WebKitForceFTPDirectoryListings"
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebPreferencesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm        2017-01-27 05:36:19 UTC (rev 211254)
</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">@@ -2445,6 +2446,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="trunkSourceWebKitmacWebViewWebPreferencesPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -298,6 +298,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="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -2670,6 +2670,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="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit/win/ChangeLog        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2017-01-26 Chris Dumez <cdumez@apple.com>
+
+ 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
+ <rdar://problem/30188490>
+
+ 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-01-26 Keith Miller <keith_miller@apple.com>
</span><span class="cx">
</span><span class="cx"> classInfo should take a VM so it is not materialized from the object on each call
</span></span></pre></div>
<a id="trunkSourceWebKitwinInterfacesIWebPreferencesPrivateidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl        2017-01-27 05:36:19 UTC (rev 211254)
</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="trunkSourceWebKitwinWebPreferenceKeysPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx"> #define WebKitIconDatabaseLocationKey "WebKitIconDatabaseLocation"
</span><span class="cx"> #define WebKitIconDatabaseEnabledPreferenceKey "WebKitIconDatabaseEnabled"
</span><span class="cx"> #define WebKitUsesPageCachePreferenceKey "WebKitUsesPageCachePreferenceKey"
</span><ins>+#define WebKitAllowsPageCacheWithWindowOpenerKey "WebKitAllowsPageCacheWithWindowOpenerKey"
</ins><span class="cx"> #define WebKitCacheModelPreferenceKey "WebKitCacheModelPreferenceKey"
</span><span class="cx"> #define WebKitLocalStorageDatabasePathPreferenceKey "WebKitLocalStorageDatabasePath"
</span><span class="cx"> #define WebKitHyperlinkAuditingEnabledPreferenceKey "WebKitHyperlinkAuditingEnabled"
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebPreferences.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebPreferences.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit/win/WebPreferences.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</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(""));
</span><span class="cx">
</span><span class="cx"> RetainPtr<CFStringRef> cacheModelRef = adoptCF(CFStringCreateWithFormat(0, 0, CFSTR("%d"), WebCacheModelDocumentViewer));
</span><span class="lines">@@ -1606,6 +1607,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="trunkSourceWebKitwinWebPreferencesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebPreferences.h (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebPreferences.h        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit/win/WebPreferences.h        2017-01-27 05:36:19 UTC (rev 211254)
</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="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit/win/WebView.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -5404,6 +5404,11 @@
</span><span class="cx"> return hr;
</span><span class="cx"> settings.setExperimentalNotificationsEnabled(enabled);
</span><span class="cx">
</span><ins>+ hr = prefsPrivate->allowsPageCacheWithWindowOpener(&enabled);
+ if (FAILED(hr))
+ return hr;
+ settings.setAllowsPageCacheWithWindowOpener(enabled);
+
</ins><span class="cx"> hr = prefsPrivate->isWebSecurityEnabled(&enabled);
</span><span class="cx"> if (FAILED(hr))
</span><span class="cx"> return hr;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit2/ChangeLog        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2017-01-26 Chris Dumez <cdumez@apple.com>
+
+ 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
+ <rdar://problem/30188490>
+
+ 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-01-26 Keith Miller <keith_miller@apple.com>
</span><span class="cx">
</span><span class="cx"> classInfo should take a VM so it is not materialized from the object on each call
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPreferencesDefinitionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -137,6 +137,7 @@
</span><span class="cx"> macro(WebArchiveDebugModeEnabled, webArchiveDebugModeEnabled, Bool, bool, false, "", "") \
</span><span class="cx"> macro(LocalFileContentSniffingEnabled, localFileContentSniffingEnabled, Bool, bool, false, "", "") \
</span><span class="cx"> macro(UsesPageCache, usesPageCache, Bool, bool, true, "", "") \
</span><ins>+ macro(AllowsPageCacheWithWindowOpener, allowsPageCacheWithWindowOpener, Bool, bool, false, "", "") \
</ins><span class="cx"> macro(PageCacheSupportsPlugins, pageCacheSupportsPlugins, Bool, bool, true, "", "") \
</span><span class="cx"> macro(AuthorAndUserStylesEnabled, authorAndUserStylesEnabled, Bool, bool, true, "", "") \
</span><span class="cx"> macro(PaginateDuringLayoutEnabled, paginateDuringLayoutEnabled, Bool, bool, false, "", "") \
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -623,6 +623,16 @@
</span><span class="cx"> return toImpl(preferencesRef)->usesPageCache();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WKPreferencesSetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setAllowsPageCacheWithWindowOpener(enabled);
+}
+
+bool WKPreferencesGetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->allowsPageCacheWithWindowOpener();
+}
+
</ins><span class="cx"> void WKPreferencesSetPageCacheSupportsPlugins(WKPreferencesRef preferencesRef, bool pageCacheSupportsPlugins)
</span><span class="cx"> {
</span><span class="cx"> toImpl(preferencesRef)->setPageCacheSupportsPlugins(pageCacheSupportsPlugins);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2017-01-27 05:36:19 UTC (rev 211254)
</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="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</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="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -2995,6 +2995,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="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Tools/ChangeLog        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2017-01-26 Chris Dumez <cdumez@apple.com>
+
+ 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
+ <rdar://problem/30188490>
+
+ 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-01-26 Keith Miller <keith_miller@apple.com>
</span><span class="cx">
</span><span class="cx"> classInfo should take a VM so it is not materialized from the object on each call
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacDumpRenderTreemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -980,6 +980,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="trunkToolsDumpRenderTreewinDumpRenderTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</span><span class="lines">@@ -834,6 +834,7 @@
</span><span class="cx"> preferences->setPlugInsEnabled(TRUE);
</span><span class="cx"> preferences->setTextAreasAreResizable(TRUE);
</span><span class="cx"> preferences->setUsesPageCache(FALSE);
</span><ins>+ prefsPrivate->setAllowsPageCacheWithWindowOpener(FALSE);
</ins><span class="cx">
</span><span class="cx"> preferences->setPrivateBrowsingEnabled(FALSE);
</span><span class="cx"> prefsPrivate->setAuthorAndUserStylesEnabled(TRUE);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (211253 => 211254)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2017-01-27 04:54:09 UTC (rev 211253)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2017-01-27 05:36:19 UTC (rev 211254)
</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>