summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Loader
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-06-14 19:35:10 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-14 19:35:10 +0200
commit007237045980b12d524b36933885f540e1b814af (patch)
treef954fea55d843bb1deeabe4e5a62475e421367f8 /Libraries/LibWeb/Loader
parent73c9f7ebf4ae07492367c1c39f940603046b780e (diff)
downloadserenity-007237045980b12d524b36933885f540e1b814af.zip
LibWeb: Don't animate images outside the visible viewport :^)
Diffstat (limited to 'Libraries/LibWeb/Loader')
-rw-r--r--Libraries/LibWeb/Loader/ImageLoader.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Loader/ImageLoader.cpp b/Libraries/LibWeb/Loader/ImageLoader.cpp
index a6b3ecae58..c581242d4c 100644
--- a/Libraries/LibWeb/Loader/ImageLoader.cpp
+++ b/Libraries/LibWeb/Loader/ImageLoader.cpp
@@ -87,6 +87,9 @@ void ImageLoader::resource_did_load()
void ImageLoader::animate()
{
+ if (!m_visible_in_viewport)
+ return;
+
auto* decoder = image_decoder();
ASSERT(decoder);