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:
parent
1aea8f116b
commit
c0e81b26b6
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue