<!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>[190954] releases/WebKitGTK/webkit-2.10</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/190954">190954</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-13 03:41:01 -0700 (Tue, 13 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/190505">r190505</a> - popstate is fired at the wrong time on load
https://bugs.webkit.org/show_bug.cgi?id=94265
Patch by Antoine Quint <graouts@apple.com> on 2015-10-02
Reviewed by Darin Adler.
Source/WebCore:
Don't fire popstate event on initial document load
According to the specification [1], a popstate event should only be fired
when the document has a "last entry" and the entry being navigated to isn't
it. A document is created without a "last entry" and gets one just after
this check when it is first navigated to, so a popstate should be fired any
time a document is navigated to except for the first time after it has been
created.
Patch adapted from work by jl@opera.com on Blink [2].
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#traverse-the-history (step 12-14 in particular)
[2] https://src.chromium.org/viewvc/blink?revision=165221&view=revision
* dom/Document.cpp:
(WebCore::Document::implicitClose):
Source/WebKit2:
Ensure we have a valid page before trying to get to its drawingArea as this could lead
to a crash as observed with fast/loader/stateobjects/pushstate-object-types.html.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::restoreViewState):
LayoutTests:
Updating tests that relied on a "popstate" event being fired at page load.
* fast/history/same-document-iframes-changing-fragment-expected.txt:
* fast/history/same-document-iframes-changing-pushstate-expected.txt:
* fast/loader/javascript-url-iframe-remove-on-navigate.html:
* fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html:
* fast/loader/stateobjects/document-destroyed-navigate-back.html:
* fast/loader/stateobjects/popstate-after-load-complete-addeventlistener.html:
* fast/loader/stateobjects/popstate-after-load-complete-body-attribute.html:
* fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html:
* fast/loader/stateobjects/popstate-after-load-complete-window-attribute.html:
* fast/loader/stateobjects/popstate-fires-on-history-traversal-expected.txt:
* fast/loader/stateobjects/popstate-fires-on-history-traversal.html:
* fast/loader/stateobjects/popstate-fires-with-page-cache-expected.txt:
* fast/loader/stateobjects/popstate-fires-with-page-cache.html:
* fast/loader/stateobjects/pushstate-object-types.html:
* fast/loader/stateobjects/pushstate-then-replacestate.html:
* fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html:
* fast/loader/stateobjects/replacestate-then-pushstate.html:
* fast/loader/stateobjects/resources/popstate-fires-with-page-cache-1.html:
* fast/loader/stateobjects/resources/popstate-fires-with-page-cache-2.html:
* fast/loader/stateobjects/resources/replacestate-in-iframe-window-child.html:
* http/tests/history/popstate-fires-with-pending-requests.html:
* http/tests/navigation/redirect-on-back-updates-history-item-expected.txt:
* http/tests/navigation/redirect-on-reload-updates-history-item-expected.txt:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfasthistorysamedocumentiframeschangingfragmentexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/history/same-document-iframes-changing-fragment-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfasthistorysamedocumentiframeschangingpushstateexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/history/same-document-iframes-changing-pushstate-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderjavascripturliframeremoveonnavigatehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/javascript-url-iframe-remove-on-navigate.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsdocumentdestroyednavigatebackwithfragmentscrollhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsdocumentdestroyednavigatebackhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstateafterloadcompleteaddeventlistenerhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-addeventlistener.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstateafterloadcompletebodyattributehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-attribute.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstateafterloadcompletebodyinlineattributehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstateafterloadcompletewindowattributehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-window-attribute.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstatefiresonhistorytraversalexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstatefiresonhistorytraversalhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstatefireswithpagecacheexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstatefireswithpagecachehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspushstateobjecttypeshtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-object-types.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspushstatethenreplacestatehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-then-replacestate.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspushstatewithfragmenturlsandhashchangehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsreplacestatethenpushstatehtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/replacestate-then-pushstate.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsresourcespopstatefireswithpagecache1html">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/popstate-fires-with-page-cache-1.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsresourcespopstatefireswithpagecache2html">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/popstate-fires-with-page-cache-2.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsresourcesreplacestateiniframewindowchildhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/replacestate-in-iframe-window-child.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestshistorypopstatefireswithpendingrequestshtml">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/history/popstate-fires-with-pending-requests.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestsnavigationredirectonbackupdateshistoryitemexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/navigation/redirect-on-back-updates-history-item-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestsnavigationredirectonreloadupdateshistoryitemexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/navigation/redirect-on-reload-updates-history-item-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCoredomDocumentcpp">releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebKit2ChangeLog">releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit210LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2015-10-02 Antoine Quint <graouts@apple.com>
+
+ popstate is fired at the wrong time on load
+ https://bugs.webkit.org/show_bug.cgi?id=94265
+
+ Reviewed by Darin Adler.
+
+ Updating tests that relied on a "popstate" event being fired at page load.
+
+ * fast/history/same-document-iframes-changing-fragment-expected.txt:
+ * fast/history/same-document-iframes-changing-pushstate-expected.txt:
+ * fast/loader/javascript-url-iframe-remove-on-navigate.html:
+ * fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html:
+ * fast/loader/stateobjects/document-destroyed-navigate-back.html:
+ * fast/loader/stateobjects/popstate-after-load-complete-addeventlistener.html:
+ * fast/loader/stateobjects/popstate-after-load-complete-body-attribute.html:
+ * fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html:
+ * fast/loader/stateobjects/popstate-after-load-complete-window-attribute.html:
+ * fast/loader/stateobjects/popstate-fires-on-history-traversal-expected.txt:
+ * fast/loader/stateobjects/popstate-fires-on-history-traversal.html:
+ * fast/loader/stateobjects/popstate-fires-with-page-cache-expected.txt:
+ * fast/loader/stateobjects/popstate-fires-with-page-cache.html:
+ * fast/loader/stateobjects/pushstate-object-types.html:
+ * fast/loader/stateobjects/pushstate-then-replacestate.html:
+ * fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html:
+ * fast/loader/stateobjects/replacestate-then-pushstate.html:
+ * fast/loader/stateobjects/resources/popstate-fires-with-page-cache-1.html:
+ * fast/loader/stateobjects/resources/popstate-fires-with-page-cache-2.html:
+ * fast/loader/stateobjects/resources/replacestate-in-iframe-window-child.html:
+ * http/tests/history/popstate-fires-with-pending-requests.html:
+ * http/tests/navigation/redirect-on-back-updates-history-item-expected.txt:
+ * http/tests/navigation/redirect-on-reload-updates-history-item-expected.txt:
+
</ins><span class="cx"> 2015-10-01 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> Network cache: Subresource referer header wrong after cached redirect
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfasthistorysamedocumentiframeschangingfragmentexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/history/same-document-iframes-changing-fragment-expected.txt (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/history/same-document-iframes-changing-fragment-expected.txt        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/history/same-document-iframes-changing-fragment-expected.txt        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -3,7 +3,6 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-popstate to state: null filename: same-document-iframes-changing-fragment.html
</del><span class="cx"> removing iframe2
</span><span class="cx"> navigating to #newState
</span><span class="cx"> popstate to state: null filename: same-document-iframes-changing-fragment.html#newState
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfasthistorysamedocumentiframeschangingpushstateexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/history/same-document-iframes-changing-pushstate-expected.txt (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/history/same-document-iframes-changing-pushstate-expected.txt        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/history/same-document-iframes-changing-pushstate-expected.txt        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -3,7 +3,6 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx">
</span><del>-popstate to state: null filename: same-document-iframes-changing-pushstate.html
</del><span class="cx"> removing iframe2
</span><span class="cx"> pushState to newState
</span><span class="cx"> going back
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderjavascripturliframeremoveonnavigatehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/javascript-url-iframe-remove-on-navigate.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/javascript-url-iframe-remove-on-navigate.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/javascript-url-iframe-remove-on-navigate.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx"> document.getElementById("target").src = "javascript:alert('FAIL')";
</span><span class="cx"> }, 0);
</span><span class="cx">
</span><del>-window.addEventListener("popstate", function() {
</del><ins>+window.addEventListener("load", function() {
</ins><span class="cx"> document.write("PASS - Javascript URL blocked without crashing.");
</span><span class="cx"> if (window.testRunner)
</span><span class="cx"> testRunner.notifyDone();
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsdocumentdestroyednavigatebackwithfragmentscrollhtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -48,20 +48,8 @@
</span><span class="cx"> runThirdStageOfTest();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-var beganTest = false;
-
</del><span class="cx"> onpopstate = function()
</span><span class="cx"> {
</span><del>- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- // Continue with the handler if we've already began the test.
- if (!sessionStorage.stage)
- return;
- }
-
</del><span class="cx"> alert("State popped - " + event.state + " (type " + typeof event.state + ")");
</span><span class="cx">
</span><span class="cx"> // FIXME: Once the popstate and hashchange events fire asynchronously, we
</span><span class="lines">@@ -96,7 +84,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> </script>
</span><del>-<body onunload="/* disable page cache */">
</del><ins>+<body onload="runTest();" onunload="/* disable page cache */">
</ins><span class="cx"> <pre>
</span><span class="cx"> This test:
</span><span class="cx"> -Builds up a list of state object entries with fragment URLs.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsdocumentdestroyednavigatebackhtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -42,20 +42,8 @@
</span><span class="cx"> runThirdStageOfTest();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-var beganTest = false;
-
</del><span class="cx"> function statePopped()
</span><span class="cx"> {
</span><del>- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- // Continue with the handler if we've already began the test.
- if (!sessionStorage.stage)
- return;
- }
-
</del><span class="cx"> alert("State popped - " + event.state + " (type " + typeof event.state + ")");
</span><span class="cx"> if (event.state == "FirstEntry") {
</span><span class="cx"> history.replaceState("FirstEntryWillLaterBeReactivated", null, "?FirstEntryWillLaterBeReactivated");
</span><span class="lines">@@ -74,7 +62,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> </script>
</span><del>-<body onpopstate="statePopped();" onunload="/* disable page cache */">
</del><ins>+<body onload="runTest();" onpopstate="statePopped();" onunload="/* disable page cache */">
</ins><span class="cx"> <pre>
</span><span class="cx"> This test:
</span><span class="cx"> -Builds up a list of state object entries with fragment URLs.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstateafterloadcompleteaddeventlistenerhtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-addeventlistener.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-addeventlistener.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-addeventlistener.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -20,18 +20,8 @@
</span><span class="cx"> history.back();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-var beganTest = false;
-
</del><span class="cx"> function statePopped()
</span><span class="cx"> {
</span><del>- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- return;
- }
-
</del><span class="cx"> log("State popped - " + event.state + " (type " + typeof event.state + ")");
</span><span class="cx"> if (event.state == null)
</span><span class="cx"> history.forward();
</span><span class="lines">@@ -42,7 +32,7 @@
</span><span class="cx"> window.addEventListener("popstate", statePopped);
</span><span class="cx">
</span><span class="cx"> </script>
</span><del>-<body>
</del><ins>+<body onload="runTest();">
</ins><span class="cx"> <pre>
</span><span class="cx"> This test does the following:
</span><span class="cx"> -Listens for the popstate event using addEventListener
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstateafterloadcompletebodyattributehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-attribute.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-attribute.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-attribute.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -20,18 +20,8 @@
</span><span class="cx"> history.back();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-var beganTest = false;
-
</del><span class="cx"> function statePopped()
</span><span class="cx"> {
</span><del>- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- return;
- }
-
</del><span class="cx"> log("State popped - " + event.state + " (type " + typeof event.state + ")");
</span><span class="cx"> if (event.state == null) {
</span><span class="cx"> document.body.onpopstate = statePopped;
</span><span class="lines">@@ -41,7 +31,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> </script>
</span><del>-<body>
</del><ins>+<body onload="runTest();">
</ins><span class="cx"> <pre>
</span><span class="cx"> This test does the following:
</span><span class="cx"> -Uses body.onpopstate to add a popstate handler (both by using the inline attribute and a script-assigned attribute)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstateafterloadcompletebodyinlineattributehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-body-inline-attribute.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -20,18 +20,8 @@
</span><span class="cx"> history.back();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-var beganTest = false;
-
</del><span class="cx"> function statePopped()
</span><span class="cx"> {
</span><del>- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- return;
- }
-
</del><span class="cx"> log("State popped - " + event.state + " (type " + typeof event.state + ")");
</span><span class="cx"> if (event.state == null) {
</span><span class="cx"> document.body.onpopstate = statePopped;
</span><span class="lines">@@ -41,7 +31,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> </script>
</span><del>-<body onpopstate="statePopped();">
</del><ins>+<body onload="runTest();" onpopstate="statePopped();">
</ins><span class="cx"> <pre>
</span><span class="cx"> This test does the following:
</span><span class="cx"> -Uses body.onpopstate to add a popstate handler (both by using the inline attribute and a script-assigned attribute)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstateafterloadcompletewindowattributehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-window-attribute.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-window-attribute.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-after-load-complete-window-attribute.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -20,18 +20,8 @@
</span><span class="cx"> history.back();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-var beganTest = false;
-
</del><span class="cx"> function statePopped()
</span><span class="cx"> {
</span><del>- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- return;
- }
-
</del><span class="cx"> log("State popped - " + event.state + " (type " + typeof event.state + ")");
</span><span class="cx"> if (event.state == null)
</span><span class="cx"> history.forward();
</span><span class="lines">@@ -42,7 +32,7 @@
</span><span class="cx"> window.onpopstate = statePopped;
</span><span class="cx">
</span><span class="cx"> </script>
</span><del>-<body>
</del><ins>+<body onload="runTest();">
</ins><span class="cx"> <pre>
</span><span class="cx"> This test does the following:
</span><span class="cx"> -Uses window.onpopstate to add a popstate handler
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstatefiresonhistorytraversalexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal-expected.txt (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal-expected.txt        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal-expected.txt        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -2,7 +2,6 @@
</span><span class="cx">
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><del>-popstate fired with state null
</del><span class="cx"> setting hash to #state1
</span><span class="cx"> popstate fired with state null
</span><span class="cx"> setting hash to #state2
</span><span class="lines">@@ -11,7 +10,7 @@
</span><span class="cx"> popstate fired with state null
</span><span class="cx"> going back
</span><span class="cx"> popstate fired with state null
</span><del>-PASS popstateFireCount is 5
</del><ins>+PASS popstateFireCount is 4
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstatefiresonhistorytraversalhtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> // 3. Navigating to #state2
</span><span class="cx"> // 4. Going back to #state1
</span><span class="cx"> // 5. Going back to the initial page state
</span><del>- shouldBe('popstateFireCount', '5');
</del><ins>+ shouldBe('popstateFireCount', '4');
</ins><span class="cx"> finishJSTest();
</span><span class="cx"> return;
</span><span class="cx"> default:
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstatefireswithpagecacheexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache-expected.txt (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache-expected.txt        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache-expected.txt        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -2,10 +2,10 @@
</span><span class="cx">
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><del>-popstate fired with state null
</del><ins>+load fired
</ins><span class="cx"> pushState with new state object for page 1
</span><span class="cx"> going to page 2
</span><del>-popstate fired with state null
</del><ins>+load fired
</ins><span class="cx"> going back to page 1 with new state object
</span><span class="cx"> popstate fired with state newState
</span><span class="cx"> going back to page 1 in initial state
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspopstatefireswithpagecachehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -20,8 +20,32 @@
</span><span class="cx"> testFailed('Could not open test window');
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+var testWindowLoadFireCount = 0;
</ins><span class="cx"> var testWindowPopstateFireCount = 0;
</span><span class="cx">
</span><ins>+function onTestWindowLoad(event)
+{
+ debug('load fired');
+ testWindowLoadFireCount++;
+
+ switch (testWindowLoadFireCount) {
+ case 1:
+ debug('pushState with new state object for page 1');
+ testWindow.history.pushState('newState');
+ debug('going to page 2');
+ // Set the location in a timeout to generate a history entry
+ setTimeout(function() {testWindow.location.href = 'resources/popstate-fires-with-page-cache-2.html';}, 0);
+ break;
+ case 2:
+ debug('going back to page 1 with new state object');
+ setTimeout(function() {testWindow.history.back();}, 0);
+ break;
+ default:
+ testFailed('unexpected load event state');
+ break;
+ }
+}
+
</ins><span class="cx"> function onTestWindowPopState(event)
</span><span class="cx"> {
</span><span class="cx"> debug('popstate fired with state ' + event.state);
</span><span class="lines">@@ -29,21 +53,10 @@
</span><span class="cx">
</span><span class="cx"> switch (testWindowPopstateFireCount) {
</span><span class="cx"> case 1:
</span><del>- debug('pushState with new state object for page 1');
- testWindow.history.pushState('newState');
- debug('going to page 2');
- // Set the location in a timeout to generate a history entry
- setTimeout(function() {testWindow.location.href = 'resources/popstate-fires-with-page-cache-2.html';}, 0);
- break;
- case 2:
- debug('going back to page 1 with new state object');
- setTimeout(function() {testWindow.history.back();}, 0);
- break;
- case 3:
</del><span class="cx"> debug('going back to page 1 in initial state');
</span><span class="cx"> setTimeout(function() {testWindow.history.back();}, 0);
</span><span class="cx"> break;
</span><del>- case 4:
</del><ins>+ case 2:
</ins><span class="cx"> // Close the window in a timeout to simulate popstate firing asynchronously, otherwise closing the window in a popstate handler results in a crash.
</span><span class="cx"> // FIXME: remove this when http://webkit.org/b/36202 is fixed.
</span><span class="cx"> setTimeout(function() {
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspushstateobjecttypeshtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-object-types.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-object-types.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-object-types.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -39,18 +39,8 @@
</span><span class="cx"> history.back();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-var beganTest = false;
-
</del><span class="cx"> onpopstate = function(event)
</span><span class="cx"> {
</span><del>- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- return;
- }
-
</del><span class="cx"> if (event.state instanceof Date)
</span><span class="cx"> log("State popped - " + event.state.getTime() + " (type " + typeof event.state + ")");
</span><span class="cx"> else
</span><span class="lines">@@ -64,7 +54,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> </script>
</span><del>-<body>
</del><ins>+<body onload="runTest();">
</ins><span class="cx"> <p>
</span><span class="cx"> This test calls pushState with state objects of all the different object types supported by the HTML5 "internal structured cloning algorithm" and makes sure the events contain the expected objects when the states are popped.
</span><span class="cx"> </p>
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspushstatethenreplacestatehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-then-replacestate.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-then-replacestate.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-then-replacestate.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -22,18 +22,8 @@
</span><span class="cx"> history.back();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-var beganTest = false;
-
</del><span class="cx"> onpopstate = function(event)
</span><span class="cx"> {
</span><del>- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- return;
- }
-
</del><span class="cx"> log("State popped - " + event.state + " (type " + typeof event.state + ")");
</span><span class="cx"> if (event.state == null)
</span><span class="cx"> history.forward();
</span><span class="lines">@@ -42,7 +32,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> </script>
</span><del>-<body>
</del><ins>+<body onload="runTest();">
</ins><span class="cx"> <pre>
</span><span class="cx"> This test does the following:
</span><span class="cx"> -Makes a call to pushState()
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectspushstatewithfragmenturlsandhashchangehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -44,18 +44,8 @@
</span><span class="cx"> return url.split('/').pop();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-var beganTest = false;
-
</del><span class="cx"> onpopstate = function(event)
</span><span class="cx"> {
</span><del>- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- return;
- }
-
</del><span class="cx"> log("State popped with event " + event.state + " (type " + typeof event.state + ") and last path component " + lastPathComponent(location.href));
</span><span class="cx"> if (event.state != "OriginalEntry")
</span><span class="cx"> setTimeout("history.back();", 0);
</span><span class="lines">@@ -69,7 +59,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> </script>
</span><del>-<body>
</del><ins>+<body onload="runTest();">
</ins><span class="cx"> <pre>
</span><span class="cx"> This test pushes a series of state objects with different URLs and fragment identifiers meant to test the hashChange event as states are popped.
</span><span class="cx"> </pre><br>
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsreplacestatethenpushstatehtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/replacestate-then-pushstate.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/replacestate-then-pushstate.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/replacestate-then-pushstate.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -22,18 +22,8 @@
</span><span class="cx"> history.back();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-var beganTest = false;
-
</del><span class="cx"> onpopstate = function(event)
</span><span class="cx"> {
</span><del>- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- return;
- }
-
</del><span class="cx"> log("State popped - " + event.state + " (type " + typeof event.state + ")");
</span><span class="cx"> if (event.state == "OriginalHistoryItem")
</span><span class="cx"> history.forward();
</span><span class="lines">@@ -42,7 +32,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> </script>
</span><del>-<body>
</del><ins>+<body onload="runTest();">
</ins><span class="cx"> <pre>
</span><span class="cx"> This test does the following:
</span><span class="cx"> -Makes a call to replaceState()
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsresourcespopstatefireswithpagecache1html"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/popstate-fires-with-page-cache-1.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/popstate-fires-with-page-cache-1.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/popstate-fires-with-page-cache-1.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -1 +1 @@
</span><del>-<body onpopstate="opener.onTestWindowPopState(event)">page 1</body>
</del><span class="cx">\ No newline at end of file
</span><ins>+<body onload="opener.onTestWindowLoad(event)" onpopstate="opener.onTestWindowPopState(event)">page 1</body>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsresourcespopstatefireswithpagecache2html"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/popstate-fires-with-page-cache-2.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/popstate-fires-with-page-cache-2.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/popstate-fires-with-page-cache-2.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -1 +1 @@
</span><del>-<body onpopstate="opener.onTestWindowPopState(event)">page 2</body>
</del><span class="cx">\ No newline at end of file
</span><ins>+<body onload="opener.onTestWindowLoad(event)" onpopstate="opener.onTestWindowPopState(event)">page 2</body>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastloaderstateobjectsresourcesreplacestateiniframewindowchildhtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/replacestate-in-iframe-window-child.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/replacestate-in-iframe-window-child.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/loader/stateobjects/resources/replacestate-in-iframe-window-child.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -1,15 +1,16 @@
</span><span class="cx"> <script>
</span><del>-onunload = function() {
</del><ins>+window.onload = function() {
+ if (!sessionStorage.beganTest) {
+ sessionStorage.beganTest = true;
+ top.opener.windowLoaded();
+ }
+}
+
+window.onunload = function() {
</ins><span class="cx"> // No page cache
</span><span class="cx"> }
</span><span class="cx">
</span><del>-onpopstate = function(e) {
- if (!sessionStorage.beganTest) {
- sessionStorage.beganTest = true;
- top.opener.windowLoaded();
- return;
- }
-
</del><ins>+window.onpopstate = function(e) {
</ins><span class="cx"> alert("onpopstate");
</span><span class="cx"> top.opener.notifyDone(window == parent ? "FAIL" : "PASS");
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestshistorypopstatefireswithpendingrequestshtml"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/history/popstate-fires-with-pending-requests.html (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/history/popstate-fires-with-pending-requests.html        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/history/popstate-fires-with-pending-requests.html        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -10,17 +10,8 @@
</span><span class="cx"> <script>
</span><span class="cx"> description('Tests that popstate events fire when going back, even when there are resource requests pending.');
</span><span class="cx">
</span><del>-onpopstate = function(event)
</del><ins>+window.onload = function(event)
</ins><span class="cx"> {
</span><del>- if (event.state) {
- shouldBe('event.state', '"newState1"');
- // Stop the pending image request, otherwise the DRT doesn't consider the
- // test over.
- window.stop();
- finishJSTest();
- return;
- }
-
</del><span class="cx"> debug('Starting slow image request');
</span><span class="cx">
</span><span class="cx"> var slowImage = document.createElement('img');
</span><span class="lines">@@ -43,6 +34,13 @@
</span><span class="cx"> }, 0);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+window.onpopstate = function(event) {
+ shouldBe('event.state', '"newState1"');
+ // Stop the pending image request, otherwise the DRT doesn't consider the
+ // test over.
+ window.stop();
+ finishJSTest();
+}
</ins><span class="cx">
</span><span class="cx"> var jsTestIsAsync = true;
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestsnavigationredirectonbackupdateshistoryitemexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/navigation/redirect-on-back-updates-history-item-expected.txt (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/navigation/redirect-on-back-updates-history-item-expected.txt        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/navigation/redirect-on-back-updates-history-item-expected.txt        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -1,8 +1,6 @@
</span><span class="cx"> main frame - has 1 onunload handler(s)
</span><span class="cx"> PASS
</span><del>-popstate: null
</del><span class="cx">
</span><del>-
</del><span class="cx"> ============== Back Forward List ==============
</span><span class="cx"> http://127.0.0.1:8000/navigation/redirect-on-back-updates-history-item.html **nav target**
</span><span class="cx"> curr-> http://127.0.0.1:8000/navigation/resources/redirect-updates-history-item-done.html **nav target**
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestsnavigationredirectonreloadupdateshistoryitemexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/navigation/redirect-on-reload-updates-history-item-expected.txt (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/navigation/redirect-on-reload-updates-history-item-expected.txt        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/navigation/redirect-on-reload-updates-history-item-expected.txt        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -1,9 +1,7 @@
</span><span class="cx"> main frame - has 1 onunload handler(s)
</span><span class="cx"> main frame - has 1 onunload handler(s)
</span><span class="cx"> PASS
</span><del>-popstate: null
</del><span class="cx">
</span><del>-
</del><span class="cx"> ============== Back Forward List ==============
</span><span class="cx"> http://127.0.0.1:8000/navigation/redirect-on-reload-updates-history-item.html **nav target**
</span><span class="cx"> curr-> http://127.0.0.1:8000/navigation/resources/redirect-updates-history-item-done.html **nav target**
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-10-02 Antoine Quint <graouts@apple.com>
+
+ popstate is fired at the wrong time on load
+ https://bugs.webkit.org/show_bug.cgi?id=94265
+
+ Reviewed by Darin Adler.
+
+ Don't fire popstate event on initial document load
+
+ According to the specification [1], a popstate event should only be fired
+ when the document has a "last entry" and the entry being navigated to isn't
+ it. A document is created without a "last entry" and gets one just after
+ this check when it is first navigated to, so a popstate should be fired any
+ time a document is navigated to except for the first time after it has been
+ created.
+
+ Patch adapted from work by jl@opera.com on Blink [2].
+
+ [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#traverse-the-history (step 12-14 in particular)
+ [2] https://src.chromium.org/viewvc/blink?revision=165221&view=revision
+
+ * dom/Document.cpp:
+ (WebCore::Document::implicitClose):
+
</ins><span class="cx"> 2015-10-01 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Websites with invalid auth header keep loading forever
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.cpp (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.cpp        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/dom/Document.cpp        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -2628,7 +2628,8 @@
</span><span class="cx">
</span><span class="cx"> dispatchWindowLoadEvent();
</span><span class="cx"> enqueuePageshowEvent(PageshowEventNotPersisted);
</span><del>- enqueuePopstateEvent(m_pendingStateObject ? m_pendingStateObject.release() : SerializedScriptValue::nullValue());
</del><ins>+ if (m_pendingStateObject)
+ enqueuePopstateEvent(m_pendingStateObject.release());
</ins><span class="cx">
</span><span class="cx"> if (f)
</span><span class="cx"> f->loader().handledOnloadEvents();
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-10-02 Antoine Quint <graouts@apple.com>
+
+ popstate is fired at the wrong time on load
+ https://bugs.webkit.org/show_bug.cgi?id=94265
+
+ Reviewed by Darin Adler.
+
+ Ensure we have a valid page before trying to get to its drawingArea as this could lead
+ to a crash as observed with fast/loader/stateobjects/pushstate-object-types.html.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::restoreViewState):
+
</ins><span class="cx"> 2015-10-01 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> Network cache: Subresource referer header wrong after cached redirect
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (190953 => 190954)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2015-10-13 10:35:48 UTC (rev 190953)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2015-10-13 10:41:01 UTC (rev 190954)
</span><span class="lines">@@ -1214,7 +1214,7 @@
</span><span class="cx">
</span><span class="cx"> // FIXME: This should not be necessary. WebCore should be correctly invalidating
</span><span class="cx"> // the view on restores from the back/forward cache.
</span><del>- if (m_frame == m_frame->page()->mainWebFrame())
</del><ins>+ if (m_frame->page() && m_frame == m_frame->page()->mainWebFrame())
</ins><span class="cx"> m_frame->page()->drawingArea()->setNeedsDisplay();
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>