1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 15:34:59 +00:00

LibWeb: Schedule a relayout after <image> and <object> elements load

Otherwise we'll be stuck with the intrinsic dimensions of the
replacement content.
This commit is contained in:
Andreas Kling 2022-03-16 23:12:18 +01:00
parent be5f0b5ac4
commit a403086940
2 changed files with 4 additions and 0 deletions

View file

@ -21,6 +21,7 @@ HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName
m_image_loader.on_load = [this] {
m_should_show_fallback_content = false;
set_needs_style_update(true);
this->document().set_needs_layout();
// FIXME: This should be done by the HTML^Wdocument parser.
dispatch_event(DOM::Event::create(HTML::EventNames::load));
};
@ -28,6 +29,7 @@ HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName
m_image_loader.on_fail = [this] {
m_should_show_fallback_content = true;
set_needs_style_update(true);
this->document().set_needs_layout();
// FIXME: This should be done by the HTML^Wdocument parser.
dispatch_event(DOM::Event::create(HTML::EventNames::load));
};