зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 15 changesets (bug 1757597, bug 1436400) for causing mochitest failures on test_bug1656248.html. CLOSED TREE
Backed out changeset 4be29c1eb5bc (bug 1436400) Backed out changeset ffd9ddcef6b0 (bug 1436400) Backed out changeset 5ac844508d8b (bug 1436400) Backed out changeset 561aeb550892 (bug 1436400) Backed out changeset 6f473bcf809a (bug 1436400) Backed out changeset c33620854115 (bug 1436400) Backed out changeset 8f894ea40eb2 (bug 1436400) Backed out changeset cce080064d82 (bug 1436400) Backed out changeset 001d8528ff96 (bug 1436400) Backed out changeset dd2bb1b46f75 (bug 1436400) Backed out changeset b1c2084042fa (bug 1436400) Backed out changeset dd0fea93bcd7 (bug 1436400) Backed out changeset e38a959648e1 (bug 1436400) Backed out changeset 40b474d430e9 (bug 1436400) Backed out changeset 5bef21ef1ba2 (bug 1757597)
This commit is contained in:
Родитель
39e3163129
Коммит
6ae31a2e64
|
@ -445,8 +445,7 @@ bool nsContentUtils::sInitialized = false;
|
|||
bool nsContentUtils::sBypassCSSOMOriginCheck = false;
|
||||
#endif
|
||||
|
||||
nsCString* nsContentUtils::sJSScriptBytecodeMimeType = nullptr;
|
||||
nsCString* nsContentUtils::sJSModuleBytecodeMimeType = nullptr;
|
||||
nsCString* nsContentUtils::sJSBytecodeMimeType = nullptr;
|
||||
|
||||
nsContentUtils::UserInteractionObserver*
|
||||
nsContentUtils::sUserInteractionObserver = nullptr;
|
||||
|
@ -806,8 +805,7 @@ nsresult nsContentUtils::Init() {
|
|||
|
||||
bool nsContentUtils::InitJSBytecodeMimeType() {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(!sJSScriptBytecodeMimeType);
|
||||
MOZ_ASSERT(!sJSModuleBytecodeMimeType);
|
||||
MOZ_ASSERT(!sJSBytecodeMimeType);
|
||||
|
||||
JS::BuildIdCharVector jsBuildId;
|
||||
if (!JS::GetScriptTranscodingBuildId(&jsBuildId)) {
|
||||
|
@ -815,10 +813,8 @@ bool nsContentUtils::InitJSBytecodeMimeType() {
|
|||
}
|
||||
|
||||
nsDependentCSubstring jsBuildIdStr(jsBuildId.begin(), jsBuildId.length());
|
||||
sJSScriptBytecodeMimeType =
|
||||
new nsCString("javascript/moz-script-bytecode-"_ns + jsBuildIdStr);
|
||||
sJSModuleBytecodeMimeType =
|
||||
new nsCString("javascript/moz-module-bytecode-"_ns + jsBuildIdStr);
|
||||
sJSBytecodeMimeType =
|
||||
new nsCString("javascript/moz-bytecode-"_ns + jsBuildIdStr);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1914,11 +1910,8 @@ void nsContentUtils::Shutdown() {
|
|||
delete sModifierSeparator;
|
||||
sModifierSeparator = nullptr;
|
||||
|
||||
delete sJSScriptBytecodeMimeType;
|
||||
sJSScriptBytecodeMimeType = nullptr;
|
||||
|
||||
delete sJSModuleBytecodeMimeType;
|
||||
sJSModuleBytecodeMimeType = nullptr;
|
||||
delete sJSBytecodeMimeType;
|
||||
sJSBytecodeMimeType = nullptr;
|
||||
|
||||
NS_IF_RELEASE(sSameOriginChecker);
|
||||
|
||||
|
|
|
@ -3199,13 +3199,9 @@ class nsContentUtils {
|
|||
// Alternate data MIME type used by the ScriptLoader to register and read
|
||||
// bytecode out of the nsCacheInfoChannel.
|
||||
[[nodiscard]] static bool InitJSBytecodeMimeType();
|
||||
static nsCString& JSScriptBytecodeMimeType() {
|
||||
MOZ_ASSERT(sJSScriptBytecodeMimeType);
|
||||
return *sJSScriptBytecodeMimeType;
|
||||
}
|
||||
static nsCString& JSModuleBytecodeMimeType() {
|
||||
MOZ_ASSERT(sJSModuleBytecodeMimeType);
|
||||
return *sJSModuleBytecodeMimeType;
|
||||
static nsCString& JSBytecodeMimeType() {
|
||||
MOZ_ASSERT(sJSBytecodeMimeType);
|
||||
return *sJSBytecodeMimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3424,10 +3420,9 @@ class nsContentUtils {
|
|||
static nsString* sAltText;
|
||||
static nsString* sModifierSeparator;
|
||||
|
||||
// Alternate data mime types, used by the ScriptLoader to register and read
|
||||
// the bytecode out of the nsCacheInfoChannel.
|
||||
static nsCString* sJSScriptBytecodeMimeType;
|
||||
static nsCString* sJSModuleBytecodeMimeType;
|
||||
// Alternate data mime type, used by the ScriptLoader to register and read the
|
||||
// bytecode out of the nsCacheInfoChannel.
|
||||
static nsCString* sJSBytecodeMimeType;
|
||||
|
||||
static mozilla::LazyLogModule gResistFingerprintingLog;
|
||||
static mozilla::LazyLogModule sDOMDumpLog;
|
||||
|
|
|
@ -137,9 +137,47 @@ nsresult nsJSUtils::CompileFunction(AutoJSAPI& jsapi,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool nsJSUtils::IsScriptable(JS::Handle<JSObject*> aEvaluationGlobal) {
|
||||
return xpc::Scriptability::Get(aEvaluationGlobal).Allowed();
|
||||
template <typename Unit>
|
||||
static nsresult CompileJSModule(JSContext* aCx, JS::SourceText<Unit>& aSrcBuf,
|
||||
JS::Handle<JSObject*> aEvaluationGlobal,
|
||||
JS::CompileOptions& aCompileOptions,
|
||||
JS::MutableHandle<JSObject*> aModule) {
|
||||
AUTO_PROFILER_LABEL("nsJSUtils::CompileModule", JS);
|
||||
MOZ_ASSERT(aCx == nsContentUtils::GetCurrentJSContext());
|
||||
MOZ_ASSERT(aSrcBuf.get());
|
||||
MOZ_ASSERT(JS_IsGlobalObject(aEvaluationGlobal));
|
||||
MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx) == aEvaluationGlobal);
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(CycleCollectedJSContext::Get() &&
|
||||
CycleCollectedJSContext::Get()->MicroTaskLevel());
|
||||
|
||||
NS_ENSURE_TRUE(xpc::Scriptability::Get(aEvaluationGlobal).Allowed(), NS_OK);
|
||||
|
||||
JSObject* module = JS::CompileModule(aCx, aCompileOptions, aSrcBuf);
|
||||
if (!module) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
aModule.set(module);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsJSUtils::CompileModule(JSContext* aCx,
|
||||
JS::SourceText<char16_t>& aSrcBuf,
|
||||
JS::Handle<JSObject*> aEvaluationGlobal,
|
||||
JS::CompileOptions& aCompileOptions,
|
||||
JS::MutableHandle<JSObject*> aModule) {
|
||||
return CompileJSModule(aCx, aSrcBuf, aEvaluationGlobal, aCompileOptions,
|
||||
aModule);
|
||||
}
|
||||
|
||||
nsresult nsJSUtils::CompileModule(JSContext* aCx,
|
||||
JS::SourceText<Utf8Unit>& aSrcBuf,
|
||||
JS::Handle<JSObject*> aEvaluationGlobal,
|
||||
JS::CompileOptions& aCompileOptions,
|
||||
JS::MutableHandle<JSObject*> aModule) {
|
||||
return CompileJSModule(aCx, aSrcBuf, aEvaluationGlobal, aCompileOptions,
|
||||
aModule);
|
||||
}
|
||||
|
||||
nsresult nsJSUtils::ModuleInstantiate(JSContext* aCx,
|
||||
|
|
|
@ -70,7 +70,17 @@ class nsJSUtils {
|
|||
JS::CompileOptions& aOptions, JS::Handle<JSString*> aElementAttributeName,
|
||||
JS::Handle<JS::Value> aPrivateValue);
|
||||
|
||||
static bool IsScriptable(JS::Handle<JSObject*> aEvaluationGlobal);
|
||||
static nsresult CompileModule(JSContext* aCx,
|
||||
JS::SourceText<char16_t>& aSrcBuf,
|
||||
JS::Handle<JSObject*> aEvaluationGlobal,
|
||||
JS::CompileOptions& aCompileOptions,
|
||||
JS::MutableHandle<JSObject*> aModule);
|
||||
|
||||
static nsresult CompileModule(JSContext* aCx,
|
||||
JS::SourceText<mozilla::Utf8Unit>& aSrcBuf,
|
||||
JS::Handle<JSObject*> aEvaluationGlobal,
|
||||
JS::CompileOptions& aCompileOptions,
|
||||
JS::MutableHandle<JSObject*> aModule);
|
||||
|
||||
static nsresult ModuleInstantiate(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aModule);
|
||||
|
|
|
@ -6,12 +6,4 @@ module.exports = {
|
|||
"plugin:mozilla/chrome-test",
|
||||
"plugin:mozilla/mochitest-test",
|
||||
],
|
||||
overrides: [
|
||||
{
|
||||
files: ["file_module_js_cache.js", "file_script_module_*.js"],
|
||||
parserOptions: {
|
||||
sourceType: "module",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Add a tag module script to save the bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_module_js_cache.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,6 +0,0 @@
|
|||
function baz() {}
|
||||
function bar() {}
|
||||
function foo() {
|
||||
bar();
|
||||
}
|
||||
foo();
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Load the module script as a regular script</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" src="file_module_js_cache.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,12 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Add a tag module script to save the bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_module_js_cache.js"
|
||||
integrity="sha384-1eNjxPXQdMh9pdr8ctqxBCIqiAnwYWzCCIKpcEIWp2MjECaRYx5Iw1TC3p/dx/uj">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme1" type="module" src="file_script_module_dynamic_and_element.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,19 +0,0 @@
|
|||
const { f } = await import(
|
||||
"./file_script_module_dynamic_and_element_imported_1.js"
|
||||
);
|
||||
import { g } from "./file_script_module_dynamic_and_element_imported_2.js";
|
||||
import { h } from "./file_script_module_dynamic_and_element_imported_3.js";
|
||||
f();
|
||||
g();
|
||||
h();
|
||||
|
||||
let script = document.createElement("script");
|
||||
script.id = "watchme2";
|
||||
script.setAttribute("type", "module");
|
||||
script.setAttribute(
|
||||
"src",
|
||||
"file_script_module_dynamic_and_element_imported_1.js"
|
||||
);
|
||||
document.body.appendChild(script);
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,6 +0,0 @@
|
|||
import { g } from "./file_script_module_dynamic_and_element_imported_2.js";
|
||||
import { h } from "./file_script_module_dynamic_and_element_imported_3.js";
|
||||
g();
|
||||
h();
|
||||
|
||||
export function f() {}
|
|
@ -1 +0,0 @@
|
|||
export function g() {}
|
|
@ -1 +0,0 @@
|
|||
export function h() {}
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_dynamic_and_static.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,10 +0,0 @@
|
|||
const { f } = await import(
|
||||
"./file_script_module_dynamic_and_static_imported_1.js"
|
||||
);
|
||||
import { g } from "./file_script_module_dynamic_and_static_imported_2.js";
|
||||
import { h } from "./file_script_module_dynamic_and_static_imported_3.js";
|
||||
f();
|
||||
g();
|
||||
h();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,4 +0,0 @@
|
|||
import { h } from "./file_script_module_dynamic_and_static_imported_3.js";
|
||||
h();
|
||||
|
||||
export function f() {}
|
|
@ -1,4 +0,0 @@
|
|||
import { f } from "./file_script_module_dynamic_and_static_imported_1.js";
|
||||
f();
|
||||
|
||||
export function g() {}
|
|
@ -1 +0,0 @@
|
|||
export function h() {}
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_dynamic_import.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +0,0 @@
|
|||
const { f } = await import("./file_script_module_dynamic_import_imported.js");
|
||||
f();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1 +0,0 @@
|
|||
export function f() {}
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme1" type="module" src="file_script_module_element_and_dynamic_imported_1.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,10 +0,0 @@
|
|||
const { f } = await import(
|
||||
"./file_script_module_element_and_dynamic_imported_1.js"
|
||||
);
|
||||
import { g } from "./file_script_module_element_and_dynamic_imported_2.js";
|
||||
import { h } from "./file_script_module_element_and_dynamic_imported_3.js";
|
||||
f();
|
||||
g();
|
||||
h();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,12 +0,0 @@
|
|||
import { g } from "./file_script_module_element_and_dynamic_imported_2.js";
|
||||
import { h } from "./file_script_module_element_and_dynamic_imported_3.js";
|
||||
g();
|
||||
h();
|
||||
|
||||
export function f() {}
|
||||
|
||||
let script = document.createElement("script");
|
||||
script.id = "watchme2";
|
||||
script.setAttribute("type", "module");
|
||||
script.setAttribute("src", "file_script_module_element_and_dynamic.js");
|
||||
document.body.appendChild(script);
|
|
@ -1 +0,0 @@
|
|||
export function g() {}
|
|
@ -1 +0,0 @@
|
|||
export function h() {}
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme1" type="module" src="file_script_module_element_and_import_imported_1.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,8 +0,0 @@
|
|||
import { f } from "./file_script_module_element_and_import_imported_1.js";
|
||||
import { g } from "./file_script_module_element_and_import_imported_2.js";
|
||||
import { h } from "./file_script_module_element_and_import_imported_3.js";
|
||||
f();
|
||||
g();
|
||||
h();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,12 +0,0 @@
|
|||
import { g } from "./file_script_module_element_and_import_imported_2.js";
|
||||
import { h } from "./file_script_module_element_and_import_imported_3.js";
|
||||
g();
|
||||
h();
|
||||
|
||||
export function f() {}
|
||||
|
||||
let script = document.createElement("script");
|
||||
script.id = "watchme2";
|
||||
script.setAttribute("type", "module");
|
||||
script.setAttribute("src", "file_script_module_element_and_import.js");
|
||||
document.body.appendChild(script);
|
|
@ -1 +0,0 @@
|
|||
export function g() {}
|
|
@ -1 +0,0 @@
|
|||
export function h() {}
|
|
@ -1,15 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode across iframe</title>
|
||||
</head>
|
||||
<body>
|
||||
<iframe id="save" name="save"
|
||||
src="file_script_module_frames_dynamic_save.html"
|
||||
width="50" height="50"></iframe>
|
||||
<iframe id="load" name="load"
|
||||
src="file_script_module_frames_dynamic_load.html"
|
||||
width="50" height="50"></iframe>
|
||||
</body>
|
||||
</html>
|
|
@ -1,19 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode across iframe</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="file_script_module_frames_relay.js"></script>
|
||||
<script type="text/javascript">
|
||||
function doLoad() {
|
||||
const script = document.createElement("script");
|
||||
script.id = "watchme";
|
||||
script.setAttribute("type", "module");
|
||||
script.setAttribute("src", "file_script_module_frames_dynamic_load.js");
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +0,0 @@
|
|||
const { f } = await import("./file_script_module_frames_dynamic_shared.js");
|
||||
f();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,11 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode across iframe</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="file_script_module_frames_relay.js"></script>
|
||||
<script id="watchme" type="module" src="file_script_module_frames_dynamic_save.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +0,0 @@
|
|||
const { f } = await import("./file_script_module_frames_dynamic_shared.js");
|
||||
f();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1 +0,0 @@
|
|||
export function f() {}
|
|
@ -1,15 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode across iframe</title>
|
||||
</head>
|
||||
<body>
|
||||
<iframe id="save" name="save"
|
||||
src="file_script_module_frames_element_save.html"
|
||||
width="50" height="50"></iframe>
|
||||
<iframe id="load" name="load"
|
||||
src="file_script_module_frames_element_load.html"
|
||||
width="50" height="50"></iframe>
|
||||
</body>
|
||||
</html>
|
|
@ -1,19 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode across iframe</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="file_script_module_frames_relay.js"></script>
|
||||
<script type="text/javascript">
|
||||
function doLoad() {
|
||||
const script = document.createElement("script");
|
||||
script.id = "watchme";
|
||||
script.setAttribute("type", "module");
|
||||
script.setAttribute("src", "file_script_module_frames_element_shared.js");
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,11 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode across iframe</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="file_script_module_frames_relay.js"></script>
|
||||
<script id="watchme" type="module" src="file_script_module_frames_element_shared.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1 +0,0 @@
|
|||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,15 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode across iframe</title>
|
||||
</head>
|
||||
<body>
|
||||
<iframe id="save" name="save"
|
||||
src="file_script_module_frames_import_save.html"
|
||||
width="50" height="50"></iframe>
|
||||
<iframe id="load" name="load"
|
||||
src="file_script_module_frames_import_load.html"
|
||||
width="50" height="50"></iframe>
|
||||
</body>
|
||||
</html>
|
|
@ -1,19 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode across iframe</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="file_script_module_frames_relay.js"></script>
|
||||
<script type="text/javascript">
|
||||
function doLoad() {
|
||||
const script = document.createElement("script");
|
||||
script.id = "watchme";
|
||||
script.setAttribute("type", "module");
|
||||
script.setAttribute("src", "file_script_module_frames_import_load.js");
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +0,0 @@
|
|||
import { f } from "./file_script_module_frames_import_shared.js";
|
||||
f();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,11 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode across iframe</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="file_script_module_frames_relay.js"></script>
|
||||
<script id="watchme" type="module" src="file_script_module_frames_import_save.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +0,0 @@
|
|||
import { f } from "./file_script_module_frames_import_shared.js";
|
||||
f();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1 +0,0 @@
|
|||
export function f() {}
|
|
@ -1,22 +0,0 @@
|
|||
function relay(event) {
|
||||
if (event.type != "test_evaluated") {
|
||||
if (!/^watchme/.test(event.target.id)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const type = `${window.name}_${event.type}`;
|
||||
|
||||
window.parent.dispatchEvent(new window.parent.Event(type));
|
||||
}
|
||||
|
||||
window.addEventListener("scriptloader_load_source", relay);
|
||||
window.addEventListener("scriptloader_load_bytecode", relay);
|
||||
window.addEventListener("scriptloader_execute", relay);
|
||||
window.addEventListener("scriptloader_evaluate_module", relay);
|
||||
window.addEventListener("scriptloader_encode", relay);
|
||||
window.addEventListener("scriptloader_no_encode", relay);
|
||||
window.addEventListener("scriptloader_bytecode_saved", relay);
|
||||
window.addEventListener("scriptloader_bytecode_failed", relay);
|
||||
window.addEventListener("scriptloader_fallback", relay);
|
||||
window.addEventListener("test_evaluated", relay);
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_import.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +0,0 @@
|
|||
import { f } from "./file_script_module_import_imported.js";
|
||||
f();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme1" type="module" src="file_script_module_import_and_element.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,17 +0,0 @@
|
|||
import { f } from "./file_script_module_import_and_element_imported_1.js";
|
||||
import { g } from "./file_script_module_import_and_element_imported_2.js";
|
||||
import { h } from "./file_script_module_import_and_element_imported_3.js";
|
||||
f();
|
||||
g();
|
||||
h();
|
||||
|
||||
let script = document.createElement("script");
|
||||
script.id = "watchme2";
|
||||
script.setAttribute("type", "module");
|
||||
script.setAttribute(
|
||||
"src",
|
||||
"file_script_module_import_and_element_imported_1.js"
|
||||
);
|
||||
document.body.appendChild(script);
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,6 +0,0 @@
|
|||
import { g } from "./file_script_module_import_and_element_imported_2.js";
|
||||
import { h } from "./file_script_module_import_and_element_imported_3.js";
|
||||
g();
|
||||
h();
|
||||
|
||||
export function f() {}
|
|
@ -1 +0,0 @@
|
|||
export function g() {}
|
|
@ -1 +0,0 @@
|
|||
export function h() {}
|
|
@ -1 +0,0 @@
|
|||
export function f() {}
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_import_multi.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,6 +0,0 @@
|
|||
import { f } from "./file_script_module_import_multi_imported_once.js";
|
||||
import { g } from "./file_script_module_import_multi_imported_twice.js";
|
||||
f();
|
||||
g();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,11 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme1" type="module" src="file_script_module_import_multi_elems_1.js"></script>
|
||||
<script id="watchme2" type="module" src="file_script_module_import_multi_elems_2.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,6 +0,0 @@
|
|||
import { f } from "./file_script_module_import_multi_elems_imported_once_1.js";
|
||||
import { h } from "./file_script_module_import_multi_elems_imported_twice.js";
|
||||
f();
|
||||
h();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,6 +0,0 @@
|
|||
import { g } from "./file_script_module_import_multi_elems_imported_once_2.js";
|
||||
import { h } from "./file_script_module_import_multi_elems_imported_twice.js";
|
||||
g();
|
||||
h();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1 +0,0 @@
|
|||
export function f() {}
|
|
@ -1 +0,0 @@
|
|||
export function g() {}
|
|
@ -1 +0,0 @@
|
|||
export function i() {}
|
|
@ -1,3 +0,0 @@
|
|||
import { i } from "./file_script_module_import_multi_elems_imported_once_3.js";
|
||||
i();
|
||||
export function h() {}
|
|
@ -1,4 +0,0 @@
|
|||
import { g } from "./file_script_module_import_multi_imported_twice.js";
|
||||
g();
|
||||
|
||||
export function f() {}
|
|
@ -1 +0,0 @@
|
|||
export function g() {}
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_single.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,8 +0,0 @@
|
|||
function baz() {}
|
||||
function bar() {}
|
||||
function foo() {
|
||||
bar();
|
||||
}
|
||||
foo();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,11 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_basic.js"
|
||||
integrity="sha384-pZxhwO9umoHSuKzSRL6hi9YhRb70RfGdRnchu/zp5gbUCOC/x7NAWUPxxuv0DJoZ"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1 +0,0 @@
|
|||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,11 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_basic.js"
|
||||
integrity="sha384-pZxhwO9umoHSuKzSRL6hi9YhRb70RfGdRnchu/zp5gbUCOC/x7NAWUPxxuv0DJoZ"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,12 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme1" type="module" src="file_script_module_sri_dynamic_elem.js"></script>
|
||||
<script id="watchme2" type="module" src="file_script_module_sri_dynamic_elem_imported.js"
|
||||
integrity="sha384-3XSIfAj4/GALfWzL3T89+t3eaLIY59g8IWz1qq59xKnEW3aGd4cz7XvdcYqoK2+J"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +0,0 @@
|
|||
const { f } = await import("./file_script_module_sri_dynamic_elem_imported.js");
|
||||
f();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,3 +0,0 @@
|
|||
export function f() {}
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_dynamic_elem_nopreload.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,20 +0,0 @@
|
|||
const { f } = await import(
|
||||
"./file_script_module_sri_dynamic_elem_nopreload_imported.js"
|
||||
);
|
||||
f();
|
||||
|
||||
// Dynamically insert the script element in order to suppress preload.
|
||||
const script = document.createElement("script");
|
||||
script.id = "watchme2";
|
||||
script.setAttribute("type", "module");
|
||||
script.setAttribute(
|
||||
"src",
|
||||
"file_script_module_sri_dynamic_elem_nopreload_imported.js"
|
||||
);
|
||||
script.setAttribute(
|
||||
"integrity",
|
||||
"sha384-3XSIfAj4/GALfWzL3T89+t3eaLIY59g8IWz1qq59xKnEW3aGd4cz7XvdcYqoK2+J"
|
||||
);
|
||||
document.body.appendChild(script);
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,3 +0,0 @@
|
|||
export function f() {}
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_dynamic_elem_nopreload_imported.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_dynamic_elem_imported.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,12 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme1" type="module" src="file_script_module_sri_elem_dynamic_imported.js"
|
||||
integrity="sha384-3XSIfAj4/GALfWzL3T89+t3eaLIY59g8IWz1qq59xKnEW3aGd4cz7XvdcYqoK2+J"></script>
|
||||
<script id="watchme2" type="module" src="file_script_module_sri_elem_dynamic.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +0,0 @@
|
|||
const { f } = await import("./file_script_module_sri_elem_dynamic_imported.js");
|
||||
f();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,3 +0,0 @@
|
|||
export function f() {}
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_elem_dynamic_imported.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,12 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme1" type="module" src="file_script_module_sri_elem_elem_1.js"></script>
|
||||
<script id="watchme2" type="module" src="file_script_module_sri_elem_elem_1.js"
|
||||
integrity="sha384-pZxhwO9umoHSuKzSRL6hi9YhRb70RfGdRnchu/zp5gbUCOC/x7NAWUPxxuv0DJoZ"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1 +0,0 @@
|
|||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_elem_elem_1.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,12 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme1" type="module" src="file_script_module_sri_elem_elem_2.js"
|
||||
integrity="sha384-pZxhwO9umoHSuKzSRL6hi9YhRb70RfGdRnchu/zp5gbUCOC/x7NAWUPxxuv0DJoZ"></script>
|
||||
<script id="watchme2" type="module" src="file_script_module_sri_elem_elem_2.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1 +0,0 @@
|
|||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_elem_elem_2.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,12 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme1" type="module" src="file_script_module_sri_elem_import_imported.js"
|
||||
integrity="sha384-3XSIfAj4/GALfWzL3T89+t3eaLIY59g8IWz1qq59xKnEW3aGd4cz7XvdcYqoK2+J"></script>
|
||||
<script id="watchme2" type="module" src="file_script_module_sri_elem_import.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,4 +0,0 @@
|
|||
import { f } from "./file_script_module_sri_elem_import_imported.js";
|
||||
f();
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,3 +0,0 @@
|
|||
export function f() {}
|
||||
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_elem_import_imported.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,11 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_fallback.js"
|
||||
integrity="sha384-pZxhwO9umoHSuKzSRL6hi9YhRb70RfGdRnchu/zp5gbUCOC/x7NAWUPxxuv0DJoZ"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1 +0,0 @@
|
|||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,15 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_fallback_failure.js"
|
||||
integrity="sha384-wronghash"></script>
|
||||
<script type="text/javascript">
|
||||
// The above script isn't evaluated because of wrong integrity.
|
||||
window.dispatchEvent(new Event("test_evaluated"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1 +0,0 @@
|
|||
window.dispatchEvent(new Event("test_evaluated"));
|
|
@ -1,10 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test module script bytecode fallback</title>
|
||||
</head>
|
||||
<body>
|
||||
<script id="watchme" type="module" src="file_script_module_sri_fallback_failure.js"></script>
|
||||
</body>
|
||||
</html>
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче