mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +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:
committed by
Andreas Kling
parent
c4295edc81
commit
45a47cb32b
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user