Skip to content
Permalink
Browse files

Move abort_requests out of tasks to see what happens

  • Loading branch information
pshaughn committed Jan 14, 2020
1 parent e4a5d8d commit da0c8c4f9a3c632c60251226931845b270562d21
Showing with 6 additions and 10 deletions.
  1. +4 −10 components/script/dom/htmlimageelement.rs
  2. +2 −0 components/script/microtask.rs
@@ -823,6 +823,8 @@ impl HTMLImageElement {
// Step 8
Some(data) => data,
None => {
self.abort_request(State::Broken, ImageRequestPhase::Current);
self.abort_request(State::Broken, ImageRequestPhase::Pending);
// Step 9.
// FIXME(nox): Why are errors silenced here?
let _ = task_source.queue(
@@ -840,11 +842,6 @@ impl HTMLImageElement {
if src_present || Self::uses_srcset_or_picture(elem) {
this.upcast::<EventTarget>().fire_event(atom!("error"));
}
// FIXME(nox): According to the spec, setting the current
// request to the broken state is done prior to queuing a
// task, why is this here?
this.abort_request(State::Broken, ImageRequestPhase::Current);
this.abort_request(State::Broken, ImageRequestPhase::Pending);
}),
window.upcast(),
);
@@ -861,6 +858,8 @@ impl HTMLImageElement {
self.prepare_image_request(&url, &src, pixel_density);
},
Err(_) => {
self.abort_request(State::Broken, ImageRequestPhase::Current);
self.abort_request(State::Broken, ImageRequestPhase::Pending);
// Step 12.1-12.5.
let src = src.0;
// FIXME(nox): Why are errors silenced here?
@@ -874,11 +873,6 @@ impl HTMLImageElement {
}
this.upcast::<EventTarget>().fire_event(atom!("error"));

// FIXME(nox): According to the spec, setting the current
// request to the broken state is done prior to queuing a
// task, why is this here?
this.abort_request(State::Broken, ImageRequestPhase::Current);
this.abort_request(State::Broken, ImageRequestPhase::Pending);
}),
window.upcast(),
);
@@ -79,6 +79,8 @@ impl MicrotaskQueue {
// Step 1
self.performing_a_microtask_checkpoint.set(true);

debug!("Now performing a microtask checkpoint");

// Steps 2
while !self.microtask_queue.borrow().is_empty() {
rooted_vec!(let mut pending_queue);

0 comments on commit da0c8c4

Please sign in to comment.
You can’t perform that action at this time.