mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
LibWeb: Make HTMLImageElement loads delay the document load event
This is something we're supposed to do according to the HTML spec. Note that image loading is currently completely ad-hoc, and this just adds a simple DocumentLoadEventDelayer to the existing implementation. This will allow us to use images in layout tests, which rely on the document load event firing at a predictable time.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibWeb/DOM/DocumentLoadEventDelayer.h>
|
||||
#include <LibWeb/HTML/FormAssociatedElement.h>
|
||||
#include <LibWeb/HTML/HTMLElement.h>
|
||||
#include <LibWeb/Loader/ImageLoader.h>
|
||||
@@ -54,6 +55,8 @@ private:
|
||||
virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
|
||||
|
||||
ImageLoader m_image_loader;
|
||||
|
||||
Optional<DOM::DocumentLoadEventDelayer> m_load_event_delayer;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user