LibHTML: Flesh out <img> element with LayoutImage and LayoutReplaced

This patch adds parsing of <img> into HTMLImageElement objects.
It also adds LayoutImage and its parent class LayoutReplaced, which is
going to represent CSS "replaced elements."
This commit is contained in:
Andreas Kling 2019-10-05 22:07:45 +02:00
commit 09dccb3224
Notes: sideshowbarker 2024-07-19 11:48:34 +09:00
11 changed files with 96 additions and 2 deletions

View file

@ -0,0 +1,18 @@
#pragma once
#include <LibHTML/DOM/HTMLImageElement.h>
#include <LibHTML/Layout/LayoutReplaced.h>
class HTMLImageElement;
class LayoutImage : public LayoutReplaced {
public:
LayoutImage(const HTMLImageElement&, NonnullRefPtr<StyleProperties>);
virtual ~LayoutImage() override;
virtual void layout() override;
virtual void render(RenderingContext&) override;
const HTMLImageElement& node() const { return static_cast<const HTMLImageElement&>(LayoutReplaced::node()); }
private:
};