1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

LibWeb: Move paint properties invalidation flag into Document

Move paint-only properties invalidation flag to Document for
consistency, as style and layout invalidation flags are already
managed there.
This commit is contained in:
Aliaksandr Kalenik 2024-02-08 17:23:14 +01:00 committed by Andreas Kling
parent 9bccb8c8d7
commit fc40d35012
5 changed files with 19 additions and 14 deletions

View file

@ -1060,10 +1060,8 @@ void Document::update_layout()
// Broadcast the current viewport rect to any new paintables, so they know whether they're visible or not.
inform_all_viewport_clients_about_the_current_viewport_rect();
if (navigable()) {
navigable()->set_needs_to_resolve_paint_only_properties();
navigable()->set_needs_display();
}
navigable()->set_needs_display();
set_needs_to_resolve_paint_only_properties();
if (navigable()->is_traversable()) {
page().client().page_did_layout();
@ -1145,6 +1143,15 @@ void Document::update_style()
m_style_update_timer->stop();
}
void Document::update_paint_and_hit_testing_properties_if_needed()
{
if (!m_needs_to_resolve_paint_only_properties)
return;
m_needs_to_resolve_paint_only_properties = false;
if (auto* paintable = this->paintable())
paintable->resolve_paint_only_properties();
}
void Document::set_link_color(Color color)
{
m_link_color = color;