mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Drain promises vec and run update_the_image_data when element is created
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
parent
3bf6a5bbf8
commit
d6b7b706e2
1 changed files with 6 additions and 0 deletions
|
@ -1190,6 +1190,7 @@ impl HTMLImageElement {
|
|||
for promise in self.image_decode_promises.borrow().iter() {
|
||||
promise.resolve_native(&());
|
||||
}
|
||||
self.image_decode_promises.borrow_mut().clear();
|
||||
}
|
||||
|
||||
fn reject_image_decode_promises(&self) {
|
||||
|
@ -1200,6 +1201,7 @@ impl HTMLImageElement {
|
|||
DOMErrorName::EncodingError,
|
||||
));
|
||||
}
|
||||
self.image_decode_promises.borrow_mut().clear();
|
||||
}
|
||||
|
||||
/// Step 15 for <https://html.spec.whatwg.org/multipage/#img-environment-changes>
|
||||
|
@ -1333,6 +1335,10 @@ impl HTMLImageElement {
|
|||
image.SetHeight(h);
|
||||
}
|
||||
|
||||
// run update_the_image_data when the element is created.
|
||||
// https://html.spec.whatwg.org/multipage/#when-to-obtain-images
|
||||
image.update_the_image_data();
|
||||
|
||||
Ok(image)
|
||||
}
|
||||
pub fn areas(&self) -> Option<Vec<DomRoot<HTMLAreaElement>>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue