mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Enable partial layout tree update in a bunch of cases
These common cases now cause us to invalidate the layout tree starting at the relevant parent node instead of invalidating the entire tree. - DOM node insertion - DOM node removal - innerHTML setter - textContent setter This makes a lot of dynamic content much faster. For example, demos on shadertoy.com go from ~18 fps to ~28 fps on my machine.
This commit is contained in:
parent
c01d810e5a
commit
e5d521bef8
Notes:
github-actions[bot]
2025-01-18 20:01:59 +00:00
Author: https://github.com/awesomekling
Commit: e5d521bef8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3274
2 changed files with 5 additions and 6 deletions
|
@ -808,7 +808,7 @@ WebIDL::ExceptionOr<void> Element::set_inner_html(StringView value)
|
|||
|
||||
if (context->is_connected()) {
|
||||
// NOTE: Since the DOM has changed, we have to rebuild the layout tree.
|
||||
context->document().invalidate_layout_tree();
|
||||
context->set_needs_layout_tree_update(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue