Changeset 47515 in webkit
- Timestamp:
- Aug 19, 2009 11:10:44 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r47512 r47515 1 2009-08-19 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Eric Seidel. 4 5 Sound button appears in controller with movies that have no audio 6 https://bugs.webkit.org/show_bug.cgi?id=28464 7 8 * media/video-controls-visible-audio-only.html: 9 * media/video-no-audio.html: Added. 10 * platform/mac-leopard/media/video-empty-source-expected.txt: 11 * platform/mac-leopard/media/video-no-audio-expected.txt: Added. 12 * platform/mac/media/video-empty-source-expected.txt: 13 * platform/mac/media/video-no-audio-expected.txt: Added. 14 * platform/win/media/video-empty-source-expected.txt: Added. 15 * platform/win/media/video-no-audio-expected.txt: Added. 16 1 17 2009-08-19 Alexey Proskuryakov <ap@apple.com> 2 18 -
trunk/LayoutTests/media/video-controls-visible-audio-only.html
r47140 r47515 59 59 </script> 60 60 </head> 61 <body onload="start()">61 <body > 62 62 63 63 <p>Test video element control visibility when mouse is not over element.</p> … … 66 66 <p><span id="mouse-parking">mouse parks here, am I blue?</span></p> 67 67 68 <video id="no-video-media" controls loop src="content/test.wav" ></video>68 <video id="no-video-media" controls loop src="content/test.wav" onload="start()"></video> 69 69 <br><br><div id="console"></div> 70 70 </body> -
trunk/LayoutTests/platform/mac-leopard/media/video-empty-source-expected.txt
r47140 r47515 18 18 RenderFlexibleBox (positioned) {DIV} at (0,134) size 300x16 19 19 RenderButton {INPUT} at (0,0) size 16x16 20 RenderButton {INPUT} at (16,0) size 16x16 21 RenderFlexibleBox {DIV} at (32,0) size 236x16 22 RenderSlider {INPUT} at (0,0) size 236x16 20 RenderFlexibleBox {DIV} at (16,0) size 252x16 21 RenderSlider {INPUT} at (0,0) size 252x16 23 22 RenderBlock {DIV} at (2,1) size 13x14 24 23 RenderButton {INPUT} at (268,0) size 16x16 -
trunk/LayoutTests/platform/mac/media/video-empty-source-expected.txt
r47140 r47515 18 18 RenderFlexibleBox (positioned) {DIV} at (0,125) size 300x25 19 19 RenderButton {INPUT} at (6,3) size 18x18 20 RenderButton {INPUT} at (277,5) size 15x1421 20 RenderButton {INPUT} at (32,4) size 16x16 -
trunk/WebCore/ChangeLog
r47514 r47515 1 2009-08-19 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Eric Seidel. 4 5 Sound button appears in controller with movies that have no audio 6 https://bugs.webkit.org/show_bug.cgi?id=28464 7 8 Test: media/video-no-audio.html 9 10 * html/HTMLMediaElement.cpp: 11 * html/HTMLMediaElement.h: 12 (WebCore::HTMLMediaElement::hasAudio): 13 Added hasAudio. 14 15 * platform/graphics/MediaPlayer.h: 16 * platform/graphics/MediaPlayer.cpp: 17 (WebCore::NullMediaPlayerPrivate::hasAudio): 18 (WebCore::MediaPlayer::hasVideo): 19 Make const. 20 (WebCore::MediaPlayer::hasAudio): 21 Added hasAudio. 22 23 * platform/graphics/MediaPlayerPrivate.h: 24 Add hasAudio. 25 26 * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h: 27 * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: 28 (WebCore::MediaPlayerPrivate::hasAudio): 29 Ditto. 30 31 * platform/graphics/mac/MediaPlayerPrivateQTKit.h: 32 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: 33 (WebCore::MediaPlayerPrivate::hasAudio): 34 Ditto. 35 36 * platform/graphics/qt/MediaPlayerPrivatePhonon.h: 37 * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp: 38 (WebCore::MediaPlayerPrivate::hasAudio): 39 Ditto. 40 41 * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h: 42 * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp: 43 (WebCore::MediaPlayerPrivate::hasAudio): 44 Ditto. 45 46 * platform/graphics/win/QTMovieWin.h: 47 * platform/graphics/win/QTMovieWin.cpp: 48 (QTMovieWin::hasAudio): 49 Ditto. 50 51 * rendering/MediaControlElements.cpp: 52 (WebCore::MediaControlMuteButtonElement::disabled): 53 New, return true if media element doesn't have audio. 54 (WebCore::MediaControlMuteButtonElement::rendererIsNeeded): 55 Renderer is not needed if element has no audio. 56 * rendering/MediaControlElements.h: 57 (WebCore::MediaControlInputElement::disabled): 58 59 * rendering/RenderThemeMac.mm: 60 (WebCore::getMediaUIPartStateFlags): 61 Return MediaUIPartDisabledFlag if node is disabled. 62 63 1 64 2009-08-19 Michelangelo De Simone <micdesim@gmail.com> 2 65 -
trunk/WebCore/html/HTMLMediaElement.cpp
r47459 r47515 917 917 } 918 918 919 bool HTMLMediaElement::hasAudio() const 920 { 921 return m_player ? m_player->hasAudio() : false; 922 } 923 919 924 bool HTMLMediaElement::seeking() const 920 925 { -
trunk/WebCore/html/HTMLMediaElement.h
r45894 r47515 66 66 virtual bool isVideo() const { return false; } 67 67 virtual bool hasVideo() const { return false; } 68 virtual bool hasAudio() const; 68 69 69 70 void rewind(float timeDelta); -
trunk/WebCore/platform/graphics/MediaPlayer.cpp
r46590 r47515 70 70 71 71 virtual bool hasVideo() const { return false; } 72 virtual bool hasAudio() const { return false; } 72 73 73 74 virtual void setVisible(bool) { } … … 319 320 } 320 321 321 bool MediaPlayer::hasVideo() 322 bool MediaPlayer::hasVideo() const 322 323 { 323 324 return m_private->hasVideo(); 325 } 326 327 bool MediaPlayer::hasAudio() const 328 { 329 return m_private->hasAudio(); 324 330 } 325 331 -
trunk/WebCore/platform/graphics/MediaPlayer.h
r45891 r47515 1 1 /* 2 * Copyright (C) 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 111 111 bool supportsSave() const; 112 112 IntSize naturalSize(); 113 bool hasVideo(); 113 bool hasVideo() const; 114 bool hasAudio() const; 114 115 115 116 void setFrameView(FrameView* frameView) { m_frameView = frameView; } -
trunk/WebCore/platform/graphics/MediaPlayerPrivate.h
r45875 r47515 53 53 54 54 virtual bool hasVideo() const = 0; 55 virtual bool hasAudio() const = 0; 55 56 56 57 virtual void setVisible(bool) = 0; -
trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
r46588 r47515 326 326 } 327 327 328 bool MediaPlayerPrivate::hasAudio() const 329 { 330 gint currentAudio = -1; 331 if (m_playBin) 332 g_object_get(G_OBJECT(m_playBin), "current-audio", ¤tAudio, 0); 333 return currentAudio > -1; 334 } 335 328 336 void MediaPlayerPrivate::setVolume(float volume) 329 337 { -
trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.h
r46588 r47515 57 57 IntSize naturalSize() const; 58 58 bool hasVideo() const; 59 bool hasAudio() const; 59 60 60 61 void load(const String &url); -
trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
r45986 r47515 80 80 IntSize naturalSize() const; 81 81 bool hasVideo() const; 82 bool hasAudio() const; 82 83 83 84 void load(const String& url); -
trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
r45986 r47515 85 85 SOFT_LINK_POINTER(QTKit, QTMovieDidEndNotification, NSString *) 86 86 SOFT_LINK_POINTER(QTKit, QTMovieHasVideoAttribute, NSString *) 87 SOFT_LINK_POINTER(QTKit, QTMovieHasAudioAttribute, NSString *) 87 88 SOFT_LINK_POINTER(QTKit, QTMovieIsActiveAttribute, NSString *) 88 89 SOFT_LINK_POINTER(QTKit, QTMovieLoadStateAttribute, NSString *) … … 120 121 #define QTMovieDidEndNotification getQTMovieDidEndNotification() 121 122 #define QTMovieHasVideoAttribute getQTMovieHasVideoAttribute() 123 #define QTMovieHasAudioAttribute getQTMovieHasAudioAttribute() 122 124 #define QTMovieIsActiveAttribute getQTMovieIsActiveAttribute() 123 125 #define QTMovieLoadStateAttribute getQTMovieLoadStateAttribute() … … 718 720 return false; 719 721 return [[m_qtMovie.get() attributeForKey:QTMovieHasVideoAttribute] boolValue]; 722 } 723 724 bool MediaPlayerPrivate::hasAudio() const 725 { 726 if (!m_qtMovie) 727 return false; 728 return [[m_qtMovie.get() attributeForKey:QTMovieHasAudioAttribute] boolValue]; 720 729 } 721 730 -
trunk/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
r46170 r47515 159 159 LOG(Media, "MediaPlayerPrivatePhonon::hasVideo() -> %s", hasVideo ? "true" : "false"); 160 160 return hasVideo; 161 } 162 163 bool MediaPlayerPrivate::hasAudio() const 164 { 165 bool hasAudio = m_mediaObject->hasAudio(); 166 LOG(Media, "MediaPlayerPrivatePhonon::hasAudio() -> %s", hasAudio ? "true" : "false"); 167 return hasAudio; 161 168 } 162 169 -
trunk/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h
r41907 r47515 81 81 IntSize naturalSize() const; 82 82 bool hasVideo() const; 83 bool hasAudio() const; 83 84 84 85 void load(const String &url); -
trunk/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp
r45758 r47515 242 242 } 243 243 244 bool MediaPlayerPrivate::hasAudio() const 245 { 246 if (!m_qtMovie) 247 return false; 248 return m_qtMovie->hasAudio(); 249 } 250 244 251 void MediaPlayerPrivate::setVolume(float volume) 245 252 { -
trunk/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h
r45060 r47515 53 53 IntSize naturalSize() const; 54 54 bool hasVideo() const; 55 55 bool hasAudio() const; 56 56 57 void load(const String& url); 57 58 void cancelLoad(); -
trunk/WebCore/platform/graphics/win/QTMovieWin.cpp
r45891 r47515 868 868 } 869 869 870 bool QTMovieWin::hasAudio() const 871 { 872 if (!m_private->m_movie) 873 return false; 874 return (GetMovieIndTrackType(m_private->m_movie, 1, AudioMediaCharacteristic, movieTrackCharacteristic | movieTrackEnabledOnly)); 875 } 876 870 877 pascal OSErr movieDrawingCompleteProc(Movie movie, long data) 871 878 { -
trunk/WebCore/platform/graphics/win/QTMovieWin.h
r44999 r47515 92 92 93 93 bool hasVideo() const; 94 bool hasAudio() const; 94 95 95 96 static unsigned countSupportedTypes(); -
trunk/WebCore/rendering/MediaControlElements.cpp
r47374 r47515 348 348 } 349 349 350 bool MediaControlMuteButtonElement::disabled() const 351 { 352 return !m_mediaElement->hasAudio(); 353 } 354 355 bool MediaControlMuteButtonElement::rendererIsNeeded(RenderStyle* style) 356 { 357 return MediaControlInputElement::rendererIsNeeded(style) && !disabled(); 358 } 359 350 360 // ---------------------------- 351 361 -
trunk/WebCore/rendering/MediaControlElements.h
r47140 r47515 131 131 MediaControlElementType displayType() const { return m_displayType; } 132 132 133 // Some elements are disabled by movie state (eg. mute if no audio). 134 virtual bool disabled() const { return false; } 135 133 136 protected: 134 137 virtual void updateDisplayType() { } … … 147 150 virtual void defaultEventHandler(Event*); 148 151 virtual void updateDisplayType(); 152 virtual bool disabled() const; 153 virtual bool rendererIsNeeded(RenderStyle*); 149 154 }; 150 155 -
trunk/WebCore/rendering/RenderThemeMac.mm
r46815 r47515 1501 1501 unsigned flags = 0; 1502 1502 1503 if (node->active()) 1503 if (node->disabled()) 1504 flags |= MediaUIPartDisabledFlag; 1505 else if (node->active()) 1504 1506 flags |= MediaUIPartPressedFlag; 1505 1507 return flags;
Note: See TracChangeset
for help on using the changeset viewer.