mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
LibWeb: Don't update rendering in BrowsingContexts without opportunity
This patch adds the "has a rendering opportunity" concept from the spec to BrowsingContext and uses it to filter out contexts that are unable to render right now when doing the event loop's rendering updates. Note that we actually consider all contexts to have a rendering opportunity at all times right now. Coming up with reasons to avoid rendering is left as a FIXME. :^)
This commit is contained in:
parent
6e341cd696
commit
962298b040
Notes:
sideshowbarker
2024-07-18 03:08:42 +09:00
Author: https://github.com/awesomekling
Commit: 962298b040
3 changed files with 17 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <LibWeb/DOM/Window.h>
|
||||
#include <LibWeb/HTML/EventLoop/EventLoop.h>
|
||||
#include <LibWeb/HighResolutionTime/Performance.h>
|
||||
#include <LibWeb/Page/BrowsingContext.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
|
@ -139,7 +140,10 @@ void EventLoop::process()
|
|||
}
|
||||
};
|
||||
|
||||
// FIXME: 2. Rendering opportunities: Remove from docs all Document objects whose browsing context do not have a rendering opportunity.
|
||||
// 2. Rendering opportunities: Remove from docs all Document objects whose browsing context do not have a rendering opportunity.
|
||||
docs.remove_all_matching([&](auto& document) {
|
||||
return document->browsing_context() && !document->browsing_context()->has_a_rendering_opportunity();
|
||||
});
|
||||
|
||||
// 3. If docs is not empty, then set hasARenderingOpportunity to true.
|
||||
if (!docs.is_empty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue