mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibWeb: Don't force HTMLImageElement to have a legacy ImageLoader
We achieve this by adding a new Layout::ImageProvider class and having both HTMLImageElement and HTMLObjectElement inherit from it. The HTML spec is vague on how object image loading should work, which is why this first pass is focusing on image elements.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <LibWeb/HTML/FormAssociatedElement.h>
|
||||
#include <LibWeb/HTML/HTMLElement.h>
|
||||
#include <LibWeb/HTML/NavigableContainer.h>
|
||||
#include <LibWeb/Layout/ImageProvider.h>
|
||||
#include <LibWeb/Loader/ImageLoader.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
@@ -18,7 +19,8 @@ namespace Web::HTML {
|
||||
class HTMLObjectElement final
|
||||
: public NavigableContainer
|
||||
, public FormAssociatedElement
|
||||
, public ResourceClient {
|
||||
, public ResourceClient
|
||||
, public Layout::ImageProvider {
|
||||
WEB_PLATFORM_OBJECT(HTMLObjectElement, NavigableContainer)
|
||||
FORM_ASSOCIATED_ELEMENT(NavigableContainer, HTMLObjectElement)
|
||||
|
||||
@@ -67,6 +69,10 @@ private:
|
||||
// ^DOM::Element
|
||||
virtual i32 default_tab_index_value() const override;
|
||||
|
||||
// ^Layout::ImageProvider
|
||||
virtual RefPtr<Gfx::Bitmap const> current_image_bitmap() const override;
|
||||
virtual void set_visible_in_viewport(bool) override;
|
||||
|
||||
Representation m_representation { Representation::Unknown };
|
||||
Optional<ImageLoader> m_image_loader;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user