Commit e9f1e0b2 authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

Adding a <media> into an inactive document should not crash.

Bug: 1092889
Test: html/semantics/embedded-content/the-audio-element/audio-appendChild-to-inactive-document-crash.html
Change-Id: I14d78db39b74d4593f3ed71b8440ca108fafdd0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2247120
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Nate Chapin <japhet@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779148}
parent 505cdb51
......@@ -380,8 +380,8 @@ const SecurityContext& LocalDOMWindow::GetSecurityContext() const {
bool LocalDOMWindow::CanExecuteScripts(
ReasonForCallingCanExecuteScripts reason) {
DCHECK(GetFrame())
<< "you are querying canExecuteScripts on a non-attached Window.";
if (!GetFrame())
return false;
// Normally, scripts are not allowed in sandboxed contexts that disallow them.
// However, there is an exception for cases when the script should bypass the
......
<iframe id=i></iframe>
<script>
var doc = i.contentDocument.cloneNode();
i.remove();
doc.appendChild(document.createElement("audio"));
</script>
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