mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 08:48:49 +00:00
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:
parent
c4295edc81
commit
45a47cb32b
Notes:
sideshowbarker
2024-07-17 00:25:35 +09:00
Author: https://github.com/trflynn89
Commit: 45a47cb32b
Pull-request: https://github.com/SerenityOS/serenity/pull/23254
Issue: https://github.com/SerenityOS/serenity/issues/23239
10 changed files with 45 additions and 8 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue