Commit 0eb6932a authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

Fix crash in subresource integrity reporting on script load finish

Bug: 1063628
Test: fast/dom/HTMLScriptElement/reparent-to-new-document-integrity-report-crash.html
Change-Id: If68846a2a95fd8e144a19b49d4efb6823b08f1be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2118696Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753234}
parent 866d30a1
......@@ -259,7 +259,7 @@ void ClassicPendingScript::NotifyFinished(Resource* resource) {
ScriptElementBase* element = GetElement();
if (element) {
SubresourceIntegrityHelper::DoReport(
*element->GetDocument().ToExecutionContext(),
*element->GetDocument().GetExecutionContext(),
GetResource()->IntegrityReportInfo());
// It is possible to get back a script resource with integrity metadata
......
CONSOLE ERROR: Failed to find a valid digest in the 'integrity' attribute for resource 'data:text/javascript,' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
PASS if no crash.
<body>
PASS if no crash.
<script>
if (window.testRunner)
testRunner.dumpAsText();
var s = document.createElementNS('http://www.w3.org/1999/xhtml', 'script')
s.src = 'data:text/javascript,';
s.setAttribute('integrity', 'sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC')
document.body.appendChild(s)
new Document().prepend(s)
</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