mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 19:45:07 +00:00
LibWeb: Begin supporting non-image HTMLObjectElement data representation
We currently only supported loading image data from an HTMLObjectElement node. This adds (some) support for non-image data. A big FIXME is to actually paint that data. We will need to make FrameBox and NestedBrowsingContextPaintable work with HTMLObjectElement for this (they currently only work with HTMLIFrameElement).
This commit is contained in:
parent
f733385cc4
commit
69749b044c
2 changed files with 52 additions and 19 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <LibCore/Forward.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibWeb/HTML/BrowsingContextContainer.h>
|
||||
#include <LibWeb/HTML/FormAssociatedElement.h>
|
||||
#include <LibWeb/HTML/HTMLElement.h>
|
||||
#include <LibWeb/Loader/ImageLoader.h>
|
||||
|
@ -15,10 +16,17 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
class HTMLObjectElement final
|
||||
: public HTMLElement
|
||||
: public BrowsingContextContainer
|
||||
, public FormAssociatedElement
|
||||
, public ResourceClient {
|
||||
FORM_ASSOCIATED_ELEMENT(HTMLElement, HTMLObjectElement)
|
||||
FORM_ASSOCIATED_ELEMENT(BrowsingContextContainer, HTMLObjectElement)
|
||||
|
||||
enum class Representation {
|
||||
Unknown,
|
||||
Image,
|
||||
NestedBrowsingContext,
|
||||
Children,
|
||||
};
|
||||
|
||||
public:
|
||||
using WrapperType = Bindings::HTMLObjectElementWrapper;
|
||||
|
@ -52,8 +60,8 @@ private:
|
|||
virtual void resource_did_load() override;
|
||||
virtual void resource_did_fail() override;
|
||||
|
||||
Representation m_representation { Representation::Unknown };
|
||||
Optional<ImageLoader> m_image_loader;
|
||||
bool m_should_show_fallback_content { false };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue