LibWeb: Remove duplicate code from ViewportPaintable

No functional changes.
This commit is contained in:
Jelle Raaijmakers 2024-08-22 15:21:43 +02:00 committed by Tim Flynn
parent 730ec6aff9
commit 69bbeea4ef
Notes: github-actions[bot] 2024-08-27 11:13:08 +00:00

View file

@ -224,20 +224,12 @@ void ViewportPaintable::recompute_selection_states()
// 2. If it's a text node, mark it as StartAndEnd and return.
if (is<DOM::Text>(*start_container)) {
if (auto* paintable = start_container->paintable()) {
if (auto* paintable = start_container->paintable())
paintable->set_selection_state(SelectionState::StartAndEnd);
}
return;
}
}
if (start_container == end_container && is<DOM::Text>(*start_container)) {
if (auto* paintable = start_container->paintable()) {
paintable->set_selection_state(SelectionState::StartAndEnd);
}
return;
}
// 4. Mark the selection start node as Start (if text) or Full (if anything else).
if (auto* paintable = start_container->paintable()) {
if (is<DOM::Text>(*start_container))