aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCYBAI <cyb.ai.815@gmail.com>2019-11-29 12:21:55 +0900
committerCYBAI <cyb.ai.815@gmail.com>2020-01-03 13:04:21 +0900
commit1cc6435cfcf8ae2234fd7343491f3d943fdf4eeb (patch)
tree9befd88836c1c3ab0d28397d6d353efd3a1666ec
parent5c9536acdc8aed056fa91e0e3cffd3e3e0b0ad03 (diff)
downloadservo-1cc6435cfcf8ae2234fd7343491f3d943fdf4eeb.tar.gz
servo-1cc6435cfcf8ae2234fd7343491f3d943fdf4eeb.zip
Implement nomodule attribute
-rw-r--r--components/script/dom/htmlscriptelement.rs10
-rw-r--r--components/script/dom/webidls/HTMLScriptElement.webidl2
2 files changed, 11 insertions, 1 deletions
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs
index 8285b26605d..3a55590c81d 100644
--- a/components/script/dom/htmlscriptelement.rs
+++ b/components/script/dom/htmlscriptelement.rs
@@ -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")) &&
@@ -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
diff --git a/components/script/dom/webidls/HTMLScriptElement.webidl b/components/script/dom/webidls/HTMLScriptElement.webidl
index f7126b7901b..13b69865fa5 100644
--- a/components/script/dom/webidls/HTMLScriptElement.webidl
+++ b/components/script/dom/webidls/HTMLScriptElement.webidl
@@ -12,6 +12,8 @@ interface HTMLScriptElement : HTMLElement {
[CEReactions]
attribute DOMString type;
[CEReactions]
+ attribute boolean noModule;
+ [CEReactions]
attribute DOMString charset;
[CEReactions]
attribute boolean async;