mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Don't force relayout after every keyboard input event
Instead, just rely on the invalidation and lazy relayout that happens as a consequence of mutating the DOM. This allows multiple keystrokes to coalesce into a single relayout if necessary, dramatically improving performance when typing text into form fields on complex pages.
This commit is contained in:
parent
c51a4cc007
commit
a7d7c5b7b4
Notes:
sideshowbarker
2024-07-18 08:59:31 +09:00
Author: https://github.com/awesomekling
Commit: a7d7c5b7b4
Pull-request: https://github.com/SerenityOS/serenity/pull/23626
1 changed files with 0 additions and 15 deletions
|
@ -33,11 +33,6 @@ void EditEventHandler::handle_delete_character_after(JS::NonnullGCPtr<DOM::Posit
|
|||
builder.append(text.bytes_as_string_view().substring_view(*next_grapheme_offset));
|
||||
node.set_data(MUST(builder.to_string()));
|
||||
|
||||
// FIXME: When nodes are removed from the DOM, the associated layout nodes become stale and still
|
||||
// remain in the layout tree. This has to be fixed, this just causes everything to be recomputed
|
||||
// which really hurts performance.
|
||||
m_browsing_context->active_document()->force_layout();
|
||||
|
||||
m_browsing_context->did_edit({});
|
||||
}
|
||||
|
||||
|
@ -94,11 +89,6 @@ void EditEventHandler::handle_delete(DOM::Range& range)
|
|||
end->remove();
|
||||
}
|
||||
|
||||
// FIXME: When nodes are removed from the DOM, the associated layout nodes become stale and still
|
||||
// remain in the layout tree. This has to be fixed, this just causes everything to be recomputed
|
||||
// which really hurts performance.
|
||||
m_browsing_context->active_document()->force_layout();
|
||||
|
||||
m_browsing_context->did_edit({});
|
||||
}
|
||||
|
||||
|
@ -131,11 +121,6 @@ void EditEventHandler::handle_insert(JS::NonnullGCPtr<DOM::Position> position, u
|
|||
position->set_offset(1);
|
||||
}
|
||||
|
||||
// FIXME: When nodes are removed from the DOM, the associated layout nodes become stale and still
|
||||
// remain in the layout tree. This has to be fixed, this just causes everything to be recomputed
|
||||
// which really hurts performance.
|
||||
m_browsing_context->active_document()->force_layout();
|
||||
|
||||
m_browsing_context->did_edit({});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue