mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Remove unsound Root::deref() calls in DOMParser::ParseFromString.
Note that Root::clone() calls through to JSRef::clone() due to autoderef.
This commit is contained in:
parent
ca9b5353d8
commit
6032a2f8af
1 changed files with 8 additions and 8 deletions
|
@ -47,22 +47,22 @@ impl<'a> DOMParserMethods for JSRef<'a, DOMParser> {
|
||||||
s: DOMString,
|
s: DOMString,
|
||||||
ty: DOMParserBinding::SupportedType)
|
ty: DOMParserBinding::SupportedType)
|
||||||
-> Fallible<Temporary<Document>> {
|
-> Fallible<Temporary<Document>> {
|
||||||
let window = self.window.root().clone();
|
let window = self.window.root();
|
||||||
let url = window.get_url();
|
let url = window.r().get_url();
|
||||||
let content_type = DOMParserBinding::SupportedTypeValues::strings[ty as uint].into_string();
|
let content_type = DOMParserBinding::SupportedTypeValues::strings[ty as uint].into_string();
|
||||||
match ty {
|
match ty {
|
||||||
Text_html => {
|
Text_html => {
|
||||||
let document = Document::new(window, Some(url.clone()),
|
let document = Document::new(window.r(), Some(url.clone()),
|
||||||
IsHTMLDocument::HTMLDocument,
|
IsHTMLDocument::HTMLDocument,
|
||||||
Some(content_type),
|
Some(content_type),
|
||||||
DocumentSource::FromParser).root().clone();
|
DocumentSource::FromParser).root();
|
||||||
parse_html(document, HTMLInput::InputString(s), &url);
|
parse_html(document.r(), HTMLInput::InputString(s), &url);
|
||||||
document.set_ready_state(DocumentReadyState::Complete);
|
document.r().set_ready_state(DocumentReadyState::Complete);
|
||||||
Ok(Temporary::from_rooted(document))
|
Ok(Temporary::from_rooted(document.r()))
|
||||||
}
|
}
|
||||||
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, Some(url.clone()),
|
Ok(Document::new(window.r(), Some(url.clone()),
|
||||||
IsHTMLDocument::NonHTMLDocument,
|
IsHTMLDocument::NonHTMLDocument,
|
||||||
Some(content_type),
|
Some(content_type),
|
||||||
DocumentSource::NotFromParser))
|
DocumentSource::NotFromParser))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue