Implement HTMLScriptElement async attribute

This commit is contained in:
Anthony Ramine 2017-01-13 14:02:26 +01:00
parent 89c210f2c8
commit 91717ab17c
14 changed files with 12 additions and 59 deletions

View file

@ -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