LibWeb: Generalize ImageBox and ImagePaintable for any ImageProvider

They currently assume the DOM node is an HTMLImageElement with respect
to handling the alt attribute. The HTMLInputElement will require the
same behavior.
This commit is contained in:
Timothy Flynn 2024-02-18 20:10:37 -05:00 committed by Andreas Kling
parent c4295edc81
commit 45a47cb32b
Notes: sideshowbarker 2024-07-17 00:25:35 +09:00
10 changed files with 45 additions and 8 deletions

View file

@ -369,6 +369,11 @@ JS::GCPtr<DecodedImageData> HTMLObjectElement::image_data() const
return m_image_request->image_data();
}
bool HTMLObjectElement::is_image_available() const
{
return image_data() != nullptr;
}
Optional<CSSPixels> HTMLObjectElement::intrinsic_width() const
{
if (auto image_data = this->image_data())