mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Do not root DOMParser::window
This commit is contained in:
parent
ce6aab6cb1
commit
ff0da2f642
1 changed files with 4 additions and 5 deletions
|
@ -49,15 +49,14 @@ impl DOMParserMethods for DOMParser {
|
||||||
s: DOMString,
|
s: DOMString,
|
||||||
ty: DOMParserBinding::SupportedType)
|
ty: DOMParserBinding::SupportedType)
|
||||||
-> Fallible<Root<Document>> {
|
-> Fallible<Root<Document>> {
|
||||||
let window = self.window.root();
|
let url = self.window.get_url();
|
||||||
let url = window.r().get_url();
|
|
||||||
let content_type = DOMParserBinding::SupportedTypeValues::strings[ty as usize].to_owned();
|
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 doc = doc.r();
|
||||||
let loader = DocumentLoader::new(&*doc.loader());
|
let loader = DocumentLoader::new(&*doc.loader());
|
||||||
match ty {
|
match ty {
|
||||||
Text_html => {
|
Text_html => {
|
||||||
let document = Document::new(window.r(), Some(url.clone()),
|
let document = Document::new(&self.window, Some(url.clone()),
|
||||||
IsHTMLDocument::HTMLDocument,
|
IsHTMLDocument::HTMLDocument,
|
||||||
Some(content_type),
|
Some(content_type),
|
||||||
None,
|
None,
|
||||||
|
@ -69,7 +68,7 @@ impl DOMParserMethods for DOMParser {
|
||||||
}
|
}
|
||||||
Text_xml => {
|
Text_xml => {
|
||||||
//FIXME: this should probably be FromParser when we actually parse the string (#3756).
|
//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,
|
IsHTMLDocument::NonHTMLDocument,
|
||||||
Some(content_type),
|
Some(content_type),
|
||||||
None,
|
None,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue