aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlimageelement.rs
diff options
context:
space:
mode:
authorPatrick Shaughnessy <pshaughn@comcast.net>2020-01-13 18:32:16 -0500
committerPatrick Shaughnessy <pshaughn@comcast.net>2020-01-15 11:49:52 -0500
commitc725f9e84da3f75e2812452567e146a946d01438 (patch)
treec2c4dafff873e0daeb109dad32a593977ff4b996 /components/script/dom/htmlimageelement.rs
parent2373769e766aa6794bd141cd2da137e71a580c86 (diff)
downloadservo-c725f9e84da3f75e2812452567e146a946d01438.tar.gz
servo-c725f9e84da3f75e2812452567e146a946d01438.zip
Add microtask checkpoints on </script> and CE construct
Diffstat (limited to 'components/script/dom/htmlimageelement.rs')
-rw-r--r--components/script/dom/htmlimageelement.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index fd2a58f8d7d..4d6ce97c1e7 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.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(),
);