mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Implement HTMLScriptElement async attribute
This commit is contained in:
parent
89c210f2c8
commit
91717ab17c
14 changed files with 12 additions and 59 deletions
|
@ -685,6 +685,17 @@ impl HTMLScriptElementMethods for HTMLScriptElement {
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-script-charset
|
// https://html.spec.whatwg.org/multipage/#dom-script-charset
|
||||||
make_setter!(SetCharset, "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
|
// https://html.spec.whatwg.org/multipage/#dom-script-defer
|
||||||
make_bool_getter!(Defer, "defer");
|
make_bool_getter!(Defer, "defer");
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-script-defer
|
// https://html.spec.whatwg.org/multipage/#dom-script-defer
|
||||||
|
|
|
@ -7,7 +7,7 @@ interface HTMLScriptElement : HTMLElement {
|
||||||
attribute DOMString src;
|
attribute DOMString src;
|
||||||
attribute DOMString type;
|
attribute DOMString type;
|
||||||
attribute DOMString charset;
|
attribute DOMString charset;
|
||||||
// attribute boolean async;
|
attribute boolean async;
|
||||||
attribute boolean defer;
|
attribute boolean defer;
|
||||||
attribute DOMString? crossOrigin;
|
attribute DOMString? crossOrigin;
|
||||||
[Pure]
|
[Pure]
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
[noreferrer.html]
|
[noreferrer.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
disabled: https://github.com/servo/servo/issues/13400
|
disabled: https://github.com/servo/servo/issues/13400
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3855,12 +3855,6 @@
|
||||||
[HTMLDialogElement interface: operation showModal([object Object\],[object Object\])]
|
[HTMLDialogElement interface: operation showModal([object Object\],[object Object\])]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[HTMLScriptElement interface: attribute async]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[HTMLScriptElement interface: document.createElement("script") must inherit property "async" with the proper type (3)]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[HTMLCanvasElement interface: operation probablySupportsContext(DOMString,any)]
|
[HTMLCanvasElement interface: operation probablySupportsContext(DOMString,any)]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[async_001.htm]
|
|
||||||
type: testharness
|
|
||||||
[Async property on a dynamically-created script is true by default]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[async_002.htm]
|
|
||||||
type: testharness
|
|
||||||
[Test 'async' attribute are reflected in the async property with setAttribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[async_007.htm]
|
|
||||||
type: testharness
|
|
||||||
[Ordered async script execution when script.async == false]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[async_010.htm]
|
|
||||||
type: testharness
|
|
||||||
[Removing an async script before execution]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[async_011.htm]
|
|
||||||
type: testharness
|
|
||||||
[An empty parser-inserted script element should return async=true]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[091.html]
|
|
||||||
type: testharness
|
|
||||||
[ scheduler: force-async off on non-parser-inserted script]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[105.html]
|
|
||||||
type: testharness
|
|
||||||
[ scheduler: adding async attribute at runtime]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[122.html]
|
|
||||||
type: testharness
|
|
||||||
[Reinserted script async IDL attribute]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[123.html]
|
|
||||||
type: testharness
|
|
||||||
[scheduler: altering the type attribute and adding/removing external script with async=false ]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[126.html]
|
|
||||||
type: testharness
|
|
||||||
[scheduler: altering the type attribute and changing script data external script async=false ]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue