Changeset 86107 in webkit


Ignore:
Timestamp:
May 9, 2011 4:50:28 PM (13 years ago)
Author:
jer.noble@apple.com
Message:

2011-05-09 Jeremy Noble <jer.noble@apple.com>

Reviewed by Darin Adler.

Command-~/Exposé to another window while <video> is in full screen, breaks Safari, eventually leading to crash
https://bugs.webkit.org/show_bug.cgi?id=60496

When animating into and out of full screen, order out and back in the original webView window,
disabling animations when necessary. The exitFullscreen method was targeting the wrong window,
as the webView is hosted in the full screen window when we ask for it's parent window.

  • WebView/WebFullScreenController.mm: (-[WebFullScreenController windowDidEnterFullscreen:]): (-[WebFullScreenController exitFullscreen]):

2011-05-09 Jeremy Noble <jer.noble@apple.com>

Reviewed by Darin Adler.

Command-~/Exposé to another window while <video> is in full screen, breaks Safari, eventually leading to crash
https://bugs.webkit.org/show_bug.cgi?id=60496

When animating into and out of full screen, order out and back in the original webView window,
disabling animations when necessary. The beganExitFullScreenAnimation method was targeting the wrong window,
as the webView is hosted in the full screen window when we ask for it's parent window.

  • UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): (-[WKFullScreenWindowController beganExitFullScreenAnimation]):
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r85925 r86107  
     12011-05-09  Jeremy Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Command-~/Exposé to another window while <video> is in full screen, breaks Safari, eventually leading to crash
     6        https://bugs.webkit.org/show_bug.cgi?id=60496
     7
     8        When animating into and out of full screen, order out and back in the original webView window,
     9        disabling animations when necessary.  The exitFullscreen method was targeting the wrong window,
     10        as the webView is hosted in the full screen window when we ask for it's parent window.
     11
     12        * WebView/WebFullScreenController.mm:
     13        (-[WebFullScreenController windowDidEnterFullscreen:]):
     14        (-[WebFullScreenController exitFullscreen]):
     15
    1162011-05-04  Philippe Normand  <pnormand@igalia.com>
    217
  • trunk/Source/WebKit/mac/WebView/WebFullScreenController.mm

    r85248 r86107  
    272272            _placeholderView = [[NSView alloc] init];
    273273
     274        WebView *webView = [self webView];
     275        NSWindow *webWindow = [webView window];
     276
    274277        // Do not swap the placeholder into place if already is in a window,
    275278        // assuming the placeholder's window will always be the webView's
    276279        // original window.
    277280        if (![_placeholderView window]) {
    278             WebView* webView = [self webView];
    279281            [_placeholderView setFrame:[webView frame]];       
    280282            [_placeholderView setAutoresizingMask:[webView autoresizingMask]];
     
    286288            [webView setFrame:[(NSView *)[[self window] contentView] bounds]];
    287289        }
     290
     291#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     292        // In Lion, NSWindow will animate into and out of orderOut operations. Suppress that
     293        // behavior here, making sure to reset the animation behavior afterward.
     294        NSWindowAnimationBehavior animationBehavior = [webWindow animationBehavior];
     295        [webWindow setAnimationBehavior:NSWindowAnimationBehaviorNone];
     296#endif
     297        [webWindow orderOut:self];
     298#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     299        [webWindow setAnimationBehavior:animationBehavior];
     300#endif
    288301       
    289302        WebFullscreenWindow* window = [self _fullscreenWindow];
     
    503516    NSDisableScreenUpdates();
    504517   
    505     // The user may have moved the fullscreen window in Spaces, so temporarily change
    506     // the collectionBehavior of the webView's window:
    507     NSWindow* webWindow = [[self webView] window];
    508     NSWindowCollectionBehavior behavior = [webWindow collectionBehavior];
    509     [webWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
    510     [webWindow orderWindow:NSWindowBelow relativeTo:[[self window] windowNumber]];
    511     [webWindow setCollectionBehavior:behavior];
    512518   
    513519    // The fullscreen animation may have been cancelled before the
     
    523529        [[_placeholderView superview] replaceSubview:_placeholderView with:webView];
    524530       
     531        NSWindow *webWindow = [[self webView] window];
     532#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     533        // In Lion, NSWindow will animate into and out of orderOut operations. Suppress that
     534        // behavior here, making sure to reset the animation behavior afterward.
     535        NSWindowAnimationBehavior animationBehavior = [webWindow animationBehavior];
     536        [webWindow setAnimationBehavior:NSWindowAnimationBehaviorNone];
     537#endif
     538        // The user may have moved the fullscreen window in Spaces, so temporarily change
     539        // the collectionBehavior of the fullscreen window:
     540        NSWindowCollectionBehavior behavior = [webWindow collectionBehavior];
     541        [webWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
     542        [webWindow orderWindow:NSWindowBelow relativeTo:[[self window] windowNumber]];
     543        [webWindow setCollectionBehavior:behavior];
     544#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     545        [webWindow setAnimationBehavior:animationBehavior];
     546#endif
     547
    525548        // Because the animation view is layer-hosted, make sure to
    526549        // disable animations when changing the layer's opacity. Other-
  • trunk/Source/WebKit2/ChangeLog

    r86103 r86107  
     12011-05-09  Jeremy Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Command-~/Exposé to another window while <video> is in full screen, breaks Safari, eventually leading to crash
     6        https://bugs.webkit.org/show_bug.cgi?id=60496
     7
     8        When animating into and out of full screen, order out and back in the original webView window,
     9        disabling animations when necessary. The beganExitFullScreenAnimation method was targeting the wrong window,
     10        as the webView is hosted in the full screen window when we ask for it's parent window.
     11
     12        * UIProcess/mac/WKFullScreenWindowController.mm:
     13        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
     14        (-[WKFullScreenWindowController beganExitFullScreenAnimation]):
     15
    1162011-05-09  Dan Bernstein  <mitz@apple.com>
    217
  • trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm

    r85036 r86107  
    252252        [CATransaction commit];
    253253       
    254         // FIXME: In Barolo, orderIn will animate, which is not what we want.  Find a way
    255         // to work around this behavior.
    256         //[[_webViewPlaceholder.get() window] orderOut:self];
     254        NSWindow *webWindow = [_webViewPlaceholder.get() window];
     255#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     256        // In Lion, NSWindow will animate into and out of orderOut operations. Suppress that
     257        // behavior here, making sure to reset the animation behavior afterward.
     258        NSWindowAnimationBehavior animationBehavior = [webWindow animationBehavior];
     259        [webWindow setAnimationBehavior:NSWindowAnimationBehaviorNone];
     260#endif
     261        [webWindow orderOut:self];
     262#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     263        [webWindow setAnimationBehavior:animationBehavior];
     264#endif
    257265        [[self window] makeKeyAndOrderFront:self];
    258266    }
     
    283291    [self _updatePowerAssertions];
    284292   
    285     // The user may have moved the fullScreen window in Spaces, so temporarily change
    286     // the collectionBehavior of the webView's window:
    287     NSWindow* webWindow = [[self webView] window];
    288     NSWindowCollectionBehavior behavior = [webWindow collectionBehavior];
    289     [webWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
    290     [webWindow orderWindow:NSWindowBelow relativeTo:[[self window] windowNumber]];
    291     [webWindow setCollectionBehavior:behavior];
    292    
    293293    // Swap the webView back into its original position:
    294     if ([_webView window] == [self window])
     294    if ([_webView window] == [self window]) {
    295295        [self _swapView:_webViewPlaceholder.get() with:_webView];
     296        NSWindow* webWindow = [_webView window];
     297#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     298        // In Lion, NSWindow will animate into and out of orderOut operations. Suppress that
     299        // behavior here, making sure to reset the animation behavior afterward.
     300        NSWindowAnimationBehavior animationBehavior = [webWindow animationBehavior];
     301        [webWindow setAnimationBehavior:NSWindowAnimationBehaviorNone];
     302#endif
     303        // The user may have moved the fullScreen window in Spaces, so temporarily change
     304        // the collectionBehavior of the webView's window:
     305        NSWindowCollectionBehavior behavior = [webWindow collectionBehavior];
     306        [webWindow setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
     307        [webWindow orderWindow:NSWindowBelow relativeTo:[[self window] windowNumber]];
     308        [webWindow setCollectionBehavior:behavior];
     309#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     310        [webWindow setAnimationBehavior:animationBehavior];
     311#endif
     312    }
    296313   
    297314    [CATransaction begin];
Note: See TracChangeset for help on using the changeset viewer.