diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 6a30721166ad..6df47b9ecdcc 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -281,6 +281,8 @@ pub struct Document { /// https://w3c.github.io/uievents/#event-type-dblclick #[ignore_heap_size_of = "Defined in std"] last_click_info: DOMRefCell)>>, + /// https://html.spec.whatwg.org/multipage/#ignore-destructive-writes-counter + ignore_destructive_writes_counter: Cell, } #[derive(JSTraceable, HeapSizeOf)] @@ -372,15 +374,16 @@ impl Document { self.trigger_mozbrowser_event(MozBrowserEvent::SecurityChange(https_state)); } + // https://html.spec.whatwg.org/multipage/#active-document + pub fn is_active(&self) -> bool { + self.browsing_context().map_or(false, |context| { + self == &*context.active_document() + }) + } + // https://html.spec.whatwg.org/multipage/#fully-active pub fn is_fully_active(&self) -> bool { - let browsing_context = match self.browsing_context() { - Some(browsing_context) => browsing_context, - None => return false, - }; - let active_document = browsing_context.active_document(); - - if self != &*active_document { + if !self.is_active() { return false; } // FIXME: It should also check whether the browser context is top-level or not @@ -1877,6 +1880,7 @@ impl Document { referrer_policy: Cell::new(referrer_policy), target_element: MutNullableHeap::new(None), last_click_info: DOMRefCell::new(None), + ignore_destructive_writes_counter: Default::default(), } } @@ -2053,6 +2057,16 @@ impl Document { ReflowQueryType::NoQuery, ReflowReason::ElementStateChanged); } + + pub fn incr_ignore_destructive_writes_counter(&self) { + self.ignore_destructive_writes_counter.set( + self.ignore_destructive_writes_counter.get() + 1); + } + + pub fn decr_ignore_destructive_writes_counter(&self) { + self.ignore_destructive_writes_counter.set( + self.ignore_destructive_writes_counter.get() - 1); + } } @@ -3019,6 +3033,55 @@ impl DocumentMethods for Document { elements } + // https://html.spec.whatwg.org/multipage/#dom-document-write + fn Write(&self, text: Vec) -> ErrorResult { + if !self.is_html_document() { + // Step 1. + return Err(Error::InvalidState); + } + + // Step 2. + // TODO: handle throw-on-dynamic-markup-insertion counter. + + if !self.is_active() { + // Step 3. + return Ok(()); + } + + let parser = self.get_current_parser(); + let parser = match parser.as_ref() { + Some(parser) if parser.script_nesting_level() > 0 => parser, + _ => { + // Either there is no parser, which means the parsing ended; + // or script nesting level is 0, which means the method was + // called from outside a parser-executed script. + if self.ignore_destructive_writes_counter.get() > 0 { + // Step 4. + // TODO: handle ignore-opens-during-unload counter. + return Ok(()); + } + // Step 5. + // TODO: call document.open(). + return Err(Error::InvalidState); + } + }; + + // Step 7. + // TODO: handle reload override buffer. + + // Steps 6-8. + parser.write(text); + + // Step 9. + Ok(()) + } + + // https://html.spec.whatwg.org/multipage/#dom-document-writeln + fn Writeln(&self, mut text: Vec) -> ErrorResult { + text.push("\n".into()); + self.Write(text) + } + // https://html.spec.whatwg.org/multipage/#documentandelementeventhandlers document_and_element_event_handlers!(); } diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index 18a9a89b4331..255137a939de 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -469,19 +469,20 @@ impl HTMLScriptElement { Ok(script) => script, }; - if script.external { - debug!("loading external script, url = {}", script.url); - } - // TODO(#12446): beforescriptexecute. if self.dispatch_before_script_execute_event() == EventStatus::Canceled { return; } // Step 3. - // TODO: If the script is from an external file, then increment the - // ignore-destructive-writes counter of the script element's node - // document. Let neutralised doc be that Document. + let neutralized_doc = if script.external { + debug!("loading external script, url = {}", script.url); + let doc = document_from_node(self); + doc.incr_ignore_destructive_writes_counter(); + Some(doc) + } else { + None + }; // Step 4. let document = document_from_node(self); @@ -500,8 +501,9 @@ impl HTMLScriptElement { document.set_current_script(old_script.r()); // Step 7. - // TODO: Decrement the ignore-destructive-writes counter of neutralised - // doc, if it was incremented in the earlier step. + if let Some(doc) = neutralized_doc { + doc.decr_ignore_destructive_writes_counter(); + } // TODO(#12446): afterscriptexecute. self.dispatch_after_script_execute_event(); diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs index 895c8a73b089..ff90674c1d2f 100644 --- a/components/script/dom/servoparser/mod.rs +++ b/components/script/dom/servoparser/mod.rs @@ -33,12 +33,25 @@ use profile_traits::time::{TimerMetadataReflowType, ProfilerCategory, profile}; use script_thread::ScriptThread; use servo_url::ServoUrl; use std::cell::Cell; +use std::mem; use util::resource_files::read_resource_file; mod html; mod xml; #[dom_struct] +/// The parser maintains two input streams: one for input from script through +/// document.write(), and one for input from network. +/// +/// There is no concrete representation of the insertion point, instead it +/// always points to just before the next character from the network input, +/// with all of the script input before itself. +/// +/// ```text +/// ... script input ... | ... network input ... +/// ^ +/// insertion point +/// ``` pub struct ServoParser { reflector: Reflector, /// The document associated with this parser. @@ -46,9 +59,12 @@ pub struct ServoParser { /// The pipeline associated with this parse, unavailable if this parse /// does not correspond to a page load. pipeline: Option, - /// Input chunks received but not yet passed to the parser. + /// Input received from network. #[ignore_heap_size_of = "Defined in html5ever"] - pending_input: DOMRefCell, + network_input: DOMRefCell, + /// Input received from script. Used only to support document.write(). + #[ignore_heap_size_of = "Defined in html5ever"] + script_input: DOMRefCell, /// The tokenizer of this parser. tokenizer: DOMRefCell, /// Whether to expect any further input from the associated network request. @@ -140,6 +156,80 @@ impl ServoParser { self.script_nesting_level.get() } + /// Corresponds to the latter part of the "Otherwise" branch of the 'An end + /// tag whose tag name is "script"' of + /// https://html.spec.whatwg.org/multipage/#parsing-main-incdata + /// + /// This first moves everything from the script input to the beginning of + /// the network input, effectively resetting the insertion point to just + /// before the next character to be consumed. + /// + /// + /// ```text + /// | ... script input ... network input ... + /// ^ + /// insertion point + /// ``` + pub fn resume_with_pending_parsing_blocking_script(&self, script: &HTMLScriptElement) { + assert!(self.suspended.get()); + self.suspended.set(false); + + mem::swap(&mut *self.script_input.borrow_mut(), &mut *self.network_input.borrow_mut()); + while let Some(chunk) = self.script_input.borrow_mut().pop_front() { + self.network_input.borrow_mut().push_back(chunk); + } + + let script_nesting_level = self.script_nesting_level.get(); + assert_eq!(script_nesting_level, 0); + + self.script_nesting_level.set(script_nesting_level + 1); + script.execute(); + self.script_nesting_level.set(script_nesting_level); + + if !self.suspended.get() { + self.parse_sync(); + } + } + + /// Steps 6-8 of https://html.spec.whatwg.org/multipage/#document.write() + pub fn write(&self, text: Vec) { + assert!(self.script_nesting_level.get() > 0); + + if self.document.get_pending_parsing_blocking_script().is_some() { + // There is already a pending parsing blocking script so the + // parser is suspended, we just append everything to the + // script input and abort these steps. + for chunk in text { + self.script_input.borrow_mut().push_back(String::from(chunk).into()); + } + return; + } + + // There is no pending parsing blocking script, so all previous calls + // to document.write() should have seen their entire input tokenized + // and process, with nothing pushed to the parser script input. + assert!(self.script_input.borrow().is_empty()); + + let mut input = BufferQueue::new(); + for chunk in text { + input.push_back(String::from(chunk).into()); + } + + self.tokenize(|tokenizer| tokenizer.feed(&mut input)); + + if self.suspended.get() { + // Parser got suspended, insert remaining input at end of + // script input, following anything written by scripts executed + // reentrantly during this call. + while let Some(chunk) = input.pop_front() { + self.script_input.borrow_mut().push_back(chunk); + } + return; + } + + assert!(input.is_empty()); + } + #[allow(unrooted_must_root)] fn new_inherited( document: &Document, @@ -151,7 +241,8 @@ impl ServoParser { reflector: Reflector::new(), document: JS::from_ref(document), pipeline: pipeline, - pending_input: DOMRefCell::new(BufferQueue::new()), + network_input: DOMRefCell::new(BufferQueue::new()), + script_input: DOMRefCell::new(BufferQueue::new()), tokenizer: DOMRefCell::new(tokenizer), last_chunk_received: Cell::new(last_chunk_state == LastChunkState::Received), suspended: Default::default(), @@ -172,85 +263,59 @@ impl ServoParser { ServoParserBinding::Wrap) } - pub fn document(&self) -> &Document { - &self.document - } - - pub fn pipeline(&self) -> Option { - self.pipeline - } - - fn has_pending_input(&self) -> bool { - !self.pending_input.borrow().is_empty() - } - fn push_input_chunk(&self, chunk: String) { - self.pending_input.borrow_mut().push_back(chunk.into()); - } - - fn last_chunk_received(&self) -> bool { - self.last_chunk_received.get() - } - - fn mark_last_chunk_received(&self) { - self.last_chunk_received.set(true) - } - - fn set_plaintext_state(&self) { - self.tokenizer.borrow_mut().set_plaintext_state() - } - - pub fn suspend(&self) { - assert!(!self.suspended.get()); - self.suspended.set(true); - } - - pub fn resume(&self) { - assert!(self.suspended.get()); - self.suspended.set(false); - self.parse_sync(); - } - - pub fn is_suspended(&self) -> bool { - self.suspended.get() - } - - pub fn resume_with_pending_parsing_blocking_script(&self, script: &HTMLScriptElement) { - assert!(self.suspended.get()); - self.suspended.set(false); - - let script_nesting_level = self.script_nesting_level.get(); - assert_eq!(script_nesting_level, 0); - - self.script_nesting_level.set(script_nesting_level + 1); - script.execute(); - self.script_nesting_level.set(script_nesting_level); - - if !self.suspended.get() { - self.parse_sync(); - } + self.network_input.borrow_mut().push_back(chunk.into()); } fn parse_sync(&self) { let metadata = TimerMetadata { - url: self.document().url().as_str().into(), + url: self.document.url().as_str().into(), iframe: TimerMetadataFrameType::RootWindow, incremental: TimerMetadataReflowType::FirstReflow, }; let profiler_category = self.tokenizer.borrow().profiler_category(); profile(profiler_category, Some(metadata), - self.document().window().upcast::().time_profiler_chan().clone(), + self.document.window().upcast::().time_profiler_chan().clone(), || self.do_parse_sync()) } fn do_parse_sync(&self) { + assert!(self.script_input.borrow().is_empty()); + // This parser will continue to parse while there is either pending input or // the parser remains unsuspended. + + self.tokenize(|tokenizer| tokenizer.feed(&mut *self.network_input.borrow_mut())); + + if self.suspended.get() { + return; + } + + assert!(self.network_input.borrow().is_empty()); + + if self.last_chunk_received.get() { + self.finish(); + } + } + + fn parse_chunk(&self, input: String) { + self.document.set_current_parser(Some(self)); + self.push_input_chunk(input); + if !self.suspended.get() { + self.parse_sync(); + } + } + + fn tokenize(&self, mut feed: F) + where F: FnMut(&mut Tokenizer) -> Result<(), Root> + { loop { - self.document().reflow_if_reflow_timer_expired(); - let script = match self.tokenizer.borrow_mut().feed(&mut *self.pending_input.borrow_mut()) { - Ok(()) => break, + assert!(!self.suspended.get()); + + self.document.reflow_if_reflow_timer_expired(); + let script = match feed(&mut *self.tokenizer.borrow_mut()) { + Ok(()) => return, Err(script) => script, }; @@ -261,36 +326,24 @@ impl ServoParser { self.script_nesting_level.set(script_nesting_level); if self.document.get_pending_parsing_blocking_script().is_some() { - self.suspend(); + self.suspended.set(true); return; } - - assert!(!self.suspended.get()); - } - - if self.last_chunk_received() { - self.finish(); - } - } - - fn parse_chunk(&self, input: String) { - self.document().set_current_parser(Some(self)); - self.push_input_chunk(input); - if !self.is_suspended() { - self.parse_sync(); } } fn finish(&self) { assert!(!self.suspended.get()); - assert!(!self.has_pending_input()); + assert!(self.last_chunk_received.get()); + assert!(self.script_input.borrow().is_empty()); + assert!(self.network_input.borrow().is_empty()); self.tokenizer.borrow_mut().end(); debug!("finished parsing"); - self.document().set_current_parser(None); + self.document.set_current_parser(None); - if let Some(pipeline) = self.pipeline() { + if let Some(pipeline) = self.pipeline { ScriptThread::parsing_complete(pipeline); } } @@ -398,7 +451,7 @@ impl FetchResponseListener for ParserContext { parser.push_input_chunk(page); parser.parse_sync(); - let doc = parser.document(); + let doc = &parser.document; let doc_body = Root::upcast::(doc.GetBody().unwrap()); let img = HTMLImageElement::new(local_name!("img"), None, doc); img.SetSrc(DOMString::from(self.url.to_string())); @@ -410,7 +463,7 @@ impl FetchResponseListener for ParserContext { let page = "
\n".into();
                 parser.push_input_chunk(page);
                 parser.parse_sync();
-                parser.set_plaintext_state();
+                parser.tokenizer.borrow_mut().set_plaintext_state();
             },
             Some(ContentType(Mime(TopLevel::Text, SubLevel::Html, _))) => { // Handle text/html
                 if let Some(reason) = ssl_error {
@@ -475,11 +528,11 @@ impl FetchResponseListener for ParserContext {
             debug!("Failed to load page URL {}, error: {:?}", self.url, err);
         }
 
-        parser.document()
+        parser.document
             .finish_load(LoadType::PageSource(self.url.clone()));
 
-        parser.mark_last_chunk_received();
-        if !parser.is_suspended() {
+        parser.last_chunk_received.set(true);
+        if !parser.suspended.get() {
             parser.parse_sync();
         }
     }
diff --git a/components/script/dom/webidls/Document.webidl b/components/script/dom/webidls/Document.webidl
index 192c3d037148..1e8725d8b86d 100644
--- a/components/script/dom/webidls/Document.webidl
+++ b/components/script/dom/webidls/Document.webidl
@@ -114,8 +114,10 @@ partial /*sealed*/ interface Document {
   // Document open(optional DOMString type = "text/html", optional DOMString replace = "");
   // WindowProxy open(DOMString url, DOMString name, DOMString features, optional boolean replace = false);
   // void close();
-  // void write(DOMString... text);
-  // void writeln(DOMString... text);
+  [Throws]
+  void write(DOMString... text);
+  [Throws]
+  void writeln(DOMString... text);
 
   // user interaction
   readonly attribute Window?/*Proxy?*/ defaultView;
diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/012.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/012.html.ini
index 778e50e98ce4..c128f7529e64 100644
--- a/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/012.html.ini
+++ b/tests/wpt/metadata/html/browsers/browsing-the-web/navigating-across-documents/012.html.ini
@@ -1,3 +1,5 @@
 [012.html]
   type: testharness
-  expected: TIMEOUT
+  [Link with onclick navigation to javascript url with delayed document.write and href navigation ]
+    expected: FAIL
+
diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/008.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/008.html.ini
index a110968a8b5c..5af01f618f1d 100644
--- a/tests/wpt/metadata/html/browsers/history/the-history-interface/008.html.ini
+++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/008.html.ini
@@ -1,3 +1,8 @@
 [008.html]
   type: testharness
-  expected: ERROR
+  [history.pushState URL resolving should be done relative to the document, not the script]
+    expected: FAIL
+
+  [history.replaceState URL resolving should be done relative to the document, not the script]
+    expected: FAIL
+
diff --git a/tests/wpt/metadata/html/dom/documents/dom-tree-accessors/Document.currentScript.html.ini b/tests/wpt/metadata/html/dom/documents/dom-tree-accessors/Document.currentScript.html.ini
index 252190ed7b1a..9e7b94a922ec 100644
--- a/tests/wpt/metadata/html/dom/documents/dom-tree-accessors/Document.currentScript.html.ini
+++ b/tests/wpt/metadata/html/dom/documents/dom-tree-accessors/Document.currentScript.html.ini
@@ -10,6 +10,3 @@
   [Script iframe-src]
     expected: NOTRUN
 
-  [Script document-write]
-    expected: NOTRUN
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/001.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/001.html.ini
deleted file mode 100644
index 6985114e8589..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/001.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[001.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/002.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/002.html.ini
deleted file mode 100644
index 2cc993ceb7d7..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/002.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[002.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/003.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/003.html.ini
deleted file mode 100644
index 88bb58134004..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/003.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[003.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/004.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/004.html.ini
deleted file mode 100644
index e1b8ef4e5739..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/004.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[004.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/005.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/005.html.ini
deleted file mode 100644
index 803351606ca4..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/005.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[005.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/006.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/006.html.ini
deleted file mode 100644
index c9292a1eae6d..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/006.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[006.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/007.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/007.html.ini
deleted file mode 100644
index b340befb9be7..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/007.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[007.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/008.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/008.html.ini
deleted file mode 100644
index 1cc053a98484..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/008.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[008.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/009.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/009.html.ini
deleted file mode 100644
index 566a0b8ebc49..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/009.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[009.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/010.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/010.html.ini
deleted file mode 100644
index ddec5826883f..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/010.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[010.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/011.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/011.html.ini
deleted file mode 100644
index 79e8adfc7612..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/011.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[011.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/012.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/012.html.ini
deleted file mode 100644
index 77779cbe5079..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/012.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[012.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/013.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/013.html.ini
deleted file mode 100644
index 7cb278bfb5fa..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/013.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[013.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/014.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/014.html.ini
deleted file mode 100644
index 69e5c5bc04bd..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/014.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[014.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/015.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/015.html.ini
deleted file mode 100644
index f9eec8951cf6..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/015.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[015.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/016.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/016.html.ini
deleted file mode 100644
index d60580d3c696..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/016.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[016.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/017.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/017.html.ini
deleted file mode 100644
index 1710ed2f62be..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/017.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[017.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/018.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/018.html.ini
deleted file mode 100644
index 78062b20a21e..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/018.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[018.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/019.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/019.html.ini
deleted file mode 100644
index b1c7963c994f..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/019.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[019.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/020.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/020.html.ini
deleted file mode 100644
index eb57d7740c35..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/020.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[020.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/021.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/021.html.ini
deleted file mode 100644
index 9d67e353875d..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/021.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[021.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/022.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/022.html.ini
deleted file mode 100644
index c4ebec803802..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/022.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[022.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/023.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/023.html.ini
deleted file mode 100644
index 55bc59eff24b..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/023.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[023.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/024.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/024.html.ini
deleted file mode 100644
index b7c5651b2d62..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/024.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[024.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/025.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/025.html.ini
deleted file mode 100644
index b7a0aa796ff9..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/025.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[025.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/026.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/026.html.ini
deleted file mode 100644
index e10cbc28464d..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/026.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[026.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/027.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/027.html.ini
deleted file mode 100644
index 0d73fa40c751..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/027.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[027.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/028.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/028.html.ini
deleted file mode 100644
index e0b9275cc65a..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/028.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[028.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/029.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/029.html.ini
deleted file mode 100644
index 2c70a364d019..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/029.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[029.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/030.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/030.html.ini
deleted file mode 100644
index c244617d7453..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/030.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[030.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/031.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/031.html.ini
deleted file mode 100644
index 34cd66dc5512..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/031.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[031.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/032.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/032.html.ini
deleted file mode 100644
index 5cc1d98dda12..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/032.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[032.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/033.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/033.html.ini
deleted file mode 100644
index 991777728990..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/033.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[033.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/034.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/034.html.ini
deleted file mode 100644
index 7b99ae3f430d..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/034.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[034.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/035.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/035.html.ini
deleted file mode 100644
index 404f771509b1..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/035.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[035.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/036.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/036.html.ini
deleted file mode 100644
index a13aecc3e884..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/036.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[036.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/037.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/037.html.ini
deleted file mode 100644
index 081da77b51e4..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/037.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[037.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/038.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/038.html.ini
deleted file mode 100644
index da0cafe8719c..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/038.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[038.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/039.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/039.html.ini
deleted file mode 100644
index e8fe97673bbd..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/039.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[039.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/040.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/040.html.ini
deleted file mode 100644
index ac7633432ea2..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/040.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[040.html]
-  type: testharness
-  [document.write entity]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/041.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/041.html.ini
deleted file mode 100644
index 33c57363c369..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/041.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[041.html]
-  type: testharness
-  [document.write entity]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/042.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/042.html.ini
deleted file mode 100644
index bc6831359567..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/042.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[042.html]
-  type: testharness
-  [document.write entity]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/043.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/043.html.ini
deleted file mode 100644
index a768395cc7ac..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/043.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[043.html]
-  type: testharness
-  [document.write entity]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/044.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/044.html.ini
deleted file mode 100644
index f9dcb8ce85b3..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/044.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[044.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/045.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/045.html.ini
deleted file mode 100644
index c8b41a2bde9b..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/045.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[045.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/046.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/046.html.ini
deleted file mode 100644
index 63190676ef69..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/046.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[046.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_001.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_001.html.ini
deleted file mode 100644
index f49a2a87b151..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_001.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_001.html]
-  type: testharness
-  [document.write script]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_002.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_002.html.ini
deleted file mode 100644
index 1326994434ff..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_002.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_002.html]
-  type: testharness
-  [document.write script executed synchronously]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_003.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_003.html.ini
deleted file mode 100644
index 27719a648932..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_003.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_003.html]
-  type: testharness
-  [document.write script writing a further script]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_004.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_004.html.ini
deleted file mode 100644
index 5e3c7610ffab..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_004.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_004.html]
-  type: testharness
-  [document.write script writing script; order of execution]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_005.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_005.html.ini
deleted file mode 100644
index 0cc9fff08476..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_005.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_005.html]
-  type: testharness
-  [document.write external script]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_006.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_006.html.ini
deleted file mode 100644
index 42cd244bb288..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_006.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_006.html]
-  type: testharness
-  [document.write external script followed by internal script]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_007.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_007.html.ini
deleted file mode 100644
index 80b73aad1fa9..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_007.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_007.html]
-  type: testharness
-  [document.write external script that document.writes inline script]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_008.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_008.html.ini
deleted file mode 100644
index 927493f66362..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_008.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_008.html]
-  type: testharness
-  [document.write external script that document.writes external script]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_009.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_009.html.ini
deleted file mode 100644
index 2a8098c1e0c5..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_009.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_009.html]
-  type: testharness
-  [document.write script that document.writes script]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_010.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_010.html.ini
deleted file mode 100644
index ba746efe709b..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_010.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_010.html]
-  type: testharness
-  [document.write external script tokenizer order]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_011.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_011.html.ini
deleted file mode 100644
index 237532dba267..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_011.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_011.html]
-  type: testharness
-  [document.write external script that document.writes external script]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_012.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_012.html.ini
deleted file mode 100644
index 4c217cf5d477..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_012.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_012.html]
-  type: testharness
-  [document.write external script tokenizer order]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_013.html.ini b/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_013.html.ini
deleted file mode 100644
index f3f03e299daf..000000000000
--- a/tests/wpt/metadata/html/dom/dynamic-markup-insertion/document-write/script_013.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[script_013.html]
-  type: testharness
-  [document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini
index e00be7625101..5b80ab2bad10 100644
--- a/tests/wpt/metadata/html/dom/interfaces.html.ini
+++ b/tests/wpt/metadata/html/dom/interfaces.html.ini
@@ -21,12 +21,6 @@
   [Document interface: operation close()]
     expected: FAIL
 
-  [Document interface: operation write(DOMString)]
-    expected: FAIL
-
-  [Document interface: operation writeln(DOMString)]
-    expected: FAIL
-
   [Document interface: attribute designMode]
     expected: FAIL
 
@@ -900,18 +894,6 @@
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "close" with the proper type (56)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "write" with the proper type (57)]
-    expected: FAIL
-
-  [Document interface: calling write(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "writeln" with the proper type (58)]
-    expected: FAIL
-
-  [Document interface: calling writeln(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "designMode" with the proper type (62)]
     expected: FAIL
 
@@ -6144,12 +6126,6 @@
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "close" with the proper type (57)]
     expected: FAIL
 
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "write" with the proper type (58)]
-    expected: FAIL
-
-  [Document interface: document.implementation.createDocument(null, "", null) must inherit property "writeln" with the proper type (59)]
-    expected: FAIL
-
   [Document interface: document.implementation.createDocument(null, "", null) must inherit property "designMode" with the proper type (63)]
     expected: FAIL
 
@@ -6489,18 +6465,6 @@
   [Document interface: new Document() must inherit property "close" with the proper type (57)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "write" with the proper type (58)]
-    expected: FAIL
-
-  [Document interface: calling write(DOMString) on new Document() with too few arguments must throw TypeError]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "writeln" with the proper type (59)]
-    expected: FAIL
-
-  [Document interface: calling writeln(DOMString) on new Document() with too few arguments must throw TypeError]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "designMode" with the proper type (63)]
     expected: FAIL
 
@@ -8547,12 +8511,6 @@
   [Document interface: new Document() must inherit property "close" with the proper type (56)]
     expected: FAIL
 
-  [Document interface: new Document() must inherit property "write" with the proper type (57)]
-    expected: FAIL
-
-  [Document interface: new Document() must inherit property "writeln" with the proper type (58)]
-    expected: FAIL
-
   [Document interface: new Document() must inherit property "designMode" with the proper type (62)]
     expected: FAIL
 
diff --git a/tests/wpt/metadata/html/semantics/embedded-content/media-elements/video_008.htm.ini b/tests/wpt/metadata/html/semantics/embedded-content/media-elements/video_008.htm.ini
index 0e01160852a2..4fa459700a78 100644
--- a/tests/wpt/metadata/html/semantics/embedded-content/media-elements/video_008.htm.ini
+++ b/tests/wpt/metadata/html/semantics/embedded-content/media-elements/video_008.htm.ini
@@ -1,6 +1,6 @@
 [video_008.htm]
   type: testharness
-  expected: ERROR
+  expected: TIMEOUT
   [HTML5 Media Elements: 'media' attribute]
     expected: NOTRUN
 
diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_009.htm.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_009.htm.ini
deleted file mode 100644
index ff265af0d6e0..000000000000
--- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/async_009.htm.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[async_009.htm]
-  type: testharness
-  [Document.write() silently fails from an Async script]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-1.html.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-1.html.ini
deleted file mode 100644
index d1d06476fa97..000000000000
--- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-1.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[script-onerror-insertion-point-1.html]
-  type: testharness
-  expected: TIMEOUT
-  [Test that the insertion point is defined in the error event of a parser-inserted script that actually started a fetch (but just had it fail).]
-    expected: NOTRUN
-
diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-onload-insertion-point.html.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-onload-insertion-point.html.ini
deleted file mode 100644
index e71e15f1e26c..000000000000
--- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-onload-insertion-point.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[script-onload-insertion-point.html]
-  type: testharness
-  expected: TIMEOUT
-  [Test that the insertion point is defined in the load event of a parser-inserted script.]
-    expected: NOTRUN
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/005.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/005.html.ini
deleted file mode 100644
index 243d227c11d3..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/005.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[005.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: document.write inline in markup ]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/006.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/006.html.ini
deleted file mode 100644
index 2642734fc075..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/006.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[006.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: document.write inline - multiple]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/007.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/007.html.ini
deleted file mode 100644
index 22f2d7a6903c..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/007.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[007.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: document.write external]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/008.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/008.html.ini
deleted file mode 100644
index af39e4fa9b49..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/008.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[008.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: document.write external - multiple]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/009.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/009.html.ini
deleted file mode 100644
index 5874e98437e8..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/009.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[009.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: document.write external - multiple with doc.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/010.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/010.html.ini
deleted file mode 100644
index 98c79183ff75..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/010.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[010.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: document.write external + inline - multiple with doc.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/011.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/011.html.ini
deleted file mode 100644
index 103f7f7049f3..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/011.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[011.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: document.write external + inline - multiple with doc.write + subsequent markup]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/012.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/012.html.ini
deleted file mode 100644
index 65c422e769cb..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/012.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[012.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: document.write external and onload events ]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/018.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/018.html.ini
deleted file mode 100644
index 271ef2039a97..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/018.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[018.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: DOM added scripts and doc.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/026.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/026.html.ini
deleted file mode 100644
index b3c115ac7ddb..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/026.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[026.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: doc write added script, .src set later]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/027.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/027.html.ini
deleted file mode 100644
index ab940259b5f2..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/027.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[027.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: doc write added script with content, .src set later]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/041.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/041.html.ini
deleted file mode 100644
index 4674fe1278a9..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/041.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[041.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: document.write scripts that write scripts]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/068.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/068.html.ini
deleted file mode 100644
index f46a82848728..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/068.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[068.html]
-  type: testharness
-  expected: ERROR
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/096.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/096.html.ini
index 4fce65123367..7647c26e9f9e 100644
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/096.html.ini
+++ b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/096.html.ini
@@ -1,6 +1,5 @@
 [096.html]
   type: testharness
-  expected: ERROR
   [ scheduler: defer script added from document.write relative to DOMContentLoaded]
     expected: FAIL
 
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/097.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/097.html.ini
deleted file mode 100644
index da923dd340e3..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/097.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[097.html]
-  type: testharness
-  expected: ERROR
-  [ scheduler: slow-loading async script added from document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/098.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/098.html.ini
index 2c835f074c4c..5b0aa1e5e0ce 100644
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/098.html.ini
+++ b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/098.html.ini
@@ -1,6 +1,5 @@
 [098.html]
   type: testharness
-  expected: ERROR
   [ scheduler: defer script added from document.write]
     expected: FAIL
 
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/107-import.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/107-import.html.ini
deleted file mode 100644
index d16db9574e65..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/107-import.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[107-import.html]
-  type: testharness
-  [ scheduler: stylesheets blocking scripts document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/107-noimport.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/107-noimport.html.ini
deleted file mode 100644
index 1437acb35110..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/107-noimport.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[107-noimport.html]
-  type: testharness
-  [ scheduler: stylesheets blocking scripts document.write]
-    expected: FAIL
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/120.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/120.html.ini
deleted file mode 100644
index 6a0f1c628e54..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/120.html.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[120.html]
-  type: testharness
-  expected: ERROR
-  [scheduler: script created without a window ]
-    expected: NOTRUN
-
diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/149.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/149.html.ini
deleted file mode 100644
index 2eb68a6f0fef..000000000000
--- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/149.html.ini
+++ /dev/null
@@ -1,21 +0,0 @@
-[149.html]
-  type: testharness
-  expected: ERROR
-  [for='window' event='onload()' parser inserted executes immediately]
-    expected: FAIL
-
-  [for='window' event='onload' parser inserted executes immediately]
-    expected: FAIL
-
-  [for='  WINdow\t\n' event='ONload\t\n' parser inserted executes immediately]
-    expected: FAIL
-
-  [for='window' event='onload()' dom inserted executes immediately]
-    expected: FAIL
-
-  [for='window' event='onload' dom inserted executes immediately]
-    expected: FAIL
-
-  [for='  WINdow\t\n' event='ONload\t\n' dom inserted executes immediately]
-    expected: FAIL
-