mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +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:
parent
d47f77169f
commit
684fa0f99b
Notes:
sideshowbarker
2024-07-19 03:21:01 +09:00
Author: https://github.com/awesomekling
Commit: 684fa0f99b
4 changed files with 18 additions and 8 deletions
|
@ -109,8 +109,7 @@ void InProcessWebView::select_all()
|
|||
if (is<LayoutText>(*last_layout_node))
|
||||
last_layout_node_index_in_node = downcast<LayoutText>(*last_layout_node).text_for_rendering().length() - 1;
|
||||
|
||||
layout_root->selection().set({ first_layout_node, 0 }, { last_layout_node, last_layout_node_index_in_node });
|
||||
layout_root->recompute_selection_states();
|
||||
layout_root->set_selection({ { first_layout_node, 0 }, { last_layout_node, last_layout_node_index_in_node } });
|
||||
update();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue