Changeset 175585 in webkit


Ignore:
Timestamp:
Nov 4, 2014 4:22:46 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

[iOS] Fix incorrect interface orientation that can be caused by fullscreen video dismissal.
https://bugs.webkit.org/show_bug.cgi?id=137930.

Patch by Reza Abbasian <rabbasian@apple.com> on 2014-11-04
Reviewed by Jer Noble.

When a fullscreen video gets dismissed programmatically, for instance for removing
a webview from the view hierarchy, it can put the device in an incorrect orientation.
Make sure we retain the window of parentView when we attempt to go to fullscreen and use
the retained window for putting the device in correct orientation after dismissal.

  • platform/ios/WebVideoFullscreenInterfaceAVKit.h:
  • platform/ios/WebVideoFullscreenInterfaceAVKit.mm:

(WebVideoFullscreenInterfaceAVKit::setupFullscreen):
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
(WebVideoFullscreenInterfaceAVKit::invalidate):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r175584 r175585  
     12014-11-04  Reza Abbasian  <rabbasian@apple.com>
     2
     3        [iOS] Fix incorrect interface orientation that can be caused by fullscreen video dismissal.
     4        https://bugs.webkit.org/show_bug.cgi?id=137930.
     5
     6        Reviewed by Jer Noble.
     7
     8        When a fullscreen video gets dismissed programmatically, for instance for removing
     9        a webview from the view hierarchy, it can put the device in an incorrect orientation.
     10        Make sure we retain the window of parentView when we attempt to go to fullscreen and use
     11        the retained window for putting the device in correct orientation after dismissal.
     12
     13        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
     14        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
     15        (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
     16        (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
     17        (WebVideoFullscreenInterfaceAVKit::invalidate):
     18
    1192014-11-04  Andreas Kling  <akling@apple.com>
    220
  • trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h

    r175279 r175585  
    102102    RetainPtr<UIViewController> m_viewController;
    103103    RetainPtr<UIView> m_parentView;
     104    RetainPtr<UIWindow> m_parentWindow;
    104105    HTMLMediaElement::VideoFullscreenMode m_mode;
    105106    bool m_exitRequested;
  • trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm

    r175279 r175585  
    803803        [CATransaction setDisableActions:YES];
    804804        m_parentView = parentView;
     805        m_parentWindow = parentView.window;
    805806
    806807        if (!applicationIsAdSheet()) {
     
    980981            [m_window setHidden:YES];
    981982            [m_window setRootViewController:nil];
    982             [[getUIApplicationClass() sharedApplication] _setStatusBarOrientation:[[m_parentView window] interfaceOrientation]];
     983            if (m_parentWindow)
     984                [[getUIApplicationClass() sharedApplication] _setStatusBarOrientation:[m_parentWindow interfaceOrientation]];
    983985        }
    984986        [m_playerViewController setDelegate:nil];
     
    997999        m_window = nil;
    9981000        m_parentView = nil;
     1001        m_parentWindow = nil;
    9991002       
    10001003        WebThreadRun(^{
     
    10271030    m_window = nil;
    10281031    m_parentView = nil;
     1032    m_parentWindow = nil;
    10291033}
    10301034
Note: See TracChangeset for help on using the changeset viewer.