mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Support integrity
for module script
This commit is contained in:
parent
f2007751dd
commit
cfad32cffd
2 changed files with 6 additions and 0 deletions
|
@ -582,6 +582,7 @@ impl HTMLScriptElement {
|
||||||
ModuleOwner::Window(Trusted::new(self)),
|
ModuleOwner::Window(Trusted::new(self)),
|
||||||
url.clone(),
|
url.clone(),
|
||||||
Destination::Script,
|
Destination::Script,
|
||||||
|
integrity_metadata.to_owned(),
|
||||||
);
|
);
|
||||||
|
|
||||||
if !r#async && was_parser_inserted {
|
if !r#async && was_parser_inserted {
|
||||||
|
|
|
@ -1095,6 +1095,7 @@ pub fn fetch_external_module_script(
|
||||||
owner: ModuleOwner,
|
owner: ModuleOwner,
|
||||||
url: ServoUrl,
|
url: ServoUrl,
|
||||||
destination: Destination,
|
destination: Destination,
|
||||||
|
integrity_metadata: String,
|
||||||
) -> Rc<Promise> {
|
) -> Rc<Promise> {
|
||||||
// Step 1.
|
// Step 1.
|
||||||
fetch_single_module_script(
|
fetch_single_module_script(
|
||||||
|
@ -1103,6 +1104,7 @@ pub fn fetch_external_module_script(
|
||||||
destination,
|
destination,
|
||||||
Referrer::Client,
|
Referrer::Client,
|
||||||
ParserMetadata::NotParserInserted,
|
ParserMetadata::NotParserInserted,
|
||||||
|
integrity_metadata,
|
||||||
None,
|
None,
|
||||||
true,
|
true,
|
||||||
)
|
)
|
||||||
|
@ -1115,6 +1117,7 @@ pub fn fetch_single_module_script(
|
||||||
destination: Destination,
|
destination: Destination,
|
||||||
referrer: Referrer,
|
referrer: Referrer,
|
||||||
parser_metadata: ParserMetadata,
|
parser_metadata: ParserMetadata,
|
||||||
|
integrity_metadata: String,
|
||||||
parent_url: Option<ServoUrl>,
|
parent_url: Option<ServoUrl>,
|
||||||
top_level_module_fetch: bool,
|
top_level_module_fetch: bool,
|
||||||
) -> Rc<Promise> {
|
) -> Rc<Promise> {
|
||||||
|
@ -1209,6 +1212,7 @@ pub fn fetch_single_module_script(
|
||||||
.origin(global.origin().immutable().clone())
|
.origin(global.origin().immutable().clone())
|
||||||
.referrer(Some(referrer))
|
.referrer(Some(referrer))
|
||||||
.parser_metadata(parser_metadata)
|
.parser_metadata(parser_metadata)
|
||||||
|
.integrity_metadata(integrity_metadata.clone())
|
||||||
.mode(mode);
|
.mode(mode);
|
||||||
|
|
||||||
let context = Arc::new(Mutex::new(ModuleContext {
|
let context = Arc::new(Mutex::new(ModuleContext {
|
||||||
|
@ -1395,6 +1399,7 @@ fn fetch_module_descendants(
|
||||||
destination.clone(),
|
destination.clone(),
|
||||||
Referrer::Client,
|
Referrer::Client,
|
||||||
ParserMetadata::NotParserInserted,
|
ParserMetadata::NotParserInserted,
|
||||||
|
"".to_owned(),
|
||||||
Some(module_tree.url.clone()),
|
Some(module_tree.url.clone()),
|
||||||
false,
|
false,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue