mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 19:15:07 +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
10 changed files with 45 additions and 8 deletions
|
@ -109,7 +109,7 @@ void HTMLImageElement::form_associated_element_attribute_changed(FlyString const
|
|||
|
||||
if (name == HTML::AttributeNames::alt) {
|
||||
if (layout_node())
|
||||
verify_cast<Layout::ImageBox>(*layout_node()).dom_node_did_update_alt_text({});
|
||||
did_update_alt_text(verify_cast<Layout::ImageBox>(*layout_node()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,6 +130,11 @@ RefPtr<Gfx::Bitmap const> HTMLImageElement::bitmap() const
|
|||
return {};
|
||||
}
|
||||
|
||||
bool HTMLImageElement::is_image_available() const
|
||||
{
|
||||
return m_current_request && m_current_request->is_available();
|
||||
}
|
||||
|
||||
Optional<CSSPixels> HTMLImageElement::intrinsic_width() const
|
||||
{
|
||||
if (auto image_data = m_current_request->image_data())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue