aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2019-11-06 11:30:32 -0500
committerGitHub <noreply@github.com>2019-11-06 11:30:32 -0500
commit411890e27bceb65504009a477a57d2711e22c6d6 (patch)
tree0ee9d1920a265ee0fb94a2d72f9753a184cd1969 /components/script
parenta931a80cf5ad644cba8d8445cd0a62e55f04b906 (diff)
downloadservo-411890e27bceb65504009a477a57d2711e22c6d6.tar.gz
servo-411890e27bceb65504009a477a57d2711e22c6d6.zip
Correct inverted logic for available image checks.
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/htmlimageelement.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index 525f35d3e95..698e21517a8 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -927,10 +927,7 @@ impl HTMLImageElement {
*self.last_selected_source.borrow_mut() = selected_source.clone();
// Step 6, check the list of available images
- if !selected_source
- .as_ref()
- .map_or(false, |source| source.is_empty())
- {
+ if let Some(src) = selected_source {
if let Ok(img_url) = base_url.join(&src) {
let image_cache = window.image_cache();
let response = image_cache.find_image_or_metadata(