Unreviewed, rolling out r184667 and r184682.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 May 2015 05:52:18 +0000 (05:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 May 2015 05:52:18 +0000 (05:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145245

Broke media/media-controls-timeline-updates.html on WebKit2
(Requested by ap on #webkit).

Reverted changesets:

"Media Controls stop updating after hovering for a few
seconds."
https://bugs.webkit.org/show_bug.cgi?id=144770
http://trac.webkit.org/changeset/184667

"Unreviewed. Media Controls stop updating after hovering for a
few seconds."
https://bugs.webkit.org/show_bug.cgi?id=144770
http://trac.webkit.org/changeset/184682

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184702 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/mediaControlsApple.js
Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js

index d900f73..3f5d943 100644 (file)
@@ -1,3 +1,23 @@
+2015-05-20  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r184667 and r184682.
+        https://bugs.webkit.org/show_bug.cgi?id=145245
+
+        Broke media/media-controls-timeline-updates.html on WebKit2
+        (Requested by ap on #webkit).
+
+        Reverted changesets:
+
+        "Media Controls stop updating after hovering for a few
+        seconds."
+        https://bugs.webkit.org/show_bug.cgi?id=144770
+        http://trac.webkit.org/changeset/184667
+
+        "Unreviewed. Media Controls stop updating after hovering for a
+        few seconds."
+        https://bugs.webkit.org/show_bug.cgi?id=144770
+        http://trac.webkit.org/changeset/184682
+
 2015-05-20  Jon Lee  <jonlee@apple.com>
 
         [iOS] Update optimized fullscreen controls artwork
index e66e175..188240c 100644 (file)
@@ -268,7 +268,7 @@ Controller.prototype = {
         var base = this.base = document.createElement('div');
         base.setAttribute('pseudo', '-webkit-media-controls');
         this.listenFor(base, 'mousemove', this.handleWrapperMouseMove);
-        this.listenFor(this.video, 'mouseout', this.handleWrapperMouseOut);
+        this.listenFor(base, 'mouseout', this.handleWrapperMouseOut);
         if (this.host.textTrackContainer)
             base.appendChild(this.host.textTrackContainer);
     },
@@ -291,14 +291,9 @@ Controller.prototype = {
         this.timelineMetricsNeedsUpdate = true;
     },
 
-    scheduleUpdateLayoutForDisplayedWidth: function()
-    {
-        setTimeout(this.updateLayoutForDisplayedWidth.bind(this), 0);
-    },
-
     updateTimelineMetricsIfNeeded: function()
     {
-        if (this.timelineMetricsNeedsUpdate && !this.controlsAreHidden()) {
+        if (this.timelineMetricsNeedsUpdate) {
             this.timelineLeft = this.controls.timeline.offsetLeft;
             this.timelineWidth = this.controls.timeline.offsetWidth;
             this.timelineHeight = this.controls.timeline.offsetHeight;
@@ -689,8 +684,8 @@ Controller.prototype = {
     handleDurationChange: function(event)
     {
         this.updateDuration();
-        this.updateTime();
-        this.updateProgress();
+        this.updateTime(true);
+        this.updateProgress(true);
     },
 
     handlePlay: function(event)
@@ -823,9 +818,14 @@ Controller.prototype = {
     handlePanelTransitionEnd: function(event)
     {
         var opacity = window.getComputedStyle(this.controls.panel).opacity;
-        if (!parseInt(opacity) && !this.controlsAlwaysVisible()) {
-            this.base.removeChild(this.controls.inlinePlaybackPlaceholder);
-            this.base.removeChild(this.controls.panel);
+        if (parseInt(opacity) > 0) {
+            this.controls.panel.classList.remove(this.ClassNames.hidden);
+            if (this.controls.panelBackground)
+                this.controls.panelBackground.classList.remove(this.ClassNames.hidden);
+        } else if (!this.controlsAlwaysVisible()) {
+            this.controls.panel.classList.add(this.ClassNames.hidden);
+            if (this.controls.panelBackground)
+                this.controls.panelBackground.classList.add(this.ClassNames.hidden);
         }
     },
 
@@ -1149,8 +1149,11 @@ Controller.prototype = {
         return gradient;
     },
 
-    updateProgress: function()
+    updateProgress: function(forceUpdate)
     {
+        if (!forceUpdate && this.controlsAreHidden())
+            return;
+
         this.updateTimelineMetricsIfNeeded();
         this.drawTimelineBackground();
     },
@@ -1357,35 +1360,27 @@ Controller.prototype = {
         }
     },
 
-    updateForShowingControls: function()
+    showControls: function()
     {
+        this.updateShouldListenForPlaybackTargetAvailabilityEvent();
+        if (this.showInlinePlaybackPlaceholderOnly())
+            return;
+
         this.updateLayoutForDisplayedWidth();
         this.setNeedsTimelineMetricsUpdate();
-        this.updateTime();
-        this.updateProgress();
+        this.updateTime(true);
+        this.updateProgress(true);
         this.drawVolumeBackground();
         this.drawTimelineBackground();
         this.controls.panel.classList.add(this.ClassNames.show);
         this.controls.panel.classList.remove(this.ClassNames.hidden);
+
         if (this.controls.panelBackground) {
             this.controls.panelBackground.classList.add(this.ClassNames.show);
             this.controls.panelBackground.classList.remove(this.ClassNames.hidden);
         }
     },
 
-    showControls: function()
-    {
-        this.updateShouldListenForPlaybackTargetAvailabilityEvent();
-        if (this.showInlinePlaybackPlaceholderOnly())
-            return;
-
-        this.updateForShowingControls();
-        if (this.shouldHaveControls() && this.controlsAreHidden()) {
-            this.base.appendChild(this.controls.inlinePlaybackPlaceholder);
-            this.base.appendChild(this.controls.panel);
-        }
-    },
-
     hideControls: function()
     {
         if (this.controlsAlwaysVisible())
@@ -1461,7 +1456,7 @@ Controller.prototype = {
 
     controlsAreHidden: function()
     {
-        return !this.controlsAlwaysVisible() && !this.controls.panel.classList.contains(this.ClassNames.show) && !this.controls.panel.parentElement;
+        return !this.controlsAlwaysVisible() && !this.controls.panel.classList.contains(this.ClassNames.show);
     },
 
     removeControls: function()
@@ -1478,8 +1473,11 @@ Controller.prototype = {
         this.setNeedsTimelineMetricsUpdate();
     },
 
-    updateTime: function()
+    updateTime: function(forceUpdate)
     {
+        if (!forceUpdate && this.controlsAreHidden())
+            return;
+
         var currentTime = this.video.currentTime;
         var timeRemaining = currentTime - this.video.duration;
         this.controls.currentTime.innerText = this.formatTime(currentTime);
index 110ac06..7b890be 100644 (file)
@@ -190,12 +190,6 @@ ControllerIOS.prototype = {
         // Explicitly do nothing to override base-class behavior.
     },
 
-    controlsAreHidden: function()
-    {
-        // Controls are only ever actually hidden when they are removed from the tree
-        return !this.controls.panelContainer.parentElement;
-    },
-
     addControls: function() {
         this.base.appendChild(this.controls.inlinePlaybackPlaceholder);
         this.base.appendChild(this.controls.panelContainer);
@@ -374,15 +368,6 @@ ControllerIOS.prototype = {
         this.updateShouldListenForPlaybackTargetAvailabilityEvent();
     },
 
-    handlePanelTransitionEnd: function(event)
-    {
-        var opacity = window.getComputedStyle(this.controls.panel).opacity;
-        if (!parseInt(opacity) && !this.controlsAlwaysVisible()) {
-            this.base.removeChild(this.controls.inlinePlaybackPlaceholder);
-            this.base.removeChild(this.controls.panelContainer);
-        }
-    },
-
     presentationMode: function() {
         if ('webkitPresentationMode' in this.video)
             return this.video.webkitPresentationMode;
@@ -538,19 +523,6 @@ ControllerIOS.prototype = {
             this.showControls();
     },
 
-    showControls: function()
-    {
-        this.updateShouldListenForPlaybackTargetAvailabilityEvent();
-        if (this.showInlinePlaybackPlaceholderOnly())
-            return;
-        
-        this.updateForShowingControls();
-        if (this.shouldHaveControls()) {
-            this.base.appendChild(this.controls.inlinePlaybackPlaceholder);
-            this.base.appendChild(this.controls.panelContainer);
-        }
-    },
-
     setShouldListenForPlaybackTargetAvailabilityEvent: function(shouldListen)
     {
         if (shouldListen && (this.shouldHaveStartPlaybackButton() || this.video.error))