Commit 8c9a47fa authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

Document::addressSpace shouldn't crash when used in a detached Document

Bug: 1083485
Test: fast/frames/document-addressSpace-in-initial-document-after-navigation.html
Change-Id: I08229cb5143e3a348d0897d4ad186978a858b7b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2215443Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772270}
parent ade0a3fa
......@@ -1125,7 +1125,7 @@ String Document::addressSpaceForBindings(ScriptState* script_state) const {
// "public" is the lowest-privilege value.
if (!script_state->ContextIsValid())
return "public";
return GetExecutionContext()->addressSpaceForBindings();
return ExecutionContext::From(script_state)->addressSpaceForBindings();
}
void Document::ChildrenChanged(const ChildrenChange& change) {
......
<body>
PASS if no crash.
<iframe id="i" src="resources/fail-and-notify-done.html"></iframe>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var doc = i.contentDocument;
i.src = "about:blank";
doc.addressSpace;
</script>
</body>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment