mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
LibWeb: Honor "display:block" on IMG elements
Previously we forced all image elements to be inline-level. Now they can participate in block layout if they prefer. :^)
This commit is contained in:
parent
1bdaee475b
commit
b1a6a8600a
1 changed files with 5 additions and 1 deletions
|
@ -80,7 +80,11 @@ void HTMLImageElement::parse_attribute(FlyString const& name, String const& valu
|
||||||
|
|
||||||
RefPtr<Layout::Node> HTMLImageElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
RefPtr<Layout::Node> HTMLImageElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||||
{
|
{
|
||||||
return adopt_ref(*new Layout::ImageBox(document(), *this, move(style), m_image_loader));
|
auto display = style->display();
|
||||||
|
auto layout_node = adopt_ref(*new Layout::ImageBox(document(), *this, move(style), m_image_loader));
|
||||||
|
if (display.is_block_outside())
|
||||||
|
layout_node->set_inline(false);
|
||||||
|
return layout_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
Gfx::Bitmap const* HTMLImageElement::bitmap() const
|
Gfx::Bitmap const* HTMLImageElement::bitmap() const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue