LibWeb: Make SVGImageElement part of CanvasImageSource union

This is very janky at the moment but it also more correct. :^)
This commit is contained in:
Andreas Kling 2024-10-04 14:39:04 +02:00 committed by Andreas Kling
commit cd0e4a49b8
Notes: github-actions[bot] 2024-10-04 18:02:14 +00:00
10 changed files with 69 additions and 12 deletions

View file

@ -29,6 +29,15 @@ public:
Gfx::Rect<CSSPixels> bounding_box() const;
// FIXME: This is a hack for images used as CanvasImageSource. Do something more elegant.
RefPtr<Gfx::Bitmap> bitmap() const
{
auto bitmap = current_image_bitmap();
if (!bitmap)
return nullptr;
return bitmap->bitmap();
}
// ^Layout::ImageProvider
virtual bool is_image_available() const override;
virtual Optional<CSSPixels> intrinsic_width() const override;