Bug 1899172 - Part 3: Add ScriptLoadContext::GetHintCharset. r=nbp

Differential Revision: https://phabricator.services.mozilla.com/D211903
This commit is contained in:
Tooru Fujisawa
2024-05-30 05:01:15 +00:00
parent c65d297f07
commit c8e79647f8
4 changed files with 8 additions and 4 deletions

View File

@@ -807,8 +807,7 @@ nsresult ScriptLoader::PrepareHttpRequestAndInitiatorType(
nsAutoString hintCharset;
if (!aRequest->GetScriptLoadContext()->IsPreload() &&
aRequest->GetScriptLoadContext()->GetScriptElement()) {
aRequest->GetScriptLoadContext()->GetScriptElement()->GetScriptCharset(
hintCharset);
aRequest->GetScriptLoadContext()->GetHintCharset(hintCharset);
} else if (aCharsetForPreload.isSome()) {
hintCharset = aCharsetForPreload.ref();
}