Skip to content

Commit

Permalink
Implement nomodule attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
CYBAI committed Jan 3, 2020
1 parent 5c9536a commit 1cc6435
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/script/dom/htmlscriptelement.rs
Expand Up @@ -447,7 +447,10 @@ impl HTMLScriptElement {
return;
}

// TODO: Step 12: nomodule content attribute
// Step 12
if element.has_attribute(&local_name!("nomodule")) && script_type == ScriptType::Classic {
return;
}

// Step 13.
if !element.has_attribute(&local_name!("src")) &&
Expand Down Expand Up @@ -1062,6 +1065,11 @@ impl HTMLScriptElementMethods for HTMLScriptElement {
// https://html.spec.whatwg.org/multipage/#dom-script-defer
make_bool_setter!(SetDefer, "defer");

// https://html.spec.whatwg.org/multipage/#dom-script-nomodule
make_bool_getter!(NoModule, "nomodule");
// https://html.spec.whatwg.org/multipage/#dom-script-nomodule
make_bool_setter!(SetNoModule, "nomodule");

// https://html.spec.whatwg.org/multipage/#dom-script-integrity
make_getter!(Integrity, "integrity");
// https://html.spec.whatwg.org/multipage/#dom-script-integrity
Expand Down
2 changes: 2 additions & 0 deletions components/script/dom/webidls/HTMLScriptElement.webidl
Expand Up @@ -11,6 +11,8 @@ interface HTMLScriptElement : HTMLElement {
attribute USVString src;
[CEReactions]
attribute DOMString type;
[CEReactions]
attribute boolean noModule;
[CEReactions]
attribute DOMString charset;
[CEReactions]
Expand Down

0 comments on commit 1cc6435

Please sign in to comment.