mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 01:38:52 +00:00
LibWeb: Remove shadow roots from elements that are removed from the DOM
We currently create a shadow tree once for each DOM element that renders with a shadow tree (e.g. <input>, <details>). If such an element is removed from the DOM, we must remove its shadow tree. Otherwise, the shadow tree will refer to the old document in perpetuity. If the node is added back to a DOM, then recreate the shadow tree.
This commit is contained in:
parent
3cde479416
commit
ff48b7333c
Notes:
sideshowbarker
2024-07-16 18:26:46 +09:00
Author: https://github.com/trflynn89
Commit: ff48b7333c
Pull-request: https://github.com/SerenityOS/serenity/pull/22094
Reviewed-by: https://github.com/AtkinsSJ ✅
12 changed files with 67 additions and 3 deletions
|
@ -1003,6 +1003,11 @@ void HTMLInputElement::form_associated_element_was_inserted()
|
|||
create_shadow_tree_if_needed();
|
||||
}
|
||||
|
||||
void HTMLInputElement::form_associated_element_was_removed(DOM::Node*)
|
||||
{
|
||||
set_shadow_root(nullptr);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/input.html#radio-button-group
|
||||
static bool is_in_same_radio_button_group(HTML::HTMLInputElement const& a, HTML::HTMLInputElement const& b)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue