mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
LibWeb: Make CSS layout lazier
Instead of doing layout synchronously whenever something changes, we now use a basic event loop timer to defer and coalesce relayouts. If you did something that requires a relayout of the page, make sure to call Document::set_needs_layout() and it will get coalesced with all the other layout updates. There's lots of room for improvement here, but this already makes many web pages significantly snappier. :^) Also, note that this exposes a number of layout bugs where we have been relying on multiple relayouts to calculate the correct dimensions for things. Now that we only do a single layout in many cases, these kind of problems are much more noticeable. That should also make them easier to figure out and fix. :^)
This commit is contained in:
@@ -97,7 +97,6 @@ void HTMLElement::set_inner_text(StringView text)
|
||||
append_child(document().create_text_node(text));
|
||||
|
||||
set_needs_style_update(true);
|
||||
document().invalidate_layout();
|
||||
}
|
||||
|
||||
String HTMLElement::inner_text()
|
||||
|
||||
Reference in New Issue
Block a user