⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 249167 in webkit


Ignore:
Timestamp:
Aug 27, 2019, 2:01:04 PM (7 years ago)
Author:
Alan Coon
Message:

Revert r249147. rdar://problem/54751753

Location:
branches/safari-608-branch
Files:
2 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-608-branch/LayoutTests/ChangeLog

    r249166 r249167  
     12019-08-27  Alan Coon  <alancoon@apple.com>
     2
     3        Revert r249147. rdar://problem/54751753
     4
    152019-08-27  Ryan Haddad  <ryanhaddad@apple.com>
    26
  • branches/safari-608-branch/Source/WebCore/ChangeLog

    r249149 r249167  
     12019-08-27  Alan Coon  <alancoon@apple.com>
     2
     3        Revert r249147. rdar://problem/54751753
     4
    152019-08-27  Alan Coon  <alancoon@apple.com>
    26
  • branches/safari-608-branch/Source/WebCore/dom/FullscreenManager.cpp

    r249149 r249167  
    121121    }
    122122
    123     m_pendingFullscreenElement = element;
    124 
    125123    m_fullscreenTaskQueue.enqueueTask([this, element = makeRefPtr(element), checkType, hasKeyboardAccess, failedPreflights] () mutable {
    126         // Don't allow fullscreen if it has been cancelled or a different fullscreen element
    127         // has requested fullscreen.
    128         if (m_pendingFullscreenElement != element) {
    129             failedPreflights(WTFMove(element));
    130             return;
    131         }
    132 
    133124        // Don't allow fullscreen if document is hidden.
    134125        if (document().hidden()) {
     
    219210        // 6. Optionally, perform some animation.
    220211        m_areKeysEnabledInFullscreen = hasKeyboardAccess;
    221         m_fullscreenTaskQueue.enqueueTask([this, element = WTFMove(element), failedPreflights = WTFMove(failedPreflights)] () mutable {
    222             auto page = this->page();
    223             if (!page || document().hidden() || m_pendingFullscreenElement != element || !element->isConnected()) {
    224                 failedPreflights(element);
    225                 return;
    226             }
    227             page->chrome().client().enterFullScreenForElement(*element.get());
     212        m_fullscreenTaskQueue.enqueueTask([this, element = WTFMove(element)] {
     213            if (auto page = this->page())
     214                page->chrome().client().enterFullScreenForElement(*element.get());
    228215        });
    229216
     
    239226    // context's document and subsequently empty that document's fullscreen element stack."
    240227    Document& topDocument = document().topDocument();
    241     if (!topDocument.fullscreenManager().fullscreenElement()) {
    242         // If there is a pending fullscreen element but no top document fullscreen element,
    243         // there is a pending task in enterFullscreen(). Cause it to cancel and fire an error
    244         // by clearing the pending fullscreen element.
    245         m_pendingFullscreenElement = nullptr;
    246         return;
    247     }
     228    if (!topDocument.fullscreenManager().fullscreenElement())
     229        return;
    248230
    249231    // To achieve that aim, remove all the elements from the top document's stack except for the first before
     
    264246
    265247    // 2. If doc's fullscreen element stack is empty, terminate these steps.
    266     if (m_fullscreenElementStack.isEmpty()) {
    267         // If there is a pending fullscreen element but an empty fullscreen element stack,
    268         // there is a pending task in requestFullscreenForElement(). Cause it to cancel and fire an error
    269         // by clearing the pending fullscreen element.
    270         m_pendingFullscreenElement = nullptr;
    271         return;
    272     }
     248    if (m_fullscreenElementStack.isEmpty())
     249        return;
    273250
    274251    // 3. Let descendants be all the doc's descendant browsing context's documents with a non-empty fullscreen
     
    322299            return;
    323300
    324         // If there is a pending fullscreen element but no fullscreen element
    325         // there is a pending task in requestFullscreenForElement(). Cause it to cancel and fire an error
    326         // by clearing the pending fullscreen element.
    327         if (!fullscreenElement && m_pendingFullscreenElement) {
    328             m_pendingFullscreenElement = nullptr;
    329             return;
    330         }
    331 
    332301        // Only exit out of full screen window mode if there are no remaining elements in the
    333302        // full screen stack.
     
    371340        return;
    372341
    373     // If pending fullscreen element is unset or another element's was requested,
    374     // issue a cancel fullscreen request to the client
    375     if (m_pendingFullscreenElement != &element) {
    376         page()->chrome().client().exitFullScreenForElement(&element);
    377         return;
    378     }
    379 
    380342    ASSERT(page()->settings().fullScreenEnabled());
    381343
     
    384346    element.willBecomeFullscreenElement();
    385347
    386     ASSERT(&element == m_pendingFullscreenElement);
    387     m_pendingFullscreenElement = nullptr;
    388348    m_fullscreenElement = &element;
    389349
     
    426386void FullscreenManager::willExitFullscreen()
    427387{
    428     auto fullscreenElement = fullscreenOrPendingElement();
    429     if (!fullscreenElement)
     388    if (!m_fullscreenElement)
    430389        return;
    431390
     
    433392        return;
    434393
    435     fullscreenElement->willStopBeingFullscreenElement();
     394    m_fullscreenElement->willStopBeingFullscreenElement();
    436395}
    437396
    438397void FullscreenManager::didExitFullscreen()
    439398{
    440     auto fullscreenElement = fullscreenOrPendingElement();
    441     if (!fullscreenElement)
     399    if (!m_fullscreenElement)
    442400        return;
    443401
    444402    if (!hasLivingRenderTree() || pageCacheState() != Document::NotInPageCache)
    445403        return;
    446     fullscreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
     404
     405    m_fullscreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
    447406
    448407    m_areKeysEnabledInFullscreen = false;
     
    451410
    452411    m_fullscreenElement = nullptr;
    453     m_pendingFullscreenElement = nullptr;
    454412    scheduleFullStyleRebuild();
    455413
     
    526484}
    527485
     486void FullscreenManager::fullscreenElementRemoved()
     487{
     488    m_fullscreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
     489    cancelFullscreen();
     490}
     491
    528492void FullscreenManager::adjustFullscreenElementOnNodeRemoval(Node& node, Document::NodeRemoval nodeRemoval)
    529493{
    530     auto fullscreenElement = fullscreenOrPendingElement();
    531     if (!fullscreenElement)
     494    if (!m_fullscreenElement)
    532495        return;
    533496
    534497    bool elementInSubtree = false;
    535498    if (nodeRemoval == Document::NodeRemoval::ChildrenOfNode)
    536         elementInSubtree = fullscreenElement->isDescendantOf(node);
     499        elementInSubtree = m_fullscreenElement->isDescendantOf(node);
    537500    else
    538         elementInSubtree = (fullscreenElement == &node) || fullscreenElement->isDescendantOf(node);
    539 
    540     if (elementInSubtree) {
    541         fullscreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
    542         cancelFullscreen();
    543     }
     501        elementInSubtree = (m_fullscreenElement == &node) || m_fullscreenElement->isDescendantOf(node);
     502
     503    if (elementInSubtree)
     504        fullscreenElementRemoved();
    544505}
    545506
     
    581542{
    582543    m_fullscreenElement = nullptr;
    583     m_pendingFullscreenElement = nullptr;
    584544    m_fullscreenElementStack.clear();
    585545}
  • branches/safari-608-branch/Source/WebCore/dom/FullscreenManager.h

    r249149 r249167  
    109109    Document& m_document;
    110110
    111     RefPtr<Element> fullscreenOrPendingElement() const { return m_fullscreenElement ? m_fullscreenElement : m_pendingFullscreenElement; }
    112 
    113     RefPtr<Element> m_pendingFullscreenElement;
    114111    RefPtr<Element> m_fullscreenElement;
    115112    Vector<RefPtr<Element>> m_fullscreenElementStack;
  • branches/safari-608-branch/Source/WebKit/ChangeLog

    r249149 r249167  
     12019-08-27  Alan Coon  <alancoon@apple.com>
     2
     3        Revert r249147. rdar://problem/54751753
     4
    152019-08-27  Alan Coon  <alancoon@apple.com>
    26
  • branches/safari-608-branch/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm

    r249149 r249167  
    448448    BOOL _EVOrganizationNameIsValid;
    449449    BOOL _inInteractiveDismiss;
    450     BOOL _exitRequested;
    451450
    452451    RetainPtr<id> _notificationListener;
     
    599598        _repaintCallback = WebKit::VoidCallback::create([protectedSelf = retainPtr(self), self](WebKit::CallbackBase::Error) {
    600599            _repaintCallback = nullptr;
    601 
    602             if (_exitRequested) {
    603                 _exitRequested = NO;
    604                 [self _exitFullscreenImmediately];
    605                 return;
    606             }
    607 
    608600            if (auto* manager = [protectedSelf _manager]) {
    609601                manager->willEnterFullScreen();
     
    648640    [_rootViewController presentViewController:_fullscreenViewController.get() animated:YES completion:^{
    649641        _fullScreenState = WebKit::InFullScreen;
    650 
    651         if (_exitRequested) {
    652             _exitRequested = NO;
    653             [self _exitFullscreenImmediately];
    654             return;
    655         }
    656642
    657643        auto* page = [self._webView _page];
     
    672658- (void)requestExitFullScreen
    673659{
    674     if (_fullScreenState != WebKit::InFullScreen) {
    675         _exitRequested = YES;
    676         return;
    677     }
    678 
    679660    if (auto* manager = self._manager) {
    680661        manager->requestExitFullScreen();
     
    688669- (void)exitFullScreen
    689670{
    690     if (_fullScreenState < WebKit::InFullScreen) {
    691         _exitRequested = YES;
    692         return;
    693     }
     671    if (!self.isFullScreen)
     672        return;
    694673    _fullScreenState = WebKit::WaitingToExitFullScreen;
    695674
  • branches/safari-608-branch/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.h

    r249149 r249167  
    7474    void setLayerHostingContext(std::unique_ptr<LayerHostingContext>&&);
    7575
    76     enum class AnimationType { None, IntoFullscreen, FromFullscreen };
    77     AnimationType animationState() const { return m_animationType; }
    78     void setAnimationState(AnimationType flag) { m_animationType = flag; }
     76    bool isAnimating() const { return m_isAnimating; }
     77    void setIsAnimating(bool flag) { m_isAnimating = flag; }
    7978
    8079    bool targetIsFullscreen() const { return m_targetIsFullscreen; }
     
    10099    uint64_t m_contextId;
    101100    std::unique_ptr<LayerHostingContext> m_layerHostingContext;
    102     AnimationType m_animationType { false };
     101    bool m_isAnimating { false };
    103102    bool m_targetIsFullscreen { false };
    104103    WebCore::HTMLMediaElementEnums::VideoFullscreenMode m_fullscreenMode { WebCore::HTMLMediaElementEnums::VideoFullscreenModeNone };
  • branches/safari-608-branch/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm

    r249149 r249167  
    261261        model->setVideoLayerFrame(videoLayerFrame);
    262262
    263     if (interface->animationState() != VideoFullscreenInterfaceContext::AnimationType::None)
    264         return;
    265     interface->setAnimationState(VideoFullscreenInterfaceContext::AnimationType::IntoFullscreen);
     263    if (interface->isAnimating())
     264        return;
     265    interface->setIsAnimating(true);
    266266
    267267    bool allowsPictureInPicture = videoElement.webkitSupportsPresentationMode(HTMLVideoElement::VideoPresentationMode::PictureInPicture);
     
    297297    interface.setTargetIsFullscreen(false);
    298298
    299     if (interface.animationState() == VideoFullscreenInterfaceContext::AnimationType::FromFullscreen)
    300         return;
    301     interface.setAnimationState(VideoFullscreenInterfaceContext::AnimationType::FromFullscreen);
     299    if (interface.isAnimating())
     300        return;
     301
     302    interface.setIsAnimating(true);
    302303    m_page->send(Messages::VideoFullscreenManagerProxy::ExitFullscreen(contextId, inlineVideoFrame(videoElement)));
    303304}
     
    438439    auto [model, interface] = ensureModelAndInterface(contextId);
    439440
    440     interface->setAnimationState(VideoFullscreenInterfaceContext::AnimationType::None);
     441    interface->setIsAnimating(false);
    441442    interface->setIsFullscreen(false);
    442443
     
    501502    }
    502503
    503     interface->setAnimationState(VideoFullscreenInterfaceContext::AnimationType::None);
     504    interface->setIsAnimating(false);
    504505    interface->setIsFullscreen(false);
    505506    HTMLMediaElementEnums::VideoFullscreenMode mode = interface->fullscreenMode();
Note: See TracChangeset for help on using the changeset viewer.