Title: [185473] trunk/Source/WebKit2
Revision
185473
Author
[email protected]
Date
2015-06-11 14:06:23 -0700 (Thu, 11 Jun 2015)

Log Message

Full screen video space can be resized to 1pt wide
https://bugs.webkit.org/show_bug.cgi?id=145895
<rdar://problem/20907914>

Reviewed by Simon Fraser.

Prior to the upcoming OS X, full screen mode was not resizable. Now that it is,
we need to set a minimum window width that is large enough to hold the media
controls. This makes our full-screen video behave the same as the QuickTimeX player.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Active that new
kWKLayoutModeDynamicSizeWithMinimumViewSize style, and set the minimum view size to
be the width of our media controls, with 20 pixels of padding on either side.
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Set the layout
mode back to the default style.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (185472 => 185473)


--- trunk/Source/WebKit2/ChangeLog	2015-06-11 20:53:49 UTC (rev 185472)
+++ trunk/Source/WebKit2/ChangeLog	2015-06-11 21:06:23 UTC (rev 185473)
@@ -1,3 +1,22 @@
+2015-06-11  Brent Fulgham  <[email protected]>
+
+        Full screen video space can be resized to 1pt wide
+        https://bugs.webkit.org/show_bug.cgi?id=145895
+        <rdar://problem/20907914>
+
+        Reviewed by Simon Fraser.
+
+        Prior to the upcoming OS X, full screen mode was not resizable. Now that it is,
+        we need to set a minimum window width that is large enough to hold the media
+        controls. This makes our full-screen video behave the same as the QuickTimeX player.
+
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Active that new
+        kWKLayoutModeDynamicSizeWithMinimumViewSize style, and set the minimum view size to
+        be the width of our media controls, with 20 pixels of padding on either side.
+        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Set the layout
+        mode back to the default style.
+
 2015-06-11  Jon Lee  <[email protected]>
 
         Update media controls JS and CSS to use picture-in-picture

Modified: trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (185472 => 185473)


--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2015-06-11 20:53:49 UTC (rev 185472)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2015-06-11 21:06:23 UTC (rev 185473)
@@ -278,6 +278,8 @@
     [[self window] enterFullScreenMode:self];
 }
 
+static const float minVideoWidth = 480 + 20 + 20; // Note: Keep in sync with mediaControlsApple.css (video:-webkit-full-screen::-webkit-media-controls-panel)
+
 - (void)finishedEnterFullScreenAnimation:(bool)completed
 {
     if (_fullScreenState != EnteringFullScreen)
@@ -298,6 +300,12 @@
 
         [_webViewPlaceholder setExitWarningVisible:YES];
         [_webViewPlaceholder setTarget:self];
+
+        [_webView _setLayoutMode:kWKLayoutModeDynamicSizeWithMinimumViewSize];
+        
+        NSSize minContentSize = self.window.contentMinSize;
+        minContentSize.width = minVideoWidth;
+        self.window.contentMinSize = minContentSize;
     } else {
         // Transition to fullscreen failed. Clean up.
         _fullScreenState = NotInFullScreen;
@@ -384,6 +392,7 @@
     makeResponderFirstResponderIfDescendantOfView(_webView.window, firstResponder, _webView);
 
     [[_webView window] makeKeyAndOrderFront:self];
+    [_webView _setLayoutMode:kWKLayoutModeViewSize];
 
     // These messages must be sent after the swap or flashing will occur during forceRepaint:
     [self _manager]->didExitFullScreen();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to