You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 12. Otherwise, return. (No script is executed, and el's type is left as null.)
245
+
// FIXME: 12. Otherwise, if the script block's type string is an ASCII case-insensitive match for the string "speculationrules", then set el's type to "speculationrules".
246
+
// 13. Otherwise, return. (No script is executed, and el's type is left as null.)
246
247
else {
247
248
VERIFY(m_script_type == ScriptType::Null);
248
249
return;
249
250
}
250
251
251
-
//13. If parser document is non-null, then set el's parser document back to parser document and set el's force async to false.
252
+
//14. If parser document is non-null, then set el's parser document back to parser document and set el's force async to false.
252
253
if (parser_document) {
253
254
m_parser_document = parser_document;
254
255
m_force_async = false;
255
256
}
256
257
257
-
//14. Set el's already started to true.
258
+
//15. Set el's already started to true.
258
259
m_already_started = true;
259
260
260
-
//15. Set el's preparation-time document to its node document.
261
+
//16. Set el's preparation-time document to its node document.
261
262
m_preparation_time_document = &document();
262
263
263
-
//16. If parser document is non-null, and parser document is not equal to el's preparation-time document, then return.
264
+
//17. If parser document is non-null, and parser document is not equal to el's preparation-time document, then return.
264
265
if (parser_document != nullptr && parser_document != m_preparation_time_document) {
265
266
dbgln("HTMLScriptElement: Refusing to run script because the parser document is not the same as the preparation time document.");
266
267
return;
267
268
}
268
269
269
-
//17. If scripting is disabled for el, then return.
270
+
//18. If scripting is disabled for el, then return.
270
271
if (is_scripting_disabled()) {
271
272
dbgln("HTMLScriptElement: Refusing to run script because scripting is disabled.");
272
273
return;
273
274
}
274
275
275
-
//18. If el has a nomodule content attribute and its type is "classic", then return.
276
+
//19. If el has a nomodule content attribute and its type is "classic", then return.
276
277
if (m_script_type == ScriptType::Classic && has_attribute(HTML::AttributeNames::nomodule)) {
277
278
dbgln("HTMLScriptElement: Refusing to run classic script because it has the nomodule attribute.");
278
279
return;
279
280
}
280
281
281
-
// 19. If el does not have a src content attribute, and the Should element's inline behavior be blocked by Content Security Policy?
282
-
// algorithm returns "Blocked" when given el, "script", and source text, then return. [CSP]
282
+
// FIXME: 20. Let cspType be "script speculationrules" if el's type is "speculationrules"; otherwise, "script".
283
+
284
+
// 21. If el does not have a src content attribute, and the Should element's inline behavior be blocked by Content
285
+
// Security Policy? algorithm returns "Blocked" when given el, cspType, and source text, then return [CSP]
//22. Let classic script CORS setting be the current state of el's crossorigin content attribute.
334
+
//24. Let classic script CORS setting be the current state of el's crossorigin content attribute.
332
335
auto classic_script_cors_setting = m_crossorigin;
333
336
334
-
//23. Let module script credentials mode be the CORS settings attribute credentials mode for el's crossorigin content attribute.
337
+
//25. Let module script credentials mode be the CORS settings attribute credentials mode for el's crossorigin content attribute.
335
338
auto module_script_credential_mode = cors_settings_attribute_credentials_mode(m_crossorigin);
336
339
337
-
//24. Let cryptographic nonce be el's [[CryptographicNonce]] internal slot's value.
340
+
//26. Let cryptographic nonce be el's [[CryptographicNonce]] internal slot's value.
338
341
auto cryptographic_nonce = m_cryptographic_nonce;
339
342
340
-
//25. If el has an integrity attribute, then let integrity metadata be that attribute's value.
343
+
//27. If el has an integrity attribute, then let integrity metadata be that attribute's value.
341
344
// Otherwise, let integrity metadata be the empty string.
342
345
String integrity_metadata;
343
346
if (auto maybe_integrity = attribute(HTML::AttributeNames::integrity); maybe_integrity.has_value()) {
344
347
integrity_metadata = *maybe_integrity;
345
348
}
346
349
347
-
//26. Let referrer policy be the current state of el's referrerpolicy content attribute.
350
+
//28. Let referrer policy be the current state of el's referrerpolicy content attribute.
348
351
auto referrer_policy = m_referrer_policy;
349
352
350
-
//27. Let fetch priority be the current state of el's fetchpriority content attribute.
353
+
//29. Let fetch priority be the current state of el's fetchpriority content attribute.
351
354
auto fetch_priority = Fetch::Infrastructure::request_priority_from_string(get_attribute_value(HTML::AttributeNames::fetchpriority)).value_or(Fetch::Infrastructure::Request::Priority::Auto);
352
355
353
-
//28. Let parser metadata be "parser-inserted" if el is parser-inserted, and "not-parser-inserted" otherwise.
356
+
//30. Let parser metadata be "parser-inserted" if el is parser-inserted, and "not-parser-inserted" otherwise.
0 commit comments