1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 23:37:43 +00:00

LibWeb: Make selection state recomputation implicit

Add a LayoutDocument API for modifying the selection and make clients
call that so we can recompute selection states automatically.
This commit is contained in:
Andreas Kling 2020-08-21 17:54:44 +02:00
parent d47f77169f
commit 684fa0f99b
4 changed files with 18 additions and 8 deletions

View file

@ -146,4 +146,16 @@ void LayoutDocument::recompute_selection_states()
});
}
void LayoutDocument::set_selection(const LayoutRange & selection)
{
m_selection = selection;
recompute_selection_states();
}
void LayoutDocument::set_selection_end(const LayoutPosition& position)
{
m_selection.set_end(position);
recompute_selection_states();
}
}