mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-29 05:38:24 +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
|
@ -2,6 +2,7 @@
|
|||
* Copyright (c) 2018-2023, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2021-2023, Linus Groh <linusg@serenityos.org>
|
||||
* Copyright (c) 2023-2024, Shannon Booth <shannon@serenityos.org>
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -765,6 +766,18 @@ public:
|
|||
bool css_styling_flag() const { return m_css_styling_flag; }
|
||||
void set_css_styling_flag(bool flag) { m_css_styling_flag = flag; }
|
||||
|
||||
// https://w3c.github.io/editing/docs/execCommand/#state-override
|
||||
Optional<bool> command_state_override(FlyString const& command) const { return m_command_state_override.get(command); }
|
||||
void set_command_state_override(FlyString const& command, bool state) { m_command_state_override.set(command, state); }
|
||||
void clear_command_state_override(FlyString const& command) { m_command_state_override.remove(command); }
|
||||
void reset_command_state_overrides() { m_command_state_override.clear(); }
|
||||
|
||||
// https://w3c.github.io/editing/docs/execCommand/#value-override
|
||||
Optional<String const&> command_value_override(FlyString const& command) const { return m_command_value_override.get(command); }
|
||||
void set_command_value_override(FlyString const& command, String const& value);
|
||||
void clear_command_value_override(FlyString const& command);
|
||||
void reset_command_value_overrides() { m_command_value_override.clear(); }
|
||||
|
||||
GC::Ptr<DOM::Document> container_document() const;
|
||||
|
||||
GC::Ptr<HTML::Storage> session_storage_holder() { return m_session_storage_holder; }
|
||||
|
@ -1089,6 +1102,12 @@ private:
|
|||
// https://w3c.github.io/editing/docs/execCommand/#css-styling-flag
|
||||
bool m_css_styling_flag { false };
|
||||
|
||||
// https://w3c.github.io/editing/docs/execCommand/#state-override
|
||||
HashMap<FlyString, bool> m_command_state_override;
|
||||
|
||||
// https://w3c.github.io/editing/docs/execCommand/#value-override
|
||||
HashMap<FlyString, String> m_command_value_override;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webstorage.html#session-storage-holder
|
||||
// A Document object has an associated session storage holder, which is null or a Storage object. It is initially null.
|
||||
GC::Ptr<HTML::Storage> m_session_storage_holder;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue