LibHTML: Ignore layout repaints outside the visible viewport

Now that Frame knows the visible viewport rect, it can easily ignore
repaint requests from e.g <blink> elements that are not currently
scrolled into view. :^)
This commit is contained in:
Andreas Kling 2019-12-18 22:16:27 +01:00
parent 1aea8f116b
commit c0e81b26b6
Notes: sideshowbarker 2024-07-19 10:48:54 +09:00

View file

@ -45,6 +45,9 @@ void Frame::set_viewport_rect(const Rect& rect)
void Frame::set_needs_display(const Rect& rect)
{
if (!m_viewport_rect.intersects(rect))
return;
if (!on_set_needs_display)
return;
on_set_needs_display(rect);