Title: [114180] trunk/Source
Revision
114180
Author
jer.no...@apple.com
Date
2012-04-13 16:31:00 -0700 (Fri, 13 Apr 2012)

Log Message

Video at apple.com gets standard controls in addition to custom controls after returning from full screen
https://bugs.webkit.org/show_bug.cgi?id=83939

Reviewed by Eric Carlson.

Source/WebCore:

No new tests; DRT and WKTR don't have the infrastructure to test full-screen animation related bugs.

Instead of asking the media element whether it is in full screen or not, rely on when the media root element
was told that it enteredFullscreen() or exitedFullscreen(), which may occur at a different time than the
media element due to animations.

* html/shadow/MediaControlRootElement.cpp:
(WebCore::MediaControlRootElement::reset):
(WebCore::MediaControlRootElement::playbackStarted):
(WebCore::MediaControlRootElement::enteredFullscreen):
(WebCore::MediaControlRootElement::exitedFullscreen):
(WebCore::MediaControlRootElement::defaultEventHandler):
(WebCore::MediaControlRootElement::startHideFullscreenControlsTimer):
(WebCore::MediaControlRootElement::hideFullscreenControlsTimerFired):
* html/shadow/MediaControlRootElement.h:
(MediaControlRootElement): Added m_isFullscreen;

Source/WebKit2:

So that the media controls don't show up momentarily during full screen animations, call setAnimatingFullScreen(true)
before calling will{Enter,Exit}FullScreen(), so that the CSS rule for full screen animation will be in effect
immediately.

Similarly, call setAnimatingFullScreen(false) after calling did{Enter,Exit}FullScreen, so that the full screen media
controls don't momentarily appear at the end of an animation.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController enterFullScreen:]):
(-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
(-[WKFullScreenWindowController exitFullScreen]):
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114179 => 114180)


--- trunk/Source/WebCore/ChangeLog	2012-04-13 23:27:38 UTC (rev 114179)
+++ trunk/Source/WebCore/ChangeLog	2012-04-13 23:31:00 UTC (rev 114180)
@@ -1,5 +1,29 @@
 2012-04-13  Jer Noble  <jer.no...@apple.com>
 
+        Video at apple.com gets standard controls in addition to custom controls after returning from full screen
+        https://bugs.webkit.org/show_bug.cgi?id=83939
+
+        Reviewed by Eric Carlson.
+
+        No new tests; DRT and WKTR don't have the infrastructure to test full-screen animation related bugs.
+
+        Instead of asking the media element whether it is in full screen or not, rely on when the media root element
+        was told that it enteredFullscreen() or exitedFullscreen(), which may occur at a different time than the
+        media element due to animations.
+
+        * html/shadow/MediaControlRootElement.cpp:
+        (WebCore::MediaControlRootElement::reset):
+        (WebCore::MediaControlRootElement::playbackStarted):
+        (WebCore::MediaControlRootElement::enteredFullscreen):
+        (WebCore::MediaControlRootElement::exitedFullscreen):
+        (WebCore::MediaControlRootElement::defaultEventHandler):
+        (WebCore::MediaControlRootElement::startHideFullscreenControlsTimer):
+        (WebCore::MediaControlRootElement::hideFullscreenControlsTimerFired):
+        * html/shadow/MediaControlRootElement.h:
+        (MediaControlRootElement): Added m_isFullscreen;
+
+2012-04-13  Jer Noble  <jer.no...@apple.com>
+
         fullscreen/video-controls-drag.html failing on Mac
         https://bugs.webkit.org/show_bug.cgi?id=81176
 

Modified: trunk/Source/WebCore/html/shadow/MediaControlRootElement.cpp (114179 => 114180)


--- trunk/Source/WebCore/html/shadow/MediaControlRootElement.cpp	2012-04-13 23:27:38 UTC (rev 114179)
+++ trunk/Source/WebCore/html/shadow/MediaControlRootElement.cpp	2012-04-13 23:31:00 UTC (rev 114180)
@@ -76,6 +76,7 @@
 #endif
     , m_hideFullscreenControlsTimer(this, &MediaControlRootElement::hideFullscreenControlsTimerFired)
     , m_isMouseOverControls(false)
+    , m_isFullscreen(false)
 {
 }
 
@@ -343,7 +344,7 @@
     if (m_fullScreenVolumeSlider)
         m_fullScreenVolumeSlider->setVolume(m_mediaController->volume());
 
