aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlscriptelement.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-01-13 14:02:26 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2017-01-14 14:53:04 +0100
commit91717ab17cbcfec3fc5125e0f1345e77467199bf (patch)
tree228029be7ef470394a451852c56829902a18bfea /components/script/dom/htmlscriptelement.rs
parent89c210f2c8974f5575047fdab6f2b7bc640c684b (diff)
downloadservo-91717ab17cbcfec3fc5125e0f1345e77467199bf.tar.gz
servo-91717ab17cbcfec3fc5125e0f1345e77467199bf.zip
Implement HTMLScriptElement async attribute
Diffstat (limited to 'components/script/dom/htmlscriptelement.rs')
-rw-r--r--components/script/dom/htmlscriptelement.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs
index cf0d3c6cf94..08774681c71 100644
--- a/components/script/dom/htmlscriptelement.rs
+++ b/components/script/dom/htmlscriptelement.rs
@@ -685,6 +685,17 @@ impl HTMLScriptElementMethods for HTMLScriptElement {
// https://html.spec.whatwg.org/multipage/#dom-script-charset
make_setter!(SetCharset, "charset");
+ // https://html.spec.whatwg.org/multipage/#dom-script-async
+ fn Async(&self) -> bool {
+ self.non_blocking.get() || self.upcast::<Element>().has_attribute(&local_name!("async"))
+ }
+
+ // https://html.spec.whatwg.org/multipage/#dom-script-async
+ fn SetAsync(&self, value: bool) {
+ self.non_blocking.set(false);
+ self.upcast::<Element>().set_bool_attribute(&local_name!("async"), value);
+ }
+
// https://html.spec.whatwg.org/multipage/#dom-script-defer
make_bool_getter!(Defer, "defer");
// https://html.spec.whatwg.org/multipage/#dom-script-defer