Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r228299 - Form submission after navigation fails when decidePol…
…icyForNavigationAction is async https://bugs.webkit.org/show_bug.cgi?id=182412 <rdar://problem/35181099> Reviewed by Alex Christensen. Source/WebCore: 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): LayoutTests: 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.
- Loading branch information
1 parent
d9ee9ab
commit bb6b712
Showing
7 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script> | ||
parent.postMessage('a', '*'); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script> | ||
parent.postMessage('b', '*'); | ||
</script> |
3 changes: 3 additions & 0 deletions
3
LayoutTests/http/tests/navigation/sync-form-submit-iframe-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALERT: PASS | ||
|
||
|
31 changes: 31 additions & 0 deletions
31
LayoutTests/http/tests/navigation/sync-form-submit-iframe.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = 'resources/a.html'; | ||
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()'/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters