mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-02 13:58:40 +09:00
Bug 1330900 - Implement <script nomodule>
This patch implements: - noModule getter/setter for HTMLScriptElement - the nomodule attribute for HTMLScriptElement - the logic in nsScriptLoader that denies the loading of a nomodule script - tests Tag #618
This commit is contained in:
parent
9a89373299
commit
10b2e09718
9 changed files with 164 additions and 2 deletions
|
|
@ -1459,7 +1459,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
|||
|
||||
nsCOMPtr<nsIContent> scriptContent = do_QueryInterface(aElement);
|
||||
|
||||
// Step 12. Check that the script is not an eventhandler
|
||||
// Step 13. Check that the script is not an eventhandler
|
||||
if (IsScriptEventHandler(scriptContent)) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1493,7 +1493,18 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
|
|||
}
|
||||
}
|
||||
|
||||
// Step 14. in the HTML5 spec
|
||||
// "In modern user agents that support module scripts, the script element with
|
||||
// the nomodule attribute will be ignored".
|
||||
// "The nomodule attribute must not be specified on module scripts (and will
|
||||
// be ignored if it is)."
|
||||
if (ModuleScriptsEnabled() &&
|
||||
scriptKind == nsScriptKind::Classic &&
|
||||
scriptContent->IsHTMLElement() &&
|
||||
scriptContent->HasAttr(kNameSpaceID_None, nsGkAtoms::nomodule)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Step 15. and later in the HTML5 spec
|
||||
nsresult rv = NS_OK;
|
||||
RefPtr<nsScriptLoadRequest> request;
|
||||
if (aElement->GetScriptExternal()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue