mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Use task! to forward unhandled errors to worker objects
This commit is contained in:
parent
c53d1e46b4
commit
1fa0e21e4b
4 changed files with 44 additions and 78 deletions
|
@ -54,7 +54,6 @@ use servo_url::ServoUrl;
|
|||
use std::cell::Cell;
|
||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
||||
use style::context::ReflowGoal;
|
||||
use task::Task;
|
||||
use task_source::TaskSource;
|
||||
|
||||
bitflags! {
|
||||
|
@ -233,9 +232,15 @@ impl HTMLIFrameElement {
|
|||
|
||||
// https://github.com/whatwg/html/issues/490
|
||||
if mode == ProcessingMode::FirstTime && !self.upcast::<Element>().has_attribute(&local_name!("src")) {
|
||||
let event_loop = window.dom_manipulation_task_source();
|
||||
let _ = event_loop.queue(box IFrameLoadEventSteps::new(self),
|
||||
window.upcast());
|
||||
let this = Trusted::new(self);
|
||||
let pipeline_id = self.pipeline_id().unwrap();
|
||||
// FIXME(nox): Why are errors silenced here?
|
||||
let _ = window.dom_manipulation_task_source().queue(
|
||||
box task!(iframe_load_event_steps: move || {
|
||||
this.root().iframe_load_event_steps(pipeline_id);
|
||||
}),
|
||||
window.upcast(),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -835,24 +840,3 @@ impl VirtualMethods for HTMLIFrameElement {
|
|||
self.destroy_nested_browsing_context();
|
||||
}
|
||||
}
|
||||
|
||||
struct IFrameLoadEventSteps {
|
||||
frame_element: Trusted<HTMLIFrameElement>,
|
||||
pipeline_id: PipelineId,
|
||||
}
|
||||
|
||||
impl IFrameLoadEventSteps {
|
||||
fn new(frame_element: &HTMLIFrameElement) -> IFrameLoadEventSteps {
|
||||
IFrameLoadEventSteps {
|
||||
frame_element: Trusted::new(frame_element),
|
||||
pipeline_id: frame_element.pipeline_id().unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Task for IFrameLoadEventSteps {
|
||||
fn run(self: Box<Self>) {
|
||||
let this = self.frame_element.root();
|
||||
this.iframe_load_event_steps(self.pipeline_id);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue