mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +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:
parent
be5f0b5ac4
commit
a403086940
Notes:
sideshowbarker
2024-07-17 17:16:17 +09:00
Author: https://github.com/awesomekling
Commit: a403086940
2 changed files with 4 additions and 0 deletions
|
@ -23,6 +23,7 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, DOM::QualifiedName q
|
|||
{
|
||||
m_image_loader.on_load = [this] {
|
||||
set_needs_style_update(true);
|
||||
this->document().set_needs_layout();
|
||||
queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
|
||||
dispatch_event(DOM::Event::create(EventNames::load));
|
||||
});
|
||||
|
@ -31,6 +32,7 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, DOM::QualifiedName q
|
|||
m_image_loader.on_fail = [this] {
|
||||
dbgln("HTMLImageElement: Resource did fail: {}", src());
|
||||
set_needs_style_update(true);
|
||||
this->document().set_needs_layout();
|
||||
queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
|
||||
dispatch_event(DOM::Event::create(EventNames::error));
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue