Diff
Modified: branches/safari-601.1.46.60-branch/LayoutTests/ChangeLog (193704 => 193705)
--- 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)
@@ -1,5 +1,31 @@
2015-12-07 Babak Shafiei <bshaf...@apple.com>
+ Merge r192369.
+
+ 2015-11-11 Jon Honeycutt <jhoneyc...@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 <mih...@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 <bshaf...@apple.com>
+
Merge r192316.
2015-11-10 Jon Honeycutt <jhoneyc...@apple.com>
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)
--- 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)
@@ -0,0 +1 @@
+TEST PASSED
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)
--- 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)
@@ -0,0 +1,31 @@
+<!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 = ""
+ }, 10);
+ }
+</script>
+
+<body>
+ NOT TESTED
+ <iframe src=""
+ <iframe src=""
+</body>
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)
--- 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)
@@ -0,0 +1 @@
+TEST PASSED
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)
--- 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)
@@ -0,0 +1,28 @@
+<!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=""
+ <iframe src=""
+</body>
Modified: branches/safari-601.1.46.60-branch/LayoutTests/fast/loader/stateobjects/popstate-fires-on-history-traversal.html (193704 => 193705)
--- 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)
@@ -50,14 +50,13 @@
}
currentStep++;
-
- setTimeout(step, 0);
}
_onpopstate_ = function(event)
{
debug('popstate fired with state ' + event.state);
popstateFireCount++;
+ setTimeout(step, 0);
}
var jsTestIsAsync = true;
</script>
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)
--- 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)
@@ -0,0 +1,13 @@
+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
+
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)
--- 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)
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<body>
+<link rel="stylesheet" href="" type="text/css">
+<script src=""
+<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=""
+</html>
Modified: branches/safari-601.1.46.60-branch/Source/WebCore/ChangeLog (193704 => 193705)
--- 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)
@@ -1,5 +1,27 @@
2015-12-07 Babak Shafiei <bshaf...@apple.com>
+ Merge r192369.
+
+ 2015-11-11 Jon Honeycutt <jhoneyc...@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 <mih...@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 <bshaf...@apple.com>
+
Merge r192316.
2015-11-10 Jon Honeycutt <jhoneyc...@apple.com>
Modified: branches/safari-601.1.46.60-branch/Source/WebCore/dom/Document.cpp (193704 => 193705)
--- 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)
@@ -5326,8 +5326,7 @@
void Document::enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObject)
{
- // 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));
+ enqueueWindowEvent(PopStateEvent::create(stateObject, m_domWindow ? m_domWindow->history() : nullptr));
}
void Document::addMediaCanStartListener(MediaCanStartListener* listener)