From b567cc76e5adf00e24f46aa8b3337c3c3901ba46 Mon Sep 17 00:00:00 2001 From: Kris Tokarz Date: Sun, 29 Sep 2019 07:34:36 -0400 Subject: [PATCH 1/2] Change setBody to be less strict when getting the immediate child Step four of the dom document body calls for throwing an exception if no document element was found. The current setBody implementation was looking for a document element that is also an html element. It has been updated to use GetDocumentElement which returns any document element. --- components/script/dom/document.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 91f5e19dc7c..da44169ce59 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -3996,7 +3996,7 @@ impl DocumentMethods for Document { return Ok(()); } - match (self.get_html_element(), &old_body) { + match (self.GetDocumentElement(), &old_body) { // Step 3. (Some(ref root), &Some(ref child)) => { let root = root.upcast::(); From 6949052094e774bd56e39857f087ec531b241404 Mon Sep 17 00:00:00 2001 From: Kris Tokarz Date: Sun, 29 Sep 2019 12:58:55 -0400 Subject: [PATCH 2/2] Remove the Document.body.html.ini file This file was setting the test as expected to fail. However, after the changes made in the pull request the test is now expected to pass --- .../dom/documents/dom-tree-accessors/Document.body.html.ini | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 tests/wpt/metadata/html/dom/documents/dom-tree-accessors/Document.body.html.ini diff --git a/tests/wpt/metadata/html/dom/documents/dom-tree-accessors/Document.body.html.ini b/tests/wpt/metadata/html/dom/documents/dom-tree-accessors/Document.body.html.ini deleted file mode 100644 index b19ab8eb8ce..00000000000 --- a/tests/wpt/metadata/html/dom/documents/dom-tree-accessors/Document.body.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[Document.body.html] - [Setting document.body to a new body element when the root element is a test element.] - expected: FAIL -