<!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>[193705] branches/safari-601.1.46.60-branch</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/193705">193705</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2015-12-07 23:50:20 -0800 (Mon, 07 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/192369">r192369</a>. rdar://problem/23787037</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari60114660branchLayoutTestsChangeLog">branches/safari-601.1.46.60-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari60114660branchLayoutTestsfastloaderstateobjectspopstatefiresonhistorytraversalhtml">branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal.html</a></li>
<li><a href="#branchessafari60114660branchSourceWebCoreChangeLog">branches/safari-601.1.46.60-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari60114660branchSourceWebCoredomDocumentcpp">branches/safari-601.1.46.60-branch/Source/WebCore/dom/Document.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari60114660branchLayoutTestsfastloaderremoveiframeduringhistorynavigationdifferentexpectedtxt">branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-different-expected.txt</a></li>
<li><a href="#branchessafari60114660branchLayoutTestsfastloaderremoveiframeduringhistorynavigationdifferenthtml">branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-different.html</a></li>
<li><a href="#branchessafari60114660branchLayoutTestsfastloaderremoveiframeduringhistorynavigationsameexpectedtxt">branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-same-expected.txt</a></li>
<li><a href="#branchessafari60114660branchLayoutTestsfastloaderremoveiframeduringhistorynavigationsamehtml">branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-same.html</a></li>
<li><a href="#branchessafari60114660branchLayoutTestsfastloaderstateobjectspopstateisasynchronousexpectedtxt">branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-is-asynchronous-expected.txt</a></li>
<li><a href="#branchessafari60114660branchLayoutTestsfastloaderstateobjectspopstateisasynchronoushtml">branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-is-asynchronous.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari60114660branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46.60-branch/LayoutTests/ChangeLog (193704 => 193705)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46.60-branch/LayoutTests/ChangeLog        2015-12-08 07:48:11 UTC (rev 193704)
+++ branches/safari-601.1.46.60-branch/LayoutTests/ChangeLog        2015-12-08 07:50:20 UTC (rev 193705)
</span><span class="lines">@@ -1,5 +1,31 @@
</span><span class="cx"> 2015-12-07 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r192369.
+
+ 2015-11-11 Jon Honeycutt <jhoneycutt@apple.com>
+
+ popstate event should be dispatched asynchronously
+ https://bugs.webkit.org/show_bug.cgi?id=36202
+ <rdar://problem/7761279>
+
+ Based on an original patch by Mihai Parparita <mihaip@chromium.org>.
+
+ Reviewed by Brent Fulgham.
+
+ * fast/loader/remove-iframe-during-history-navigation-different-expected.txt: Added.
+ * fast/loader/remove-iframe-during-history-navigation-different.html: Added.
+ Imported from Blink.
+ * fast/loader/remove-iframe-during-history-navigation-same-expected.txt: Added.
+ * fast/loader/remove-iframe-during-history-navigation-same.html: Added.
+ Ditto.
+ * fast/loader/stateobjects/popstate-fires-on-history-traversal.html:
+ Modified to account for popstate firing asynchronously.
+ * fast/loader/stateobjects/popstate-is-asynchronous-expected.txt: Added.
+ * fast/loader/stateobjects/popstate-is-asynchronous.html: Added.
+ Based on Mihai's original test. Modified to pass in current WebKit.
+
+2015-12-07 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r192316.
</span><span class="cx">
</span><span class="cx"> 2015-11-10 Jon Honeycutt <jhoneycutt@apple.com>
</span></span></pre></div>
<a id="branchessafari60114660branchLayoutTestsfastloaderremoveiframeduringhistorynavigationdifferentexpectedtxtfromrev192369trunkLayoutTestsfastloaderremoveiframeduringhistorynavigationdifferentexpectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-different-expected.txt (from rev 192369, trunk/LayoutTests/fast/loader/remove-iframe-during-history-navigation-different-expected.txt) (0 => 193705)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-different-expected.txt         (rev 0)
+++ branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-different-expected.txt        2015-12-08 07:50:20 UTC (rev 193705)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+TEST PASSED
</ins></span></pre></div>
<a id="branchessafari60114660branchLayoutTestsfastloaderremoveiframeduringhistorynavigationdifferenthtmlfromrev192369trunkLayoutTestsfastloaderremoveiframeduringhistorynavigationdifferenthtml"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-different.html (from rev 192369, trunk/LayoutTests/fast/loader/remove-iframe-during-history-navigation-different.html) (0 => 193705)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-different.html         (rev 0)
+++ branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-different.html        2015-12-08 07:50:20 UTC (rev 193705)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<!DOCTYPE html>
+<script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ // One iframe's popstate handler removes another iframe from the
+ // document during a history navigation that affects both frames. The
+ // history navigation loads a different document in the other frame.
+ window.onload = function () {
+ frames[0].history.pushState("first", "first");
+ frames[0].onpopstate = function () {
+ document.body.innerHTML = "TEST PASSED";
+ if (window.testRunner)
+ testRunner.notifyDone();
+ };
+ document.querySelectorAll("iframe")[1].onload = function () {
+ setTimeout("history.go(-2);", 10);
+ };
+ setTimeout(function () {
+ frames[1].location.href = "resources/empty-subframe.html?new";
+ }, 10);
+ }
+</script>
+
+<body>
+ NOT TESTED
+ <iframe src="resources/empty-subframe.html"></iframe>
+ <iframe src="resources/empty-subframe.html"></iframe>
+</body>
</ins></span></pre></div>
<a id="branchessafari60114660branchLayoutTestsfastloaderremoveiframeduringhistorynavigationsameexpectedtxtfromrev192369trunkLayoutTestsfastloaderremoveiframeduringhistorynavigationsameexpectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-same-expected.txt (from rev 192369, trunk/LayoutTests/fast/loader/remove-iframe-during-history-navigation-same-expected.txt) (0 => 193705)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-same-expected.txt         (rev 0)
+++ branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-same-expected.txt        2015-12-08 07:50:20 UTC (rev 193705)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+TEST PASSED
</ins></span></pre></div>
<a id="branchessafari60114660branchLayoutTestsfastloaderremoveiframeduringhistorynavigationsamehtmlfromrev192369trunkLayoutTestsfastloaderremoveiframeduringhistorynavigationsamehtml"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-same.html (from rev 192369, trunk/LayoutTests/fast/loader/remove-iframe-during-history-navigation-same.html) (0 => 193705)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-same.html         (rev 0)
+++ branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/remove-iframe-during-history-navigation-same.html        2015-12-08 07:50:20 UTC (rev 193705)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<!DOCTYPE html>
+<script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ // One iframe's popstate handler removes another iframe from the
+ // document during a history navigation that affects both frames. The
+ // history navigation selects the same document in both frames.
+ window.onload = function () {
+ frames[0].history.pushState("first", "first");
+ frames[0].onpopstate = function () {
+ document.body.innerHTML = "TEST PASSED";
+ if (window.testRunner)
+ testRunner.notifyDone();
+ };
+ frames[1].history.pushState("second", "second");
+
+ history.go(-2);
+ }
+</script>
+
+<body>
+ NOT TESTED
+ <iframe src="resources/empty-subframe.html"></iframe>
+ <iframe src="resources/empty-subframe.html"></iframe>
+</body>
</ins></span></pre></div>
<a id="branchessafari60114660branchLayoutTestsfastloaderstateobjectspopstatefiresonhistorytraversalhtml"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal.html (193704 => 193705)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal.html        2015-12-08 07:48:11 UTC (rev 193704)
+++ branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal.html        2015-12-08 07:50:20 UTC (rev 193705)
</span><span class="lines">@@ -50,14 +50,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> currentStep++;
</span><del>-
- setTimeout(step, 0);
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> onpopstate = function(event)
</span><span class="cx"> {
</span><span class="cx"> debug('popstate fired with state ' + event.state);
</span><span class="cx"> popstateFireCount++;
</span><ins>+ setTimeout(step, 0);
</ins><span class="cx"> }
</span><span class="cx"> var jsTestIsAsync = true;
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="branchessafari60114660branchLayoutTestsfastloaderstateobjectspopstateisasynchronousexpectedtxtfromrev192369trunkLayoutTestsfastloaderstateobjectspopstateisasynchronousexpectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-is-asynchronous-expected.txt (from rev 192369, trunk/LayoutTests/fast/loader/stateobjects/popstate-is-asynchronous-expected.txt) (0 => 193705)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-is-asynchronous-expected.txt         (rev 0)
+++ branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-is-asynchronous-expected.txt        2015-12-08 07:50:20 UTC (rev 193705)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Tests that popstate events fire asynchronously.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+onload fired
+popstate fired
+Setting hash to #foo
+Set hash to #foo
+popstate fired
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari60114660branchLayoutTestsfastloaderstateobjectspopstateisasynchronoushtmlfromrev192369trunkLayoutTestsfastloaderstateobjectspopstateisasynchronoushtml"></a>
<div class="copfile"><h4>Copied: branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-is-asynchronous.html (from rev 192369, trunk/LayoutTests/fast/loader/stateobjects/popstate-is-asynchronous.html) (0 => 193705)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-is-asynchronous.html         (rev 0)
+++ branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-is-asynchronous.html        2015-12-08 07:50:20 UTC (rev 193705)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<link rel="stylesheet" href="../../../resources/js-test-style.css" type="text/css">
+<script src="../../../resources/js-test-pre.js"></script>
+<div id="description"></div>
+<pre id="console"></pre>
+<script>
+description('Tests that popstate events fire asynchronously.');
+
+window.onload = function()
+{
+ debug('onload fired');
+ history.pushState("test", "test");
+ history.back();
+}
+
+var initialPopState = true;
+
+window.onpopstate = function()
+{
+ debug('popstate fired');
+
+ if (initialPopState) {
+ initialPopState = false;
+
+ // This should not be re-entrant; there should be no other log lines
+ // between the "Setting..." and "Set..." lines.
+ debug('Setting hash to #foo');
+ location.hash = '#foo';
+ debug('Set hash to #foo');
+ } else
+ finishJSTest();
+}
+
+var successfullyParsed = true;
+var jsTestIsAsync = true;
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</html>
</ins></span></pre></div>
<a id="branchessafari60114660branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46.60-branch/Source/WebCore/ChangeLog (193704 => 193705)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46.60-branch/Source/WebCore/ChangeLog        2015-12-08 07:48:11 UTC (rev 193704)
+++ branches/safari-601.1.46.60-branch/Source/WebCore/ChangeLog        2015-12-08 07:50:20 UTC (rev 193705)
</span><span class="lines">@@ -1,5 +1,27 @@
</span><span class="cx"> 2015-12-07 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r192369.
+
+ 2015-11-11 Jon Honeycutt <jhoneycutt@apple.com>
+
+ popstate event should be dispatched asynchronously
+ https://bugs.webkit.org/show_bug.cgi?id=36202
+ <rdar://problem/7761279>
+
+ Based on an original patch by Mihai Parparita <mihaip@chromium.org>.
+
+ Reviewed by Brent Fulgham.
+
+ Tests: fast/loader/remove-iframe-during-history-navigation-different.html
+ fast/loader/remove-iframe-during-history-navigation-same.html
+ fast/loader/stateobjects/popstate-is-asynchronous.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::enqueuePopstateEvent):
+ Use enqueueWindowEvent().
+
+2015-12-07 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r192316.
</span><span class="cx">
</span><span class="cx"> 2015-11-10 Jon Honeycutt <jhoneycutt@apple.com>
</span></span></pre></div>
<a id="branchessafari60114660branchSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46.60-branch/Source/WebCore/dom/Document.cpp (193704 => 193705)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46.60-branch/Source/WebCore/dom/Document.cpp        2015-12-08 07:48:11 UTC (rev 193704)
+++ branches/safari-601.1.46.60-branch/Source/WebCore/dom/Document.cpp        2015-12-08 07:50:20 UTC (rev 193705)
</span><span class="lines">@@ -5326,8 +5326,7 @@
</span><span class="cx">
</span><span class="cx"> void Document::enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObject)
</span><span class="cx"> {
</span><del>- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36202 Popstate event needs to fire asynchronously
- dispatchWindowEvent(PopStateEvent::create(stateObject, m_domWindow ? m_domWindow->history() : nullptr));
</del><ins>+ enqueueWindowEvent(PopStateEvent::create(stateObject, m_domWindow ? m_domWindow->history() : nullptr));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::addMediaCanStartListener(MediaCanStartListener* listener)
</span></span></pre>
</div>
</div>
</body>
</html>