dom: Reduce the scope of iframe's load blocker borrow.

This commit is contained in:
Josh Matthews 2019-11-12 12:54:18 -05:00
parent bf69b6fea7
commit af158de504

View file

@ -130,10 +130,12 @@ impl HTMLIFrameElement {
let document = document_from_node(self); let document = document_from_node(self);
{
let mut load_blocker = self.load_blocker.borrow_mut(); let mut load_blocker = self.load_blocker.borrow_mut();
// Any oustanding load is finished from the point of view of the blocked // Any oustanding load is finished from the point of view of the blocked
// document; the new navigation will continue blocking it. // document; the new navigation will continue blocking it.
LoadBlocker::terminate(&mut load_blocker); LoadBlocker::terminate(&mut load_blocker);
}
if load_data.url.scheme() == "javascript" { if load_data.url.scheme() == "javascript" {
let window_proxy = self.GetContentWindow(); let window_proxy = self.GetContentWindow();
@ -150,6 +152,7 @@ impl HTMLIFrameElement {
match load_data.js_eval_result { match load_data.js_eval_result {
Some(JsEvalResult::NoContent) => (), Some(JsEvalResult::NoContent) => (),
_ => { _ => {
let mut load_blocker = self.load_blocker.borrow_mut();
*load_blocker = Some(LoadBlocker::new( *load_blocker = Some(LoadBlocker::new(
&*document, &*document,
LoadType::Subframe(load_data.url.clone()), LoadType::Subframe(load_data.url.clone()),