Diff
Modified: branches/safari-605-branch/LayoutTests/ChangeLog (228446 => 228447)
--- branches/safari-605-branch/LayoutTests/ChangeLog 2018-02-14 01:40:15 UTC (rev 228446)
+++ branches/safari-605-branch/LayoutTests/ChangeLog 2018-02-14 04:15:46 UTC (rev 228447)
@@ -1,3 +1,22 @@
+2018-02-13 Jason Marcell <jmarc...@apple.com>
+
+ Cherry-pick r228299. rdar://problem/37518837
+
+ 2018-02-08 Chris Dumez <cdu...@apple.com>
+
+ Form submission after navigation fails when decidePolicyForNavigationAction is async
+ https://bugs.webkit.org/show_bug.cgi?id=182412
+ <rdar://problem/35181099>
+
+ Reviewed by Alex Christensen.
+
+ Import layout test coverage from Alex's earlier patch.
+
+ * http/tests/navigation/resources/a.html: Added.
+ * http/tests/navigation/resources/b.html: Added.
+ * http/tests/navigation/sync-form-submit-iframe-expected.txt: Added.
+ * http/tests/navigation/sync-form-submit-iframe.html: Added.
+
2018-02-12 Dean Jackson <d...@apple.com>
Update expected results for this branch.
Added: branches/safari-605-branch/LayoutTests/http/tests/navigation/resources/a.html (0 => 228447)
--- branches/safari-605-branch/LayoutTests/http/tests/navigation/resources/a.html (rev 0)
+++ branches/safari-605-branch/LayoutTests/http/tests/navigation/resources/a.html 2018-02-14 04:15:46 UTC (rev 228447)
@@ -0,0 +1,3 @@
+<script>
+parent.postMessage('a', '*');
+</script>
Added: branches/safari-605-branch/LayoutTests/http/tests/navigation/resources/b.html (0 => 228447)
--- branches/safari-605-branch/LayoutTests/http/tests/navigation/resources/b.html (rev 0)
+++ branches/safari-605-branch/LayoutTests/http/tests/navigation/resources/b.html 2018-02-14 04:15:46 UTC (rev 228447)
@@ -0,0 +1,3 @@
+<script>
+parent.postMessage('b', '*');
+</script>
Added: branches/safari-605-branch/LayoutTests/http/tests/navigation/sync-form-submit-iframe-expected.txt (0 => 228447)
--- branches/safari-605-branch/LayoutTests/http/tests/navigation/sync-form-submit-iframe-expected.txt (rev 0)
+++ branches/safari-605-branch/LayoutTests/http/tests/navigation/sync-form-submit-iframe-expected.txt 2018-02-14 04:15:46 UTC (rev 228447)
@@ -0,0 +1,3 @@
+ALERT: PASS
+
+
Added: branches/safari-605-branch/LayoutTests/http/tests/navigation/sync-form-submit-iframe.html (0 => 228447)
--- branches/safari-605-branch/LayoutTests/http/tests/navigation/sync-form-submit-iframe.html (rev 0)
+++ branches/safari-605-branch/LayoutTests/http/tests/navigation/sync-form-submit-iframe.html 2018-02-14 04:15:46 UTC (rev 228447)
@@ -0,0 +1,31 @@
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ if (testRunner.setShouldDecideNavigationPolicyAfterDelay)
+ testRunner.setShouldDecideNavigationPolicyAfterDelay(true);
+}
+
+function receiveMessage(e)
+{
+ alert(e.data == 'b' ? 'PASS' : 'FAIL');
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+window.addEventListener("message", receiveMessage, false);
+
+function runtest() {
+ var iframe = document.createElement('iframe');
+ iframe.src = '';
+ iframe.name = 'framename';
+ document.body.appendChild(iframe);
+
+ var form = document.createElement('form');
+ form.setAttribute('method', 'post');
+ form.setAttribute('action', 'resources/b.html');
+ form.setAttribute('target', 'framename');
+ document.body.appendChild(form);
+ form.submit();
+}
+</script>
+<body _onload_='runtest()'/>
Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (228446 => 228447)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-02-14 01:40:15 UTC (rev 228446)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-02-14 04:15:46 UTC (rev 228447)
@@ -1,3 +1,26 @@
+2018-02-13 Jason Marcell <jmarc...@apple.com>
+
+ Cherry-pick r228299. rdar://problem/37518837
+
+ 2018-02-08 Chris Dumez <cdu...@apple.com>
+
+ Form submission after navigation fails when decidePolicyForNavigationAction is async
+ https://bugs.webkit.org/show_bug.cgi?id=182412
+ <rdar://problem/35181099>
+
+ Reviewed by Alex Christensen.
+
+ When the form is submitted and schedules the load in an iframe that is already loading,
+ FrameLoader::stopLoading() is called as expected. However, because policy checks can
+ now be asynchronous, stopLoading() also needs to stop pending policy checks. Otherwise,
+ continueLoadAfterNavigationPolicy() gets called for a cancelled load and we're in trouble
+ because the FrameLoader was reused for another load since then.
+
+ Test: http/tests/navigation/sync-form-submit-iframe.html
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::stopLoading):
+
2018-02-12 Jason Marcell <jmarc...@apple.com>
Cherry-pick r228389. rdar://problem/37475107
Modified: branches/safari-605-branch/Source/WebCore/loader/FrameLoader.cpp (228446 => 228447)
--- branches/safari-605-branch/Source/WebCore/loader/FrameLoader.cpp 2018-02-14 01:40:15 UTC (rev 228446)
+++ branches/safari-605-branch/Source/WebCore/loader/FrameLoader.cpp 2018-02-14 04:15:46 UTC (rev 228447)
@@ -488,6 +488,8 @@
DatabaseManager::singleton().stopDatabases(*document, nullptr);
}
+ policyChecker().stopCheck();
+
// FIXME: This will cancel redirection timer, which really needs to be restarted when restoring the frame from b/f cache.
m_frame.navigationScheduler().cancel();
}