1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 02:24:59 +00:00

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

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);