Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 09322c4c8222987d5be229bf661b5c3ae4420664
      
https://github.com/WebKit/WebKit/commit/09322c4c8222987d5be229bf661b5c3ae4420664
  Author: Aditya Keerthi <[email protected]>
  Date:   2024-01-07 (Sun, 07 Jan 2024)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
    M Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm

  Log Message:
  -----------
  REGRESSION (270199@main): [visionOS] YouTube.com live chat flashes blank when 
exiting fullscreen
https://bugs.webkit.org/show_bug.cgi?id=267144
rdar://119210895

Reviewed by Tim Horton.

In order to let the safe area insets determine viewport layout parameters,
270199@main removed the call to `-[WKWebView 
_overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]`
in `-[WKFullScreenWindowController enterFullScreen:]`. While this change remains
desirable, that method call also served to ensure that viewport layout 
parameters
were stable until fullscreen exit was completed, when the original parameters 
were
restored in `-[WKFullScreenWindowController _reinsertWebViewUnderPlaceholder]`.

Specifically, with the removal of that method call, the web view's frame and 
safe
area insets are now always used to determine layout parameters while 
transitioning
into and out of fullscreen. This means that if a client were to change the frame
of the web view during the transition, the view layout size in the web process
would be updated.

Safari sets the frame of the web view back to the original size during the 
transition.
While this is not ideal client behavior, there is nothing stopping any client 
from
modifying the web view's frame. This results in the view layout size mismatching
with the other fullscreen specific overrides, which are only restored once the
transition is complete. The mismatch ultimately results in layout happening 
with an
incorrect viewport configuration, which is then fixed when the transition is 
fully
complete. This results in a flash, as YouTube's content is viewport size 
dependent.

Previously, setting the frame during the transition had no effect, as the 
overridden size
was used up until it was restored, when the transition was complete.

To fix without removing the intent of 270199@main, defer all geometry updates
while the fullscreen exit transition is happening. This ensures that used
viewport configuration remains stable during the transition.

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h:

Introduce a new fullscreen-specific bit that will be used to defer geometry 
updates.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _shouldDeferGeometryUpdates]):
(-[WKWebView _beginAnimatedFullScreenExit]):
(-[WKWebView _endAnimatedFullScreenExit]):
* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController exitFullScreen]):
(-[WKFullScreenWindowController _reinsertWebViewUnderPlaceholder]):

Stop deferring geometry updates once the original state of the web view has
fully been restored.

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to