Changeset 229466 in webkit
- Timestamp:
- Mar 9, 2018 10:21:11 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r229463 r229466 1 2018-03-09 Jer Noble <jer.noble@apple.com> 2 3 webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness 4 https://bugs.webkit.org/show_bug.cgi?id=183383 5 6 Fix a couple tests that depended on non-standard behavior, and skip other tests to be fixed later. 7 8 Reviewed by Eric Carlson. 9 10 * media/fullscreen-video-going-into-pip.html: 11 * media/video-fullscreeen-only-playback.html: 12 * platform/mac/TestExpectations: 13 1 14 2018-03-09 Frederic Wang <fwang@igalia.com> 2 15 -
trunk/LayoutTests/media/fullscreen-video-going-into-pip.html
r202219 r229466 23 23 24 24 consoleWrite("Going into Full Screen"); 25 video.addEventListener('webkit fullscreenchange', onfullscreenchange);25 video.addEventListener('webkitpresentationmodechanged', onfullscreenchange); 26 26 runWithKeyDown(function(){ video.webkitRequestFullscreen(); }); 27 27 } … … 30 30 { 31 31 testExpected("document.webkitCurrentFullScreenElement", video); 32 video.removeEventListener('webkit fullscreenchange', onfullscreenchange);32 video.removeEventListener('webkitpresentationmodechanged', onfullscreenchange); 33 33 34 34 consoleWrite("Going into Picture-in-Picture from Full Screen"); -
trunk/LayoutTests/media/video-fullscreeen-only-playback.html
r210959 r229466 9 9 function fullscreenchange() 10 10 { 11 if (document.webkitIsFullScreen) 12 beginfullscreen(); 13 else 11 if (!document.webkitIsFullScreen) 14 12 endfullscreen(); 15 13 } 16 14 17 function beginfullscreen()15 function playing() 18 16 { 19 17 consoleWrite("<br>** Entered fullscreen"); … … 53 51 video = document.getElementsByTagName('video')[0]; 54 52 waitForEvent("canplaythrough", canplaythrough); 55 waitForEvent('playing' );53 waitForEvent('playing', playing); 56 54 57 video.addEventListener('webkitbeginfullscreen', beginfullscreen, true);58 55 video.addEventListener('webkitendfullscreen', endfullscreen, true); 59 56 video.addEventListener('webkitfullscreenchange', fullscreenchange, true); -
trunk/LayoutTests/platform/mac/TestExpectations
r229411 r229466 1728 1728 1729 1729 webkit.org/b/173946 [ Debug ] media/modern-media-controls/fullscreen-support/fullscreen-support-press.html [ Pass Failure ] 1730 1731 webkit.org/b/183490 media/modern-media-controls/controls-visibility-support/controls-visibility-support-fullscreen-on-video.html [ Failure ] 1732 webkit.org/b/183490 media/modern-media-controls/media-controller/media-controller-fade-controls-when-entering-fullscreen.html [ Failure ] 1733 webkit.org/b/183490 media/modern-media-controls/media-controller/media-controller-fullscreen-change.html [ Failure ] 1734 webkit.org/b/183490 media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html [ Failure ] 1735 webkit.org/b/183490 media/modern-media-controls/start-support/start-support-fullscreen.html [ Failure ] 1736 webkit.org/b/183490 media/video-playsinline.html [ Failure ] 1737 webkit.org/b/183490 media/video-webkit-playsinline.html [ Failure ] 1738 webkit.org/b/183490 media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html [ Failure ] -
trunk/Source/WebCore/ChangeLog
r229460 r229466 1 2018-03-09 Jer Noble <jer.noble@apple.com> 2 3 webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness 4 https://bugs.webkit.org/show_bug.cgi?id=183383 5 6 Reviewed by Eric Carlson. 7 8 Fire the webkitfullscreenchange event at the same time as the pseudo class selector changes, during the handling 9 of webkitDidEnterFullScreenForElement. For WebKit2 clients, this is guaranteed to be asynchronous, since the 10 calling method originates in the UIProcess. For WebKit1 clients (and WKTR and DRT), there's the possibility that 11 webkitWillEnterFullScreenForElement will be called synchronously from within 12 Document::requestFullScreenForElement(), so break that synchronousness by starting the 13 ChromeClient::enterFullScreenForElement(...) process in a async task. 14 15 Previously, the firing of the fullscreenchange event was done through a zero-length timer. Use a 16 GenericTaskQueue instead. 17 18 A number of layout tests depend on the behavior that the element will be in fullscreen when the 'playing' event 19 fires. This was true for DRT (but not WKTR), since its fullscreen implementations were deliberately synchronous, but 20 won't necessarily be true for all ports. Fix this in a subsequent patch. 21 22 * dom/Document.cpp: 23 (WebCore::Document::requestFullScreenForElement): 24 (WebCore::Document::webkitExitFullscreen): 25 (WebCore::Document::webkitWillEnterFullScreenForElement): 26 (WebCore::Document::webkitDidEnterFullScreenForElement): 27 (WebCore::Document::webkitDidExitFullScreenForElement): 28 (WebCore::Document::dispatchFullScreenChangeEvents): 29 * dom/Document.h: 30 * html/HTMLMediaElement.cpp: 31 (WebCore::HTMLMediaElement::setReadyState): 32 (WebCore::HTMLMediaElement::playInternal): 33 (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): 34 (WebCore::HTMLMediaElement::updatePlayState): 35 (WebCore::HTMLMediaElement::setPlaying): 36 1 37 2018-03-09 Zan Dobersek <zdobersek@igalia.com> 2 38 -
trunk/Source/WebCore/dom/Document.cpp
r229448 r229466 496 496 , m_documentClasses(documentClasses) 497 497 , m_eventQueue(*this) 498 #if ENABLE(FULLSCREEN_API)499 , m_fullScreenChangeDelayTimer(*this, &Document::fullScreenChangeDelayTimerFired)500 #endif501 498 , m_loadEventDelayTimer(*this, &Document::loadEventDelayTimerFired) 502 499 #if PLATFORM(IOS) … … 6090 6087 // 6. Optionally, perform some animation. 6091 6088 m_areKeysEnabledInFullScreen = hasKeyboardAccess; 6092 page()->chrome().client().enterFullScreenForElement(*element); 6089 m_fullScreenTaskQueue.enqueueTask([this, element = makeRefPtr(element)] { 6090 if (auto page = this->page()) 6091 page->chrome().client().enterFullScreenForElement(*element); 6092 }); 6093 6093 6094 6094 // 7. Optionally, display a message indicating how the user can exit displaying the context object fullscreen. … … 6097 6097 6098 6098 m_fullScreenErrorEventTargetQueue.append(element ? element : documentElement()); 6099 m_fullScreenChangeDelayTimer.startOneShot(0_s); 6099 m_fullScreenTaskQueue.enqueueTask([this] { 6100 dispatchFullScreenChangeEvents(); 6101 }); 6100 6102 } 6101 6103 … … 6175 6177 // 6. Return, and run the remaining steps asynchronously. 6176 6178 // 7. Optionally, perform some animation. 6177 6178 if (!page()) 6179 return; 6180 6181 // Only exit out of full screen window mode if there are no remaining elements in the 6182 // full screen stack. 6183 if (!newTop) { 6184 page()->chrome().client().exitFullScreenForElement(m_fullScreenElement.get()); 6185 return; 6186 } 6187 6188 // Otherwise, notify the chrome of the new full screen element. 6189 page()->chrome().client().enterFullScreenForElement(*newTop); 6179 m_fullScreenTaskQueue.enqueueTask([this, newTop = makeRefPtr(newTop), fullScreenElement = m_fullScreenElement] { 6180 auto* page = this->page(); 6181 if (!page) 6182 return; 6183 6184 // Only exit out of full screen window mode if there are no remaining elements in the 6185 // full screen stack. 6186 if (!newTop) { 6187 page->chrome().client().exitFullScreenForElement(fullScreenElement.get()); 6188 return; 6189 } 6190 6191 // Otherwise, notify the chrome of the new full screen element. 6192 page->chrome().client().enterFullScreenForElement(*newTop); 6193 }); 6190 6194 } 6191 6195 … … 6252 6256 6253 6257 resolveStyle(ResolveStyleType::Rebuild); 6254 #if PLATFORM(IOS) && ENABLE(FULLSCREEN_API) 6255 m_fullScreenChangeDelayTimer.startOneShot(0_s); 6256 #endif 6258 dispatchFullScreenChangeEvents(); 6257 6259 } 6258 6260 … … 6266 6268 6267 6269 m_fullScreenElement->didBecomeFullscreenElement(); 6268 6269 #if !PLATFORM(IOS) || !ENABLE(FULLSCREEN_API)6270 m_fullScreenChangeDelayTimer.startOneShot(0_s);6271 #endif6272 6270 } 6273 6271 … … 6306 6304 Document& exitingDocument = eventTargetQueuesEmpty ? topDocument() : *this; 6307 6305 6308 exitingDocument. m_fullScreenChangeDelayTimer.startOneShot(0_s);6306 exitingDocument.dispatchFullScreenChangeEvents(); 6309 6307 } 6310 6308 … … 6328 6326 } 6329 6327 6330 void Document:: fullScreenChangeDelayTimerFired()6328 void Document::dispatchFullScreenChangeEvents() 6331 6329 { 6332 6330 // Since we dispatch events in this function, it's possible that the -
trunk/Source/WebCore/dom/Document.h
r229448 r229466 36 36 #include "FontSelectorClient.h" 37 37 #include "FrameDestructionObserver.h" 38 #include "GenericTaskQueue.h" 38 39 #include "MediaProducer.h" 39 40 #include "MutationObserver.h" … … 1137 1138 RenderFullScreen* fullScreenRenderer() const { return m_fullScreenRenderer.get(); } 1138 1139 1139 void fullScreenChangeDelayTimerFired();1140 void dispatchFullScreenChangeEvents(); 1140 1141 bool fullScreenIsAllowedForElement(Element*) const; 1141 1142 void fullScreenElementRemoved(); … … 1684 1685 Vector<RefPtr<Element>> m_fullScreenElementStack; 1685 1686 WeakPtr<RenderFullScreen> m_fullScreenRenderer { nullptr }; 1686 Timer m_fullScreenChangeDelayTimer;1687 GenericTaskQueue<Timer> m_fullScreenTaskQueue; 1687 1688 Deque<RefPtr<Node>> m_fullScreenChangeEventTargetQueue; 1688 1689 Deque<RefPtr<Node>> m_fullScreenErrorEventTargetQueue; -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r229416 r229466 2516 2516 } 2517 2517 2518 bool isPotentiallyPlaying = potentiallyPlaying();2519 2518 if (m_readyState == HAVE_FUTURE_DATA && oldState <= HAVE_CURRENT_DATA && tracksAreReady) { 2520 2519 scheduleEvent(eventNames().canplayEvent); 2521 if (isPotentiallyPlaying)2522 scheduleNotifyAboutPlaying();2523 2520 shouldUpdateDisplayState = true; 2524 2521 } … … 2529 2526 2530 2527 scheduleEvent(eventNames().canplaythroughEvent); 2531 2532 if (isPotentiallyPlaying && oldState <= HAVE_CURRENT_DATA)2533 scheduleNotifyAboutPlaying();2534 2528 2535 2529 auto success = canTransitionFromAutoplayToPlay(); … … 2540 2534 m_playbackStartedTime = currentMediaTime().toDouble(); 2541 2535 scheduleEvent(eventNames().playEvent); 2542 scheduleNotifyAboutPlaying();2543 2536 } else if (success.value() == MediaPlaybackDenialReason::UserGestureRequired) { 2544 2537 ALWAYS_LOG(LOGIDENTIFIER, "Autoplay blocked, user gesture required"); … … 3498 3491 if (m_readyState <= HAVE_CURRENT_DATA) 3499 3492 scheduleEvent(eventNames().waitingEvent); 3500 else if (m_readyState >= HAVE_FUTURE_DATA)3501 scheduleNotifyAboutPlaying();3502 3493 } else if (m_readyState >= HAVE_FUTURE_DATA) 3503 3494 scheduleResolvePendingPlayPromises(); … … 4714 4705 if (!wasSeeking) 4715 4706 addBehaviorRestrictionsOnEndIfNecessary(); 4716 4717 4707 setPlaybackWithoutUserGesture(PlaybackWithoutUserGesture::None); 4718 4708 } 4709 setPlaying(false); 4719 4710 // If the media element has a current media controller, then report the controller state 4720 4711 // for the media element's current media controller. … … 5329 5320 5330 5321 m_playing = playing; 5322 5323 if (m_playing) 5324 scheduleNotifyAboutPlaying(); 5331 5325 5332 5326 #if ENABLE(MEDIA_SESSION)
Note: See TracChangeset
for help on using the changeset viewer.