mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +00:00
LibWeb: Broadcast the viewport rect to clients immediately after layout
This lets elements figure out if they're visible within the viewport or not, so they take appropriate action. Fixes the issues with animations not starting until the viewport was resized or scrolled.
This commit is contained in:
parent
dbe961ca02
commit
6ae208dbf6
3 changed files with 11 additions and 0 deletions
|
@ -539,6 +539,12 @@ void BrowsingContext::set_active_document(JS::NonnullGCPtr<DOM::Document> docume
|
|||
previously_active_document->did_stop_being_active_document_in_browsing_context({});
|
||||
}
|
||||
|
||||
void BrowsingContext::inform_all_viewport_clients_about_the_current_viewport_rect()
|
||||
{
|
||||
for (auto* client : m_viewport_clients)
|
||||
client->browsing_context_did_set_viewport_rect(viewport_rect());
|
||||
}
|
||||
|
||||
void BrowsingContext::set_viewport_rect(CSSPixelRect const& rect)
|
||||
{
|
||||
bool did_change = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue