mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +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
|
@ -4,6 +4,7 @@
|
|||
* Copyright (c) 2021-2023, Luke Wilde <lukew@serenityos.org>
|
||||
* Copyright (c) 2021-2024, Sam Atkins <sam@ladybird.org>
|
||||
* Copyright (c) 2024, Matthew Olsson <mattco@serenityos.org>
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -662,6 +663,15 @@ WebIDL::ExceptionOr<Document*> Document::open(Optional<String> const&, Optional<
|
|||
// 11. Replace all with null within document, without firing any mutation events.
|
||||
replace_all(nullptr);
|
||||
|
||||
// https://w3c.github.io/editing/docs/execCommand/#state-override
|
||||
// When document.open() is called and a document's singleton objects are all replaced by new instances of those
|
||||
// objects, editing state associated with that document (including the CSS styling flag, default single-line
|
||||
// container name, and any state overrides or value overrides) must be reset.
|
||||
set_css_styling_flag(false);
|
||||
set_default_single_line_container_name(HTML::TagNames::div);
|
||||
reset_command_state_overrides();
|
||||
reset_command_value_overrides();
|
||||
|
||||
// 12. If document is fully active, then:
|
||||
if (is_fully_active()) {
|
||||
// 1. Let newURL be a copy of entryDocument's URL.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue