Title: [231914] trunk/Source/WebKit
Revision
231914
Author
[email protected]
Date
2018-05-17 11:47:06 -0700 (Thu, 17 May 2018)

Log Message

Ensure valid rects for fullsceen animation.
https://bugs.webkit.org/show_bug.cgi?id=185736
rdar://problem/40320174

Patch by Jeremy Jones <[email protected]> on 2018-05-17
Reviewed by Jer Noble.

Protect against zero width and height since those can make for NANs in the animation transforms.

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

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (231913 => 231914)


--- trunk/Source/WebKit/ChangeLog	2018-05-17 18:44:33 UTC (rev 231913)
+++ trunk/Source/WebKit/ChangeLog	2018-05-17 18:47:06 UTC (rev 231914)
@@ -1,3 +1,17 @@
+2018-05-17  Jeremy Jones  <[email protected]>
+
+        Ensure valid rects for fullsceen animation.
+        https://bugs.webkit.org/show_bug.cgi?id=185736
+        rdar://problem/40320174
+
+        Reviewed by Jer Noble.
+
+        Protect against zero width and height since those can make for NANs in the animation transforms.
+
+        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
+        (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
+        (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
+
 2018-05-17  Jer Noble  <[email protected]>
 
         Turn Modern EME API on by default and remove it as an experimental feature

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


--- trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm	2018-05-17 18:44:33 UTC (rev 231913)
+++ trunk/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm	2018-05-17 18:47:06 UTC (rev 231914)
@@ -61,6 +61,11 @@
 
 namespace WebKit {
 
+static CGSize sizeExpandedToSize(CGSize initial, CGSize other)
+{
+    return CGSizeMake(std::max(initial.width, other.width),  std::max(initial.height, other.height));
+}
+
 static void replaceViewWithView(UIView *view, UIView *otherView)
 {
     [CATransaction begin];
@@ -504,7 +509,10 @@
 
     _initialFrame = initialFrame;
     _finalFrame = finalFrame;
-
+    
+    _initialFrame.size = sizeExpandedToSize(_initialFrame.size, CGSizeMake(1, 1));
+    _finalFrame.size = sizeExpandedToSize(_finalFrame.size, CGSizeMake(1, 1));
+    
     [CATransaction begin];
     [CATransaction setDisableActions:YES];
 
@@ -570,6 +578,9 @@
     _initialFrame = initialFrame;
     _finalFrame = finalFrame;
     
+    _initialFrame.size = sizeExpandedToSize(_initialFrame.size, CGSizeMake(1, 1));
+    _finalFrame.size = sizeExpandedToSize(_finalFrame.size, CGSizeMake(1, 1));
+    
     [_webView _page]->setSuppressVisibilityUpdates(true);
 
     [_fullscreenViewController setPrefersStatusBarHidden:NO];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to