Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2661f9a26e1dcf5c1001cad57dbc68f7ab329f7d
      
https://github.com/WebKit/WebKit/commit/2661f9a26e1dcf5c1001cad57dbc68f7ab329f7d
  Author: Jean Haberer <[email protected]>
  Date:   2026-03-23 (Mon, 23 Mar 2026)

  Changed paths:
    M Source/WebCore/dom/DocumentImmersive.cpp
    M Source/WebCore/dom/DocumentImmersive.h

  Log Message:
  -----------
  The current document immersive element should be updated as soon as it gets 
presented
https://bugs.webkit.org/show_bug.cgi?id=310337
rdar://172987822

Reviewed by Etienne Segonzac.

The issue was that the immersivechange event was triggered after we got the
callback from the chrome client. But this callback is usually triggered when 
the immersive
transition is completely finished. In reality, the immersive element starts to
be displayed at the begining of this transition. This is why the immersivechange
event should be triggered as soon as we ask the client to present the model.
Additionally, the immersiveElement should be updated as well.
In the case where the client fails to transition to immersive (rare scenario 
since
we already checked the client for permission), an error is thrown in the 
request,
an immersiveerror event is triggered, and a new immersivechange event is 
notifying
the website that the immersiveElement switched back to null.

* Source/WebCore/dom/DocumentImmersive.cpp:
(WebCore::DocumentImmersive::cancelActiveRequest):
If another request comes in and we are in the presentation stage of an old 
request,
we don't need to dismiss the client presentation right away.
This is already handled in the new transition's logic.

(WebCore::DocumentImmersive::beginImmersiveRequest):
(WebCore::DocumentImmersive::createModelPlayerForImmersive):
(WebCore::DocumentImmersive::presentImmersiveElement):
(WebCore::DocumentImmersive::isRequestOutdated):
(WebCore::DocumentImmersive::checkRequestStillValid): Deleted.
* Source/WebCore/dom/DocumentImmersive.h:
Renamed checkRequestStillValid to isRequestOutdated.

Canonical link: https://commits.webkit.org/309771@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to