1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +00:00

LibWeb: Move set_needs_display() from layout node to paintable

For this method, there is no need to go through the layout node when we
can directly reach the paintable.
This commit is contained in:
Aliaksandr Kalenik 2024-01-14 13:46:52 +01:00 committed by Andreas Kling
parent 814bed33b4
commit 7c2713c14f
21 changed files with 97 additions and 87 deletions

View file

@ -22,6 +22,7 @@
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Layout/Viewport.h>
#include <LibWeb/Namespace.h>
#include <LibWeb/Painting/Paintable.h>
namespace Web::DOM {
@ -94,9 +95,9 @@ void Range::update_associated_selection()
{
if (!m_associated_selection)
return;
if (auto* layout_root = m_associated_selection->document()->layout_node()) {
if (auto* layout_root = m_associated_selection->document()->layout_node(); layout_root && layout_root->paintable()) {
layout_root->recompute_selection_states();
layout_root->set_needs_display();
layout_root->paintable()->set_needs_display();
}
}