mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibWeb: Detach paintables from *all* DOM nodes before committing layout
Before this change, we were not detaching paintables from DOM nodes within shadow subtrees. This appears to be the main reason that keyboard editing was doing immediate forced relayout: doing a full layout invalidation meant we'd build a new layout tree, which then hid the problem with with still-attached paintables. By detaching them before committing a new layout, we make it possible for keyboard editing to just use normal relayout, instead of full forced invalidation & relayout.
This commit is contained in:
parent
a97e9f1d58
commit
c51a4cc007
Notes:
sideshowbarker
2024-07-17 02:35:27 +09:00
Author: https://github.com/awesomekling
Commit: c51a4cc007
Pull-request: https://github.com/SerenityOS/serenity/pull/23626
1 changed files with 6 additions and 1 deletions
|
@ -1,11 +1,12 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2023, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022-2024, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2024, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/Debug.h>
|
||||
#include <LibWeb/DOM/ShadowRoot.h>
|
||||
#include <LibWeb/Layout/AvailableSpace.h>
|
||||
#include <LibWeb/Layout/BlockContainer.h>
|
||||
#include <LibWeb/Layout/InlineNode.h>
|
||||
|
@ -209,6 +210,10 @@ void LayoutState::commit(Box& root)
|
|||
node.set_paintable(nullptr);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
root.document().for_each_shadow_including_inclusive_descendant([&](DOM::Node& node) {
|
||||
node.set_paintable(nullptr);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
HashTable<Layout::TextNode*> text_nodes;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue