Commit 960460d8 authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Commit Bot

Fire load event for link modulepreload with non-fetch errors

According to the spec comment, load events (instead of error events)
should be fired for modules with non-fetch errors such as parse errors.

Bug: 740886, 763597
Change-Id: I6074b36631e1299b90d52bc01e42c5ddeb957b31
Reviewed-on: https://chromium-review.googlesource.com/802251Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarKunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521726}
parent d7930dfe
......@@ -71,7 +71,7 @@ promise_test(function(t) {
var link = document.createElement('link');
link.rel = 'modulepreload';
link.href = 'resources/syntax-error.js';
return attachAndWaitForError(link);
return attachAndWaitForLoad(link);
}, 'link rel=modulepreload for a module with syntax error');
promise_test(function(t) {
......
......@@ -146,7 +146,7 @@ void LinkLoader::NotifyModuleLoadFinished(ModuleScript* module) {
// Step 11. "If result is null, fire an event named error at the link element,
// and return." [spec text]
// Step 12. "Fire an event named load at the link element." [spec text]
if (!module || module->IsErrored())
if (!module)
client_->LinkLoadingErrored();
else
client_->LinkLoaded();
......
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