mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +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
Notes:
sideshowbarker
2024-07-19 10:48:54 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c0e81b26b6a
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
Reference in a new issue