Changeset 249167 in webkit
- Timestamp:
- Aug 27, 2019, 2:01:04 PM (7 years ago)
- Location:
- branches/safari-608-branch
- Files:
-
- 2 deleted
- 8 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fullscreen/full-screen-request-removed-with-raf-expected.txt (deleted)
-
LayoutTests/fullscreen/full-screen-request-removed-with-raf.html (deleted)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/FullscreenManager.cpp (modified) (12 diffs)
-
Source/WebCore/dom/FullscreenManager.h (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm (modified) (5 diffs)
-
Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.h (modified) (2 diffs)
-
Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-608-branch/LayoutTests/ChangeLog
r249166 r249167 1 2019-08-27 Alan Coon <alancoon@apple.com> 2 3 Revert r249147. rdar://problem/54751753 4 1 5 2019-08-27 Ryan Haddad <ryanhaddad@apple.com> 2 6 -
branches/safari-608-branch/Source/WebCore/ChangeLog
r249149 r249167 1 2019-08-27 Alan Coon <alancoon@apple.com> 2 3 Revert r249147. rdar://problem/54751753 4 1 5 2019-08-27 Alan Coon <alancoon@apple.com> 2 6 -
branches/safari-608-branch/Source/WebCore/dom/FullscreenManager.cpp
r249149 r249167 121 121 } 122 122 123 m_pendingFullscreenElement = element;124 125 123 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 element127 // has requested fullscreen.128 if (m_pendingFullscreenElement != element) {129 failedPreflights(WTFMove(element));130 return;131 }132 133 124 // Don't allow fullscreen if document is hidden. 134 125 if (document().hidden()) { … … 219 210 // 6. Optionally, perform some animation. 220 211 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()); 228 215 }); 229 216 … … 239 226 // context's document and subsequently empty that document's fullscreen element stack." 240 227 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; 248 230 249 231 // To achieve that aim, remove all the elements from the top document's stack except for the first before … … 264 246 265 247 // 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; 273 250 274 251 // 3. Let descendants be all the doc's descendant browsing context's documents with a non-empty fullscreen … … 322 299 return; 323 300 324 // If there is a pending fullscreen element but no fullscreen element325 // there is a pending task in requestFullscreenForElement(). Cause it to cancel and fire an error326 // by clearing the pending fullscreen element.327 if (!fullscreenElement && m_pendingFullscreenElement) {328 m_pendingFullscreenElement = nullptr;329 return;330 }331 332 301 // Only exit out of full screen window mode if there are no remaining elements in the 333 302 // full screen stack. … … 371 340 return; 372 341 373 // If pending fullscreen element is unset or another element's was requested,374 // issue a cancel fullscreen request to the client375 if (m_pendingFullscreenElement != &element) {376 page()->chrome().client().exitFullScreenForElement(&element);377 return;378 }379 380 342 ASSERT(page()->settings().fullScreenEnabled()); 381 343 … … 384 346 element.willBecomeFullscreenElement(); 385 347 386 ASSERT(&element == m_pendingFullscreenElement);387 m_pendingFullscreenElement = nullptr;388 348 m_fullscreenElement = &element; 389 349 … … 426 386 void FullscreenManager::willExitFullscreen() 427 387 { 428 auto fullscreenElement = fullscreenOrPendingElement(); 429 if (!fullscreenElement) 388 if (!m_fullscreenElement) 430 389 return; 431 390 … … 433 392 return; 434 393 435 fullscreenElement->willStopBeingFullscreenElement();394 m_fullscreenElement->willStopBeingFullscreenElement(); 436 395 } 437 396 438 397 void FullscreenManager::didExitFullscreen() 439 398 { 440 auto fullscreenElement = fullscreenOrPendingElement(); 441 if (!fullscreenElement) 399 if (!m_fullscreenElement) 442 400 return; 443 401 444 402 if (!hasLivingRenderTree() || pageCacheState() != Document::NotInPageCache) 445 403 return; 446 fullscreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false); 404 405 m_fullscreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false); 447 406 448 407 m_areKeysEnabledInFullscreen = false; … … 451 410 452 411 m_fullscreenElement = nullptr; 453 m_pendingFullscreenElement = nullptr;454 412 scheduleFullStyleRebuild(); 455 413 … … 526 484 } 527 485 486 void FullscreenManager::fullscreenElementRemoved() 487 { 488 m_fullscreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false); 489 cancelFullscreen(); 490 } 491 528 492 void FullscreenManager::adjustFullscreenElementOnNodeRemoval(Node& node, Document::NodeRemoval nodeRemoval) 529 493 { 530 auto fullscreenElement = fullscreenOrPendingElement(); 531 if (!fullscreenElement) 494 if (!m_fullscreenElement) 532 495 return; 533 496 534 497 bool elementInSubtree = false; 535 498 if (nodeRemoval == Document::NodeRemoval::ChildrenOfNode) 536 elementInSubtree = fullscreenElement->isDescendantOf(node);499 elementInSubtree = m_fullscreenElement->isDescendantOf(node); 537 500 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(); 544 505 } 545 506 … … 581 542 { 582 543 m_fullscreenElement = nullptr; 583 m_pendingFullscreenElement = nullptr;584 544 m_fullscreenElementStack.clear(); 585 545 } -
branches/safari-608-branch/Source/WebCore/dom/FullscreenManager.h
r249149 r249167 109 109 Document& m_document; 110 110 111 RefPtr<Element> fullscreenOrPendingElement() const { return m_fullscreenElement ? m_fullscreenElement : m_pendingFullscreenElement; }112 113 RefPtr<Element> m_pendingFullscreenElement;114 111 RefPtr<Element> m_fullscreenElement; 115 112 Vector<RefPtr<Element>> m_fullscreenElementStack; -
branches/safari-608-branch/Source/WebKit/ChangeLog
r249149 r249167 1 2019-08-27 Alan Coon <alancoon@apple.com> 2 3 Revert r249147. rdar://problem/54751753 4 1 5 2019-08-27 Alan Coon <alancoon@apple.com> 2 6 -
branches/safari-608-branch/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm
r249149 r249167 448 448 BOOL _EVOrganizationNameIsValid; 449 449 BOOL _inInteractiveDismiss; 450 BOOL _exitRequested;451 450 452 451 RetainPtr<id> _notificationListener; … … 599 598 _repaintCallback = WebKit::VoidCallback::create([protectedSelf = retainPtr(self), self](WebKit::CallbackBase::Error) { 600 599 _repaintCallback = nullptr; 601 602 if (_exitRequested) {603 _exitRequested = NO;604 [self _exitFullscreenImmediately];605 return;606 }607 608 600 if (auto* manager = [protectedSelf _manager]) { 609 601 manager->willEnterFullScreen(); … … 648 640 [_rootViewController presentViewController:_fullscreenViewController.get() animated:YES completion:^{ 649 641 _fullScreenState = WebKit::InFullScreen; 650 651 if (_exitRequested) {652 _exitRequested = NO;653 [self _exitFullscreenImmediately];654 return;655 }656 642 657 643 auto* page = [self._webView _page]; … … 672 658 - (void)requestExitFullScreen 673 659 { 674 if (_fullScreenState != WebKit::InFullScreen) {675 _exitRequested = YES;676 return;677 }678 679 660 if (auto* manager = self._manager) { 680 661 manager->requestExitFullScreen(); … … 688 669 - (void)exitFullScreen 689 670 { 690 if (_fullScreenState < WebKit::InFullScreen) { 691 _exitRequested = YES; 692 return; 693 } 671 if (!self.isFullScreen) 672 return; 694 673 _fullScreenState = WebKit::WaitingToExitFullScreen; 695 674 -
branches/safari-608-branch/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.h
r249149 r249167 74 74 void setLayerHostingContext(std::unique_ptr<LayerHostingContext>&&); 75 75 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; } 79 78 80 79 bool targetIsFullscreen() const { return m_targetIsFullscreen; } … … 100 99 uint64_t m_contextId; 101 100 std::unique_ptr<LayerHostingContext> m_layerHostingContext; 102 AnimationType m_animationType{ false };101 bool m_isAnimating { false }; 103 102 bool m_targetIsFullscreen { false }; 104 103 WebCore::HTMLMediaElementEnums::VideoFullscreenMode m_fullscreenMode { WebCore::HTMLMediaElementEnums::VideoFullscreenModeNone }; -
branches/safari-608-branch/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm
r249149 r249167 261 261 model->setVideoLayerFrame(videoLayerFrame); 262 262 263 if (interface-> animationState() != VideoFullscreenInterfaceContext::AnimationType::None)264 return; 265 interface->set AnimationState(VideoFullscreenInterfaceContext::AnimationType::IntoFullscreen);263 if (interface->isAnimating()) 264 return; 265 interface->setIsAnimating(true); 266 266 267 267 bool allowsPictureInPicture = videoElement.webkitSupportsPresentationMode(HTMLVideoElement::VideoPresentationMode::PictureInPicture); … … 297 297 interface.setTargetIsFullscreen(false); 298 298 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); 302 303 m_page->send(Messages::VideoFullscreenManagerProxy::ExitFullscreen(contextId, inlineVideoFrame(videoElement))); 303 304 } … … 438 439 auto [model, interface] = ensureModelAndInterface(contextId); 439 440 440 interface->set AnimationState(VideoFullscreenInterfaceContext::AnimationType::None);441 interface->setIsAnimating(false); 441 442 interface->setIsFullscreen(false); 442 443 … … 501 502 } 502 503 503 interface->set AnimationState(VideoFullscreenInterfaceContext::AnimationType::None);504 interface->setIsAnimating(false); 504 505 interface->setIsFullscreen(false); 505 506 HTMLMediaElementEnums::VideoFullscreenMode mode = interface->fullscreenMode();
Note:
See TracChangeset
for help on using the changeset viewer.