From ff0da2f6428a95c5f10f26d7b6b86c9608f494e1 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 17 Oct 2015 03:25:46 +0200 Subject: [PATCH] Do not root DOMParser::window --- components/script/dom/domparser.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/script/dom/domparser.rs b/components/script/dom/domparser.rs index 8ad9bfa507b..a66b8ea3962 100644 --- a/components/script/dom/domparser.rs +++ b/components/script/dom/domparser.rs @@ -49,15 +49,14 @@ impl DOMParserMethods for DOMParser { s: DOMString, ty: DOMParserBinding::SupportedType) -> Fallible> { - let window = self.window.root(); - let url = window.r().get_url(); + let url = self.window.get_url(); let content_type = DOMParserBinding::SupportedTypeValues::strings[ty as usize].to_owned(); - let doc = window.r().Document(); + let doc = self.window.Document(); let doc = doc.r(); let loader = DocumentLoader::new(&*doc.loader()); match ty { Text_html => { - let document = Document::new(window.r(), Some(url.clone()), + let document = Document::new(&self.window, Some(url.clone()), IsHTMLDocument::HTMLDocument, Some(content_type), None, @@ -69,7 +68,7 @@ impl DOMParserMethods for DOMParser { } Text_xml => { //FIXME: this should probably be FromParser when we actually parse the string (#3756). - Ok(Document::new(window.r(), Some(url.clone()), + Ok(Document::new(&self.window, Some(url.clone()), IsHTMLDocument::NonHTMLDocument, Some(content_type), None,