2009-08-19  Eric Carlson  <eric.carlson@apple.com>

        Reviewed by Eric Seidel.

        Sound button appears in controller with movies that have no audio
        https://bugs.webkit.org/show_bug.cgi?id=28464

        Test: media/video-no-audio.html

        * html/HTMLMediaElement.cpp:
        * html/HTMLMediaElement.h:
        (WebCore::HTMLMediaElement::hasAudio):
            Added hasAudio.

        * platform/graphics/MediaPlayer.h:
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::NullMediaPlayerPrivate::hasAudio):
        (WebCore::MediaPlayer::hasVideo):
            Make const.
        (WebCore::MediaPlayer::hasAudio):
            Added hasAudio.

        * platform/graphics/MediaPlayerPrivate.h:
            Add hasAudio.

        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
        * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivate::hasAudio):
            Ditto.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::MediaPlayerPrivate::hasAudio):
            Ditto.

        * platform/graphics/qt/MediaPlayerPrivatePhonon.h:
        * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
        (WebCore::MediaPlayerPrivate::hasAudio):
            Ditto.

        * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h:
        * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
        (WebCore::MediaPlayerPrivate::hasAudio):
            Ditto.

        * platform/graphics/win/QTMovieWin.h:
        * platform/graphics/win/QTMovieWin.cpp:
        (QTMovieWin::hasAudio):
            Ditto.

        * rendering/MediaControlElements.cpp:
        (WebCore::MediaControlMuteButtonElement::disabled):
            New, return true if media element doesn't have audio.
        (WebCore::MediaControlMuteButtonElement::rendererIsNeeded):
            Renderer is not needed if element has no audio.
        * rendering/MediaControlElements.h:
        (WebCore::MediaControlInputElement::disabled):

        * rendering/RenderThemeMac.mm:
        (WebCore::getMediaUIPartStateFlags):
            Return MediaUIPartDisabledFlag if node is disabled.
            
2009-08-19  Eric Carlson  <eric.carlson@apple.com>

        Reviewed by Eric Seidel.

        Sound button appears in controller with movies that have no audio
        https://bugs.webkit.org/show_bug.cgi?id=28464

        * media/video-controls-visible-audio-only.html:
        * media/video-no-audio.html: Added.
        * platform/mac-leopard/media/video-empty-source-expected.txt:
        * platform/mac-leopard/media/video-no-audio-expected.txt: Added.
        * platform/mac/media/video-empty-source-expected.txt:
        * platform/mac/media/video-no-audio-expected.txt: Added.
        * platform/win/media/video-empty-source-expected.txt: Added.
        * platform/win/media/video-no-audio-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@47515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/media/video-no-audio.html b/LayoutTests/media/video-no-audio.html
new file mode 100644
index 0000000..ed00889
--- /dev/null
+++ b/LayoutTests/media/video-no-audio.html
@@ -0,0 +1,18 @@
+<html>
+    <head>
+        <script>
+            if (window.layoutTestController)
+                layoutTestController.waitUntilDone();
+    
+            function finish()
+            {
+                if (window.layoutTestController)
+                    layoutTestController.notifyDone();
+            }
+        </script>
+    </head>
+    <body>
+        <p>Movie with no audio track. The volume button should not render.</p>
+        <video src="content/scaled-matrix.mov" controls onload="finish()"></video>
+    </body>
+</html>