diff options
author | Bastien Orivel <eijebong@bananium.fr> | 2020-05-08 15:36:55 +0200 |
---|---|---|
committer | Bastien Orivel <eijebong@bananium.fr> | 2020-05-08 19:15:24 +0200 |
commit | bdbfde9ec0b5e80af0f63777b4cf2b31f5209f92 (patch) | |
tree | 530ee29432f48dfbbfecf618f3235d518e2ae471 /components/layout/context.rs | |
parent | 8249be38c9561f80b611610431a3e97531f67683 (diff) | |
download | servo-bdbfde9ec0b5e80af0f63777b4cf2b31f5209f92.tar.gz servo-bdbfde9ec0b5e80af0f63777b4cf2b31f5209f92.zip |
Don't send a load event when a loaded image is actually the placeholder
The image cache returns an `ImageCacheResult::ImageAvailable `the second
time you try getting the placeholder. This means that in some cases, the
loading of an image would fail, then the same image would get fetched
from the cache, the placeholder would be loaded from that but would be
seen as a normal image, firing a load event.
This made the tests in
`fetch/cross-origin-resource-policy/image-loads.html` fail depending on
their order.
Diffstat (limited to 'components/layout/context.rs')
-rw-r--r-- | components/layout/context.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/layout/context.rs b/components/layout/context.rs index 536d108ea04..00e0c5a0cc1 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -163,7 +163,7 @@ impl<'a> LayoutContext<'a> { } match self.get_or_request_image_or_meta(node, url.clone(), use_placeholder) { - Some(ImageOrMetadataAvailable::ImageAvailable(image, _)) => { + Some(ImageOrMetadataAvailable::ImageAvailable { image, .. }) => { let image_info = WebRenderImageInfo::from_image(&*image); if image_info.key.is_none() { Some(image_info) |