aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/htmlscriptelement.rs11
-rw-r--r--components/script/dom/webidls/HTMLScriptElement.webidl2
-rw-r--r--tests/wpt/metadata/html/browsers/windows/noreferrer.html.ini2
-rw-r--r--tests/wpt/metadata/html/dom/interfaces.html.ini6
-rw-r--r--tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_001.htm.ini5
-rw-r--r--tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_002.htm.ini5
-rw-r--r--tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_007.htm.ini5
-rw-r--r--tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_010.htm.ini5
-rw-r--r--tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_011.htm.ini5
-rw-r--r--tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/091.html.ini5
-rw-r--r--tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/105.html.ini5
-rw-r--r--tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/122.html.ini5
-rw-r--r--tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/123.html.ini5
-rw-r--r--tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/126.html.ini5
14 files changed, 12 insertions, 59 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
diff --git a/components/script/dom/webidls/HTMLScriptElement.webidl b/components/script/dom/webidls/HTMLScriptElement.webidl
index 0dcc9ddf69a..8a1dbc3fc35 100644
--- a/components/script/dom/webidls/HTMLScriptElement.webidl
+++ b/components/script/dom/webidls/HTMLScriptElement.webidl
@@ -7,7 +7,7 @@ interface HTMLScriptElement : HTMLElement {
attribute DOMString src;
attribute DOMString type;
attribute DOMString charset;
- // attribute boolean async;
+ attribute boolean async;
attribute boolean defer;
attribute DOMString? crossOrigin;
[Pure]
diff --git a/tests/wpt/metadata/html/browsers/windows/noreferrer.html.ini b/tests/wpt/metadata/html/browsers/windows/noreferrer.html.ini
index cebf2866f0b..b8029523a08 100644
--- a/tests/wpt/metadata/html/browsers/windows/noreferrer.html.ini
+++ b/tests/wpt/metadata/html/browsers/windows/noreferrer.html.ini
@@ -1,5 +1,3 @@
[noreferrer.html]
type: testharness
disabled: https://github.com/servo/servo/issues/13400
-
-
diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini
index 4de1ed5423f..8576eadbd53 100644
--- a/tests/wpt/metadata/html/dom/interfaces.html.ini
+++ b/tests/wpt/metadata/html/dom/interfaces.html.ini
@@ -3855,12 +3855,6 @@
[HTMLDialogElement interface: operation showModal([object Object\],[object Object\])]
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)]
expected: FAIL
diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_001.htm.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_001.htm.ini
deleted file mode 100644
index 77fa829310b..00000000000
--- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_001.htm.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[async_001.htm]
- type: testharness
- [Async property on a dynamically-created script is true by default]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_002.htm.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_002.htm.ini
deleted file mode 100644
index be9ad86414d..00000000000
--- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_002.htm.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[async_002.htm]
- type: testharness
- [Test 'async' attribute are reflected in the async property with setAttribute]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_007.htm.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_007.htm.ini
deleted file mode 100644
index 4c172e8c287..00000000000
--- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_007.htm.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[async_007.htm]
- type: testharness
- [Ordered async script execution when script.async == false]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_010.htm.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_010.htm.ini
deleted file mode 100644
index 5a6b14ef51c..00000000000
--- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_010.htm.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[async_010.htm]
- type: testharness
- [Removing an async script before execution]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_011.htm.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_011.htm.ini
deleted file mode 100644
index 287e8853b21..00000000000
--- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_011.htm.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[async_011.htm]
- type: testharness
- [An empty parser-inserted script element should return async=true]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/091.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/091.html.ini
deleted file mode 100644
index 0005354951a..00000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/091.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[091.html]
- type: testharness
- [ scheduler: force-async off on non-parser-inserted script]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/105.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/105.html.ini
deleted file mode 100644
index 253a757e9a1..00000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/105.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[105.html]
- type: testharness
- [ scheduler: adding async attribute at runtime]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/122.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/122.html.ini
deleted file mode 100644
index 6432a9d5140..00000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/122.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[122.html]
- type: testharness
- [Reinserted script async IDL attribute]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/123.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/123.html.ini
deleted file mode 100644
index cb08c989a08..00000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/123.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[123.html]
- type: testharness
- [scheduler: altering the type attribute and adding/removing external script with async=false ]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/126.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/126.html.ini
deleted file mode 100644
index f4bb635c593..00000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/126.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[126.html]
- type: testharness
- [scheduler: altering the type attribute and changing script data external script async=false ]
- expected: FAIL
-