LibWeb: Recompute selection state in Document::update_layout()

Fixes a bug when text selection disappears after relayout.
This commit is contained in:
Aliaksandr Kalenik 2024-11-14 19:48:27 +03:00 committed by Andreas Kling
parent d7caa426a0
commit 1a1fb14e26
Notes: github-actions[bot] 2024-11-14 18:51:45 +00:00

View file

@ -1234,6 +1234,10 @@ void Document::update_layout()
page().client().page_did_layout();
}
if (auto range = get_selection()->range()) {
paintable()->recompute_selection_states(*range);
}
m_needs_layout = false;
// Scrolling by zero offset will clamp scroll offset back to valid range if it was out of bounds