Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2c84f4f3c4eafb71100f721c4e7e0318f0250f99
      
https://github.com/WebKit/WebKit/commit/2c84f4f3c4eafb71100f721c4e7e0318f0250f99
  Author: Jean Haberer <[email protected]>
  Date:   2026-07-10 (Fri, 10 Jul 2026)

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

  Log Message:
  -----------
  Navigating back to page with previously active web env leaves UI stuck 
showing active state
https://bugs.webkit.org/show_bug.cgi?id=318860
rdar://180966321

Reviewed by Etienne Segonzac.

Trigger the state exit of the old immersive element and queue the 
immersivechange notification when the document is about to
enter the back/forward cache, mirroring how pointer lock is torn down at the 
same call site.
Since the Immersive environment cannot survive navigation, it is safe to clear 
the immersive document state at this point,
to get back from a clean slate if the user navigates back to this page.
Sending the event to the page ensures that it updates its UI and doesn't stay 
in a stale state thinking that the
immersive environment is still up.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::setBackForwardCacheState):
* Source/WebCore/dom/DocumentImmersive.cpp:
(WebCore::DocumentImmersive::clearForBackForwardCache):
* Source/WebCore/dom/DocumentImmersive.h:

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



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

Reply via email to