mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibWeb: Move selection state from layout tree to paint tree
Where we paint the selection is obviously paint-related information, so let's keep it in the paint tree.
This commit is contained in:
parent
d18a5b904d
commit
1987318cc2
Notes:
sideshowbarker
2024-07-17 11:29:41 +09:00
Author: https://github.com/awesomekling
Commit: 1987318cc2
Pull-request: https://github.com/SerenityOS/serenity/pull/23626
9 changed files with 100 additions and 98 deletions
|
@ -25,6 +25,7 @@
|
|||
#include <LibWeb/Layout/Viewport.h>
|
||||
#include <LibWeb/Namespace.h>
|
||||
#include <LibWeb/Painting/Paintable.h>
|
||||
#include <LibWeb/Painting/ViewportPaintable.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
|
@ -97,9 +98,9 @@ void Range::update_associated_selection()
|
|||
{
|
||||
if (!m_associated_selection)
|
||||
return;
|
||||
if (auto* layout_root = m_associated_selection->document()->layout_node(); layout_root && layout_root->paintable()) {
|
||||
layout_root->recompute_selection_states();
|
||||
layout_root->paintable()->set_needs_display();
|
||||
if (auto* viewport = m_associated_selection->document()->paintable()) {
|
||||
viewport->recompute_selection_states();
|
||||
viewport->set_needs_display();
|
||||
}
|
||||
|
||||
// https://w3c.github.io/selection-api/#selectionchange-event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue