<rdar://problem/9322486> REGRESSION (r83397): Default controls fade out when playing...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Apr 2011 08:31:42 +0000 (08:31 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Apr 2011 08:31:42 +0000 (08:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=59180

Reviewed by Maciej Stachowiak.

Source/WebCore:

Test: media/audio-controls-do-not-fade-out.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playbackProgressTimerFired): Only start fading out the controls if there is
a video track.

LayoutTests:

* media/audio-controls-do-not-fade-out-expected.txt: Added.
* media/audio-controls-do-not-fade-out.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/media/audio-controls-do-not-fade-out-expected.txt [new file with mode: 0644]
LayoutTests/media/audio-controls-do-not-fade-out.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp

index a3cbc9c..17bbe98 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-22  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        <rdar://problem/9322486> REGRESSION (r83397): Default controls fade out when playing audio-only media
+        https://bugs.webkit.org/show_bug.cgi?id=59180
+
+        * media/audio-controls-do-not-fade-out-expected.txt: Added.
+        * media/audio-controls-do-not-fade-out.html: Added.
+
 2011-04-22  Ojan Vafai  <ojan@chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/media/audio-controls-do-not-fade-out-expected.txt b/LayoutTests/media/audio-controls-do-not-fade-out-expected.txt
new file mode 100644 (file)
index 0000000..07ba5e1
--- /dev/null
@@ -0,0 +1,6 @@
+This tests that audio controls do not fade out when the audio is playing.
+
+PASS
+
+
+
diff --git a/LayoutTests/media/audio-controls-do-not-fade-out.html b/LayoutTests/media/audio-controls-do-not-fade-out.html
new file mode 100644 (file)
index 0000000..c5a6daf
--- /dev/null
@@ -0,0 +1,24 @@
+<body>
+<p>
+    This tests that audio controls do not fade out when the audio is playing.
+</p>
+<p id="result">
+    FAIL: Test did not run.
+</p>
+<audio id="audio" controls autoplay onplaying="playing()" src="content/silence.wav"></audio><br>
+<script>
+    if (window.layoutTestController) {
+        layoutTestController.waitUntilDone();
+        layoutTestController.dumpAsText();
+    }
+
+    function playing() {
+        setTimeout(function() {
+            var controls = layoutTestController.shadowRoot(document.getElementById("audio")).firstChild.firstChild;
+            var opacity = getComputedStyle(controls).opacity;
+            document.getElementById("result").innerText = opacity < 1 ? "FAIL" : "PASS";
+            layoutTestController.notifyDone();
+        }, 250)
+    }
+</script>
+</body>
index fe21fe4..12135e0 100644 (file)
@@ -1,3 +1,16 @@
+2011-04-22  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        <rdar://problem/9322486> REGRESSION (r83397): Default controls fade out when playing audio-only media
+        https://bugs.webkit.org/show_bug.cgi?id=59180
+
+        Test: media/audio-controls-do-not-fade-out.html
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::playbackProgressTimerFired): Only start fading out the controls if there is
+        a video track.
+
 2011-04-22  Luke Macpherson   <macpherson@chromium.org>
 
         Reviewed by Eric Seidel.
index 6db7b4e..42bc397 100644 (file)
@@ -1615,7 +1615,7 @@ void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*)
 
     scheduleTimeupdateEvent(true);
     if (hasMediaControls()) {
-        if (!m_mouseOver && controls())
+        if (!m_mouseOver && controls() && hasVideo())
             mediaControls()->makeTransparent();
         mediaControls()->playbackProgressed();
     }