mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibWeb: Invalidate layout after setting Element.innerHTML
It's not enough to only relayout here, since the API can substantially change the DOM. We have to rebuild the layout tree.
This commit is contained in:
parent
50d1490a33
commit
3b037726e9
Notes:
sideshowbarker
2024-07-18 03:20:18 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3b037726e9
1 changed files with 3 additions and 1 deletions
|
@ -389,7 +389,9 @@ ExceptionOr<void> Element::set_inner_html(String const& markup)
|
|||
return result.exception();
|
||||
|
||||
set_needs_style_update(true);
|
||||
document().set_needs_layout();
|
||||
|
||||
// NOTE: Since the DOM has changed, we have to rebuild the layout tree.
|
||||
document().invalidate_layout();
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue