diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 10ce0f3bf28..3a96d369c23 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -3271,8 +3271,7 @@ impl DocumentMethods for Document { // Step 2. // TODO: handle throw-on-dynamic-markup-insertion counter. - // FIXME: this should check for being active rather than fully active - if !self.is_fully_active() { + if !self.is_active() { // Step 3. return Ok(()); } diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 44fc267b2bd..2bdb75a486f 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1304,6 +1304,7 @@ impl ScriptThread { /// Handles activity change message fn handle_set_document_activity_msg(&self, id: PipelineId, activity: DocumentActivity) { + debug!("Setting activity of {} to be {:?}.", id, activity); let document = self.documents.borrow().find_document(id); if let Some(document) = document { document.set_activity(activity); diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 82c13ee87e5..51d045d6c52 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -45873,6 +45873,12 @@ "url": "/cssom/stylesheet-same-origin.sub.html" } ], + "html/dom/dynamic-markup-insertion/document-write/write-active-document.html": [ + { + "path": "html/dom/dynamic-markup-insertion/document-write/write-active-document.html", + "url": "/html/dom/dynamic-markup-insertion/document-write/write-active-document.html" + } + ], "html/semantics/embedded-content/the-iframe-element/iframe-synchronously-discard.html": [ { "path": "html/semantics/embedded-content/the-iframe-element/iframe-synchronously-discard.html", diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/write-active-document.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/write-active-document.html.ini new file mode 100644 index 00000000000..09620a4a26b --- /dev/null +++ b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/write-active-document.html.ini @@ -0,0 +1,4 @@ +[write-active-document.html] + type: testharness + [document.write only writes to active documents] + expected: FAIL diff --git a/tests/wpt/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/empty.html b/tests/wpt/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/empty.html new file mode 100644 index 00000000000..0dc101b5335 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/empty.html @@ -0,0 +1 @@ + diff --git a/tests/wpt/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/write-active-document.html b/tests/wpt/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/write-active-document.html new file mode 100644 index 00000000000..6faffd81de4 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/write-active-document.html @@ -0,0 +1,35 @@ + +document.write only writes to active documents + + +
+