-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Site Isolation] Owner element should be preserved when switching bet…
…ween LocalFrame and RemoteFrame https://bugs.webkit.org/show_bug.cgi?id=273809 rdar://127638179 Reviewed by Charlie Wolfe. Otherwise it suddenly becomes null from the point of view of the Frame and DOMWindow, which prevents things like the load event from flowing to the event listeners. I also rename createSubframeHostedInAnotherProcess to createProvisionalSubframe because the contents aren't necessarily hosted in another process. This test hit a case where sometimes a frame was created and destroyed before the frame we transitioned from was destroyed, so I updated the assertion to not assert in that case. * LayoutTests/http/tests/site-isolation/load-event-after-transition-expected.txt: Added. * LayoutTests/http/tests/site-isolation/load-event-after-transition.html: Added. * Source/WebCore/page/Frame.cpp: (WebCore::Frame::setOwnerElement): * Source/WebCore/page/Frame.h: * Source/WebCore/page/LocalFrame.cpp: (WebCore::LocalFrame::createProvisionalSubframe): (WebCore::LocalFrame::createSubframeHostedInAnotherProcess): Deleted. * Source/WebCore/page/LocalFrame.h: * Source/WebKit/WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createProvisionalFrame): (WebKit::WebFrame::commitProvisionalFrame): * Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm: Canonical link: https://commits.webkit.org/278472@main
- Loading branch information
1 parent
86f6d64
commit 6f62e90
Showing
8 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
LayoutTests/http/tests/site-isolation/load-event-after-transition-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,5 @@ | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
PASS Load event fired after switching to a local frame. | ||
|
18 changes: 18 additions & 0 deletions
18
LayoutTests/http/tests/site-isolation/load-event-after-transition.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,18 @@ | ||
<!-- webkit-test-runner [ SiteIsolationEnabled=true ] --> | ||
<script src="/js-test-resources/js-test.js"></script> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
onload = () => { | ||
let i = document.getElementById('testiframe'); | ||
i.src = 'http://127.0.0.1:8000/site-isolation/resources/green-background.html'; | ||
i.addEventListener('load', function() { | ||
testPassed("Load event fired after switching to a local frame."); | ||
testRunner.notifyDone(); | ||
}) | ||
} | ||
</script> | ||
<iframe id='testiframe' src="http://localhost:8000/site-isolation/resources/green-background.html"></iframe> |
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