mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Ignore repaint requests inside iframes with visibility: hidden
This reduces idle CPU usage on https://gymgrossisten.com/ from 100% (split between WebContent and Ladybird) to ~4% on my machine.
This commit is contained in:
parent
f34361950c
commit
dbf041aa98
Notes:
github-actions[bot]
2025-10-23 15:43:56 +00:00
Author: https://github.com/awesomekling
Commit: dbf041aa98
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6555
3 changed files with 23 additions and 0 deletions
|
|
@ -2766,4 +2766,19 @@ void Navigable::reset_zoom()
|
|||
document->visual_viewport()->reset();
|
||||
}
|
||||
|
||||
bool Navigable::has_inclusive_ancestor_with_visibility_hidden() const
|
||||
{
|
||||
if (auto container = this->container()) {
|
||||
if (auto container_computed_properties = container->computed_properties()) {
|
||||
if (container_computed_properties->visibility() == CSS::Visibility::Hidden)
|
||||
return true;
|
||||
}
|
||||
if (auto ancestor_navigable = container->document().navigable()) {
|
||||
if (auto ancestor_container = ancestor_navigable->container())
|
||||
return ancestor_navigable->has_inclusive_ancestor_with_visibility_hidden();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,6 +203,8 @@ public:
|
|||
bool needs_repaint() const { return m_needs_repaint; }
|
||||
void set_needs_repaint() { m_needs_repaint = true; }
|
||||
|
||||
[[nodiscard]] bool has_inclusive_ancestor_with_visibility_hidden() const;
|
||||
|
||||
RefPtr<Gfx::SkiaBackendContext> skia_backend_context() const;
|
||||
|
||||
void set_pending_set_browser_zoom_request(bool value) { m_pending_set_browser_zoom_request = value; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue