mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibWeb: Dispatch a "load" event on HTMLImageElement
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 07:35:50 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1813e083ff4
@@ -28,6 +28,7 @@
|
||||
#include <LibGfx/ImageDecoder.h>
|
||||
#include <LibWeb/CSS/StyleResolver.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/DOM/HTMLImageElement.h>
|
||||
#include <LibWeb/Layout/LayoutImage.h>
|
||||
#include <LibWeb/ResourceLoader.h>
|
||||
@@ -64,7 +65,10 @@ void HTMLImageElement::load_image(const String& src)
|
||||
|
||||
m_encoded_data = data;
|
||||
m_image_decoder = Gfx::ImageDecoder::create(m_encoded_data.data(), m_encoded_data.size());
|
||||
|
||||
document().update_layout();
|
||||
|
||||
dispatch_event(Event::create("load"));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user