-    if (document()->webkitIsFullScreen() && document()->webkitCurrentFullScreenElement() == toParentMediaElement(this)) {
+    if (m_isFullscreen) {
         if (m_mediaController->isLiveStream()) {
             m_seekBackButton->hide();
             m_seekForwardButton->hide();
@@ -374,7 +375,7 @@
     m_timeline->setPosition(m_mediaController->currentTime());
     updateTimeDisplay();
 
-    if (m_mediaController->isFullscreen())
+    if (m_isFullscreen)
         startHideFullscreenControlsTimer();
 }
 
@@ -469,6 +470,8 @@
 
 void MediaControlRootElement::enteredFullscreen()
 {
+    m_isFullscreen = true;
+
     if (m_mediaController->isLiveStream()) {
         m_seekBackButton->hide();
         m_seekForwardButton->hide();
@@ -492,6 +495,8 @@
 
 void MediaControlRootElement::exitedFullscreen()
 {
+    m_isFullscreen = false;
+
     // "show" actually means removal of display:none style, so we are just clearing styles
     // when exiting fullscreen.
     // FIXME: Clarify naming of show/hide <http://webkit.org/b/58157>
@@ -554,7 +559,7 @@
             stopHideFullscreenControlsTimer();
         }
     } else if (event->type() == eventNames().mousemoveEvent) {
-        if (m_mediaController->isFullscreen()) {
+        if (m_isFullscreen) {
             // When we get a mouse move in fullscreen mode, show the media controls, and start a timer
             // that will hide the media controls after a 3 seconds without a mouse move.
             makeOpaque();
@@ -566,7 +571,7 @@
 
 void MediaControlRootElement::startHideFullscreenControlsTimer()
 {
-    if (!m_mediaController->isFullscreen())
+    if (!m_isFullscreen)
         return;
     
     m_hideFullscreenControlsTimer.startOneShot(timeWithoutMouseMovementBeforeHidingControls);
@@ -577,7 +582,7 @@
     if (m_mediaController->paused())
         return;
     
-    if (!m_mediaController->isFullscreen())
+    if (!m_isFullscreen)
         return;
     
     if (!shouldHideControls())

Modified: trunk/Source/WebCore/html/shadow/MediaControlRootElement.h (114179 => 114180)


--- trunk/Source/WebCore/html/shadow/MediaControlRootElement.h	2012-04-13 23:27:38 UTC (rev 114179)
+++ trunk/Source/WebCore/html/shadow/MediaControlRootElement.h	2012-04-13 23:31:00 UTC (rev 114180)
@@ -154,6 +154,7 @@
 #endif
     Timer<MediaControlRootElement> m_hideFullscreenControlsTimer;
     bool m_isMouseOverControls;
+    bool m_isFullscreen;
 };
 
 }

Modified: trunk/Source/WebKit2/ChangeLog (114179 => 114180)


--- trunk/Source/WebKit2/ChangeLog	2012-04-13 23:27:38 UTC (rev 114179)
+++ trunk/Source/WebKit2/ChangeLog	2012-04-13 23:31:00 UTC (rev 114180)
@@ -1,3 +1,23 @@
+2012-04-13  Jer Noble  <jer.no...@apple.com>
+
+        Video at apple.com gets standard controls in addition to custom controls after returning from full screen
+        https://bugs.webkit.org/show_bug.cgi?id=83939
+
+        Reviewed by Eric Carlson.
+
+        So that the media controls don't show up momentarily during full screen animations, call setAnimatingFullScreen(true)
+        before calling will{Enter,Exit}FullScreen(), so that the CSS rule for full screen animation will be in effect
+        immediately.
+
+        Similarly, call setAnimatingFullScreen(false) after calling did{Enter,Exit}FullScreen, so that the full screen media
+        controls don't momentarily appear at the end of an animation.
+
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        (-[WKFullScreenWindowController enterFullScreen:]):
+        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
+        (-[WKFullScreenWindowController exitFullScreen]):
+        (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
+
 2012-04-13  Anders Carlsson  <ander...@apple.com>
 
         Make sure that we're using the right compiler for generating derived sources.

Modified: trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (114179 => 114180)


--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2012-04-13 23:27:38 UTC (rev 114179)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2012-04-13 23:31:00 UTC (rev 114180)
@@ -227,8 +227,8 @@
 
     [[self window] makeResponder:webWindowFirstResponder firstResponderIfDescendantOfView:_webView];
 
+    [self _manager]->setAnimatingFullScreen(true);
     [self _manager]->willEnterFullScreen();
-    [self _manager]->setAnimatingFullScreen(true);
 }
 
 - (void)beganEnterFullScreenWithInitialFrame:(const WebCore::IntRect&)initialFrame finalFrame:(const WebCore::IntRect&)finalFrame
@@ -254,8 +254,8 @@
     if (completed) {
         // Screen updates to be re-enabled ta the end of the current block.
         NSDisableScreenUpdates();
+        [self _manager]->didEnterFullScreen();
         [self _manager]->setAnimatingFullScreen(false);
-        [self _manager]->didEnterFullScreen();
 
         NSRect windowBounds = [[self window] frame];
         windowBounds.origin = NSZeroPoint;
@@ -299,8 +299,8 @@
     NSDisableScreenUpdates();
     [[self window] setAutodisplay:NO];
 
+    [self _manager]->setAnimatingFullScreen(true);
     [self _manager]->willExitFullScreen();
-    [self _manager]->setAnimatingFullScreen(true);
 }
 
 - (void)beganExitFullScreenWithInitialFrame:(const WebCore::IntRect&)initialFrame finalFrame:(const WebCore::IntRect&)finalFrame
@@ -349,8 +349,8 @@
     // Screen updates to be re-enabled ta the end of the current function.
     NSDisableScreenUpdates();
 
+    [self _manager]->didExitFullScreen();
     [self _manager]->setAnimatingFullScreen(false);
-    [self _manager]->didExitFullScreen();
 
     NSResponder *firstResponder = [[self window] firstResponder];
     [self _swapView:_webViewPlaceholder.get() with:_webView];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to