Bug 1330900 - Implement <script nomodule>, r=bz

This patch implements:
. noModule getter/setter for HTMLScriptElement
. the nomodule attribute for HTMLScriptElement
. and the logic in nsScriptLoader that denies the loading of a nomodule script
. with tests
This commit is contained in:
Andrea Marchesini
2017-05-04 10:24:13 +02:00
parent 74d54d706a
commit f43968bde0
9 changed files with 164 additions and 2 deletions

View File

@@ -220,6 +220,18 @@ HTMLScriptElement::SetAsync(bool aValue, ErrorResult& rv)
SetHTMLBoolAttr(nsGkAtoms::async, aValue, rv);
}
bool
HTMLScriptElement::NoModule()
{
return GetBoolAttr(nsGkAtoms::nomodule);
}
void
HTMLScriptElement::SetNoModule(bool aValue, ErrorResult& aRv)
{
SetHTMLBoolAttr(nsGkAtoms::nomodule, aValue, aRv);
}
nsresult
HTMLScriptElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
const nsAttrValue* aValue, bool aNotify)