Changeset 244545 in webkit
- Timestamp:
- Apr 23, 2019 9:25:30 AM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r244540 r244545 1 2019-04-23 Remy Demarest <rdemarest@apple.com> 2 3 Fix layout issues occuring when entering full screen mode. 4 https://bugs.webkit.org/show_bug.cgi?id=197086 5 <rdar://problem/47733671>. 6 7 Reviewed by Darin Adler. 8 9 This issue is the result of changing the style mask of the window after entering 10 full screen mode. Safari adds an invisible toolbar to display the URL of the page 11 which ends up breaking the layout. Having that window use a style that includes a 12 titlebar fixes the bug. 13 14 * platform/mac/WebCoreFullScreenWindow.mm: 15 (-[WebCoreFullScreenWindow constrainFrameRect:toScreen:]): Ensure that the window 16 can fill the entire screen including the underlapping the menu bar, so that the 17 window does not resize when the animation is done. 18 (-[WebCoreFullScreenWindow canBecomeMainWindow]): Borderless windows cannot become 19 main by default, adding the titlebar allows it to become main, prevent this from 20 happening at all to preserve the existing behavior. 21 1 22 2019-04-23 Chris Dumez <cdumez@apple.com> 2 23 -
trunk/Source/WebCore/platform/mac/WebCoreFullScreenWindow.mm
r237266 r244545 54 54 } 55 55 56 - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen 57 { 58 UNUSED_PARAM(screen); 59 return frameRect; 60 } 61 62 - (BOOL)canBecomeMainWindow 63 { 64 return NO; 65 } 66 56 67 - (BOOL)canBecomeKeyWindow 57 68 { -
trunk/Source/WebKit/ChangeLog
r244544 r244545 1 2019-04-23 Remy Demarest <rdemarest@apple.com> 2 3 Fix layout issues occuring when entering full screen mode. 4 https://bugs.webkit.org/show_bug.cgi?id=197086 5 <rdar://problem/47733671>. 6 7 Reviewed by Darin Adler. 8 9 This issue is the result of changing the style mask of the window after entering 10 full screen mode. Safari adds an invisible toolbar to display the URL of the page 11 which ends up breaking the layout. Having that window use a style that includes a 12 titlebar fixes the bug. 13 14 * Platform/spi/mac/AppKitSPI.h: 15 Declare an SPI to be used in WKFullScreenWindowController. 16 17 * UIProcess/Cocoa/WebViewImpl.mm: 18 (WebKit::WebViewImpl::fullScreenWindow): Make the full screen window show a titlebar 19 and make the content view underlap the titlebar to match the current behavior. 20 Remove NSWindowStyleMaskBorderless which has no effects since it is equal to zero. 21 22 * UIProcess/mac/WKFullScreenWindowController.mm: 23 (-[WKFullScreenWindowController initWithWindow:webView:page:]): Hide the titlebar 24 before beginning the animation to full screen. 25 (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Show the title 26 bar when in full screen instead of a blank bar. 27 (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Hide the title 28 bar to restore the initial setting. 29 1 30 2019-04-23 John Wilander <wilander@apple.com> 2 31 -
trunk/Source/WebKit/Platform/spi/mac/AppKitSPI.h
r236724 r244545 48 48 @end 49 49 50 @interface NSWindow (FullScreenSupport) 51 @property CGFloat titlebarAlphaValue; 52 @end 53 50 54 #endif 51 55 -
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
r244089 r244545 2611 2611 { 2612 2612 #if ENABLE(FULLSCREEN_API) 2613 return [[[WebCoreFullScreenWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame] styleMask:(NSWindowStyleMask Borderless| NSWindowStyleMaskResizable) backing:NSBackingStoreBuffered defer:NO] autorelease];2613 return [[[WebCoreFullScreenWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame] styleMask:(NSWindowStyleMaskTitled | NSWindowStyleMaskUnifiedTitleAndToolbar | NSWindowStyleMaskFullSizeContentView | NSWindowStyleMaskResizable) backing:NSBackingStoreBuffered defer:NO] autorelease]; 2614 2614 #else 2615 2615 return nil; -
trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm
r239689 r244545 30 30 #import "WKFullScreenWindowController.h" 31 31 32 #import "AppKitSPI.h" 32 33 #import "LayerTreeContext.h" 33 34 #import "VideoFullscreenManagerProxy.h" … … 127 128 [window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary)]; 128 129 130 // Hide the titlebar during the animation to full screen so that only the WKWebView content is visible. 131 window.titlebarAlphaValue = 0; 132 129 133 NSView *contentView = [window contentView]; 130 134 contentView.hidden = YES; … … 342 346 minContentSize.width = minVideoWidth; 343 347 self.window.contentMinSize = minContentSize; 348 349 // Always show the titlebar in full screen mode. 350 self.window.titlebarAlphaValue = 1; 344 351 } else { 345 352 // Transition to fullscreen failed. Clean up. … … 475 482 return; 476 483 _fullScreenState = NotInFullScreen; 484 485 // Hide the titlebar at the end of the animation so that it can slide away without turning blank. 486 self.window.titlebarAlphaValue = 0; 477 487 478 488 NSResponder *firstResponder = [[self window] firstResponder];
Note: See TracChangeset
for help on using the changeset viewer.