mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
LibWeb: Support range delection accross nodes with shared parent.
This commit is contained in:
parent
43dc47a494
commit
e96faea1a2
Notes:
sideshowbarker
2024-07-19 00:57:16 +09:00
Author: https://github.com/asynts
Commit: e96faea1a2
Pull-request: https://github.com/SerenityOS/serenity/pull/4318
Reviewed-by: https://github.com/Lubrsi
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/linusg
2 changed files with 52 additions and 21 deletions
|
@ -353,25 +353,21 @@ bool EventHandler::handle_keydown(KeyCode key, unsigned modifiers, u32 code_poin
|
|||
m_edit_event_handler->handle_delete(range);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
m_edit_event_handler->handle_delete(range);
|
||||
m_edit_event_handler->handle_insert(m_frame.cursor_position(), code_point);
|
||||
return true;
|
||||
}
|
||||
|
||||
// FIXME: Check if this code point is in the printable character range.
|
||||
|
||||
m_edit_event_handler->handle_delete(range);
|
||||
m_edit_event_handler->handle_insert(m_frame.cursor_position(), code_point);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_frame.cursor_position().is_valid() && m_frame.cursor_position().node()->is_editable()) {
|
||||
if (key == KeyCode::Key_Backspace) {
|
||||
m_edit_event_handler->handle_delete(m_frame.cursor_position());
|
||||
return true;
|
||||
} else {
|
||||
m_edit_event_handler->handle_insert(m_frame.cursor_position(), code_point);
|
||||
return true;
|
||||
}
|
||||
|
||||
// FIXME: Check if this code point is in the printable character range.
|
||||
|
||||
m_edit_event_handler->handle_insert(m_frame.cursor_position(), code_point);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue