mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibWeb: Add command state & value overrides to DOM::Document
This commit is contained in:
parent
67800091c5
commit
e21ee10b3c
Notes:
github-actions[bot]
2025-01-10 22:38:29 +00:00
Author: https://github.com/gmta
Commit: e21ee10b3c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3216
6 changed files with 173 additions and 7 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021-2022, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -470,6 +471,13 @@ void Selection::set_range(GC::Ptr<DOM::Range> range)
|
|||
|
||||
if (m_range)
|
||||
m_range->set_associated_selection({}, this);
|
||||
|
||||
// https://w3c.github.io/editing/docs/execCommand/#state-override
|
||||
// Whenever the number of ranges in the selection changes to something different, and whenever a boundary point of
|
||||
// the range at a given index in the selection changes to something different, the state override and value override
|
||||
// must be unset for every command.
|
||||
m_document->reset_command_state_overrides();
|
||||
m_document->reset_command_value_overrides();
|
||||
}
|
||||
|
||||
GC::Ptr<DOM::Position> Selection::cursor_position() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue