Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r222097 - Make DocumentLoader a FrameDestructionObserver
https://bugs.webkit.org/show_bug.cgi?id=176364 <rdar://problem/34254780> Reviewed by Alex Christensen. The DocumentLoader needs to know when its Frame is destroyed so that it can perform properly cleanup. Test: fast/events/beforeunload-dom-manipulation-crash.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::DocumentLoader): Call FrameDestructionObserver constructor. (WebCore::DocumentLoader::responseReceived): Drive-by fix. Make sure the current object is valid during the callback. (WebCore::DocumentLoader::attachToFrame): Use FrameDestructionObserver::observerFrame rather than setting the m_frame variable directly. (WebCore::DocumentLoader::detachFromFrame): Ditto. * loader/DocumentLoader.h: (WebCore::DocumentLoader::frame const): Deleted, as this is provided by the FrameDestructionObserver. Tools: Provide mechanism to immediately end tests https://bugs.webkit.org/show_bug.cgi?id=176364 <rdar://problem/34254780> Reviewed by Alex Christensen. WebKitTestRunner does not output state if the top loading frame has not been removed. This prevents some tests that attempt to exercise failed load state from working properly. This change adds a new 'forceImmediateCompletion' handler for DumpRenderTree and WebKitTestRunner so that we can properly test these conditions. * DumpRenderTree/TestRunner.h: * DumpRenderTree/mac/TestRunnerMac.mm: (TestRunner::forceImmediateCompletion): Added. * DumpRenderTree/win/TestRunnerWin.cpp: (TestRunner::forceImmediateCompletion): Ditto. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::forceImmediateCompletion): Ditto. * WebKitTestRunner/InjectedBundle/TestRunner.h: LayoutTests: Make DocumentLoader a FrameDestructionObserver https://bugs.webkit.org/show_bug.cgi?id=176364 <rdar://problem/34254780> Reviewed by Alex Christensen. * fast/events/beforeunload-dom-manipulation-crash-expected.txt: Added. * fast/events/beforeunload-dom-manipulation-crash.html: Added.
- Loading branch information
1 parent
49c99a0
commit 59f7b5a
Showing
13 changed files
with
128 additions
and
8 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
1 change: 1 addition & 0 deletions
1
LayoutTests/fast/events/beforeunload-dom-manipulation-crash-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 @@ | ||
This test passes if it does not crash. |
27 changes: 27 additions & 0 deletions
27
LayoutTests/fast/events/beforeunload-dom-manipulation-crash.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,27 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<script src="../../resources/js-test.js"></script> | ||
<script> | ||
jsTestIsAsync = true; | ||
|
||
function runTest() { | ||
window.onbeforeunload = nextStep; | ||
|
||
iframe.name = "foo"; | ||
iframe.src = "data:text/html,foo"; | ||
|
||
location.href = "data:text/html,FAIL"; | ||
} | ||
|
||
function nextStep() { | ||
document.head.appendChild(del); | ||
if (window.testRunner) | ||
testRunner.forceImmediateCompletion(); | ||
} | ||
</script> | ||
</head> | ||
<body onload="runTest()"> | ||
<p>This test passes if it does not crash.</p> | ||
<del id="del"> | ||
<iframe id="iframe"></iframe> | ||
</body> |
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
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
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
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
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