Title: [274487] trunk/Source/WebKit
Revision
274487
Author
[email protected]
Date
2021-03-16 10:08:33 -0700 (Tue, 16 Mar 2021)

Log Message

[iOS] Scroll event is fired before webkitfullscreenchange event when an element enters fullscreen
https://bugs.webkit.org/show_bug.cgi?id=223221

Reviewed by Eric Carlson.

Defer the "scroll" event until the "webkitfullscreenchange" event is fired
when an element enters fullscreen. We have to do that because some sites use
"scroll" event handler to remove elements out of visible area, which may
conflict with the entering fullscreen process.

No new tests. We cannot test this patch with a layout test because
`InjectedBundlePageFullScreenClient` in WKTR does not support testing the
fullscreen implementation in the UI process, which is related to the "scroll"
event. We cannot add an API test on iOS for it either because the test binary
is not a real "app" (webkit.org/b/212654).

* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController enterFullScreen]):
(-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (274486 => 274487)


--- trunk/Source/WebKit/ChangeLog	2021-03-16 16:57:35 UTC (rev 274486)
+++ trunk/Source/WebKit/ChangeLog	2021-03-16 17:08:33 UTC (rev 274487)
@@ -1,3 +1,25 @@
+2021-03-16  Peng Liu  <[email protected]>
+
+        [iOS] Scroll event is fired before webkitfullscreenchange event when an element enters fullscreen
+        https://bugs.webkit.org/show_bug.cgi?id=223221
+
+        Reviewed by Eric Carlson.
+
+        Defer the "scroll" event until the "webkitfullscreenchange" event is fired
+        when an element enters fullscreen. We have to do that because some sites use
+        "scroll" event handler to remove elements out of visible area, which may
+        conflict with the entering fullscreen process.
+
+        No new tests. We cannot test this patch with a layout test because
+        `InjectedBundlePageFullScreenClient` in WKTR does not support testing the
+        fullscreen implementation in the UI process, which is related to the "scroll"
+        event. We cannot add an API test on iOS for it either because the test binary
+        is not a real "app" (webkit.org/b/212654).
+
+        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
+        (-[WKFullScreenWindowController enterFullScreen]):
+        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
+
 2021-03-16  Per Arne  <[email protected]>
 
         Add signpost for injected bundle creation

Modified: trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm (274486 => 274487)


--- trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm	2021-03-16 16:57:35 UTC (rev 274486)
+++ trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm	2021-03-16 17:08:33 UTC (rev 274487)
@@ -605,8 +605,6 @@
         
         [[_webViewPlaceholder layer] setContents:(id)[snapshotImage CGImage]];
         WebKit::replaceViewWithView(webView.get(), _webViewPlaceholder.get());
-
-        WebKit::WKWebViewState().applyTo(webView.get());
         
         [webView setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
         [webView setFrame:[_window bounds]];
@@ -680,6 +678,7 @@
             return;
         }
 
+        WebKit::WKWebViewState().applyTo(webView.get());
         auto page = [self._webView _page];
         auto* manager = self._manager;
         if (page && manager) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to