mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-24 19:21:52 +00:00
LibWeb: Fire input
events in .execCommand()
We do not fire `beforeinput` events since other browsers do not seem to do so either. The spec asks us to check whether a command's action modified the DOM tree. This means adding or removing nodes and attributes, or changing character data anywhere in the tree. We have `Document::dom_tree_version()` for node updates, but for character data a new version number is introduced that allows us to easily keep track of any text changes in the entire tree.
This commit is contained in:
parent
10d011c75f
commit
0bb0061915
Notes:
github-actions[bot]
2025-01-24 22:54:17 +00:00
Author: https://github.com/gmta
Commit: 0bb0061915
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3352
8 changed files with 104 additions and 41 deletions
|
@ -135,6 +135,7 @@ WebIDL::ExceptionOr<void> CharacterData::replace_data(size_t offset, size_t coun
|
|||
static_cast<Layout::TextNode&>(*layout_node).invalidate_text_for_rendering();
|
||||
|
||||
document().set_needs_layout();
|
||||
document().bump_character_data_version();
|
||||
|
||||
if (m_grapheme_segmenter)
|
||||
m_grapheme_segmenter->set_segmented_text(m_data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue