Changeset 156656 in webkit


Ignore:
Timestamp:
Sep 30, 2013 9:09:37 AM (11 years ago)
Author:
jer.noble@apple.com
Message:

REGRESSION(r156546): media/video-no-audio.html broken
https://bugs.webkit.org/show_bug.cgi?id=122049

Reviewed by Eric Carlson.

Source/WebCore:

Now that our video elements have audio tracks, use their presence or
absense to show or hide the volume controls.

  • Modules/mediacontrols/mediaControlsApple.js:

(Controller):
(Controller.prototype.addVideoListeners): Listen for audioTrack changes.
(Controller.prototype.removeVideoListeners): Stop listening to same.
(Controller.prototype.handleAudioTrackChange): Call this.updateHasAudio()
(Controller.prototype.handleAudioTrackAdd): Ditto.
(Controller.prototype.handleAudioTrackRemove): Ditto.
(Controller.prototype.updateHasAudio): Hide the volume controls if no

audioTracks are present, and vice versa.

LayoutTests:

  • platform/mac/TestExpectations:
  • platform/mac/media/video-no-audio-expected.txt:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r156652 r156656  
     12013-09-27  Jer Noble  <jer.noble@apple.com>
     2
     3        REGRESSION(r156546): media/video-no-audio.html broken
     4        https://bugs.webkit.org/show_bug.cgi?id=122049
     5
     6        Reviewed by Eric Carlson.
     7
     8        * platform/mac/TestExpectations:
     9        * platform/mac/media/video-no-audio-expected.txt:
     10
    1112013-09-27  Jer Noble  <jer.noble@apple.com>
    212
  • trunk/LayoutTests/platform/mac/TestExpectations

    r156592 r156656  
    13591359webkit.org/b/122021 media/video-display-toggle.html
    13601360webkit.org/b/122021 media/video-empty-source.html
    1361 webkit.org/b/122021 media/video-no-audio.html
    13621361webkit.org/b/122021 media/video-rtl.html
    13631362webkit.org/b/122021 media/video-volume-slider.html
  • trunk/LayoutTests/platform/mac/media/video-no-audio-expected.txt

    r149210 r156656  
    1515layer at (8,305) size 352x25
    1616  RenderFlexibleBox {DIV} at (0,263) size 352x25
    17     RenderButton {INPUT} at (6,3) size 18x18
    18     RenderButton {INPUT} at (32,4) size 16x16
    19     RenderFlexibleBox {DIV} at (49,5) size 273x15
    20       RenderSlider {INPUT} at (45,2) size 183x13
    21         RenderFlexibleBox {DIV} at (0,0) size 183x13
    22           RenderBlock {DIV} at (0,2) size 183x8
    23             RenderBlock {DIV} at (0,0) size 10x8
    24     RenderButton {INPUT} at (329,4) size 16x16
    25     RenderBlock {DIV} at (322,12) size 0x0
     17layer at (14,309) size 16x16
     18  RenderButton {BUTTON} at (6,4) size 16x16 [color=#FFFFFF]
     19layer at (40,310) size 16x16
     20  RenderButton {BUTTON} at (32,5) size 16x16 [color=#FFFFFF]
     21layer at (57,312) size 273x11
     22  RenderFlexibleBox {DIV} at (49,7) size 273x11
    2623layer at (57,312) size 45x11
    27   RenderFlexibleBox {DIV} at (0,2) size 45x11 [color=#FFFFFF]
     24  RenderFlexibleBox {DIV} at (0,0) size 45x11 [color=#FFFFFF]
    2825    RenderBlock (anonymous) at (9,0) size 26x11
    2926      RenderText {#text} at (0,0) size 26x11
    3027        text run at (0,0) width 26: "00:00"
    3128layer at (285,312) size 45x11
    32   RenderFlexibleBox {DIV} at (228,2) size 45x11 [color=#FFFFFF]
     29  RenderFlexibleBox {DIV} at (228,0) size 45x11 [color=#FFFFFF]
    3330    RenderBlock (anonymous) at (7,0) size 31x11
    3431      RenderText {#text} at (0,0) size 31x11
    3532        text run at (0,0) width 31: "-00:09"
     33layer at (104,313) size 179x9
     34  RenderFlexibleBox {DIV} at (47,1) size 179x9
     35    RenderSlider {INPUT} at (0,0) size 179x9 [color=#909090] [bgcolor=#000000]
     36      RenderFlexibleBox {DIV} at (0,0) size 179x9
     37        RenderBlock {DIV} at (0,1) size 179x6
     38layer at (104,314) size 6x6
     39  RenderBlock {DIV} at (0,0) size 6x6 [bgcolor=#FFFFFF]
     40layer at (337,310) size 16x16
     41  RenderButton {BUTTON} at (329,5) size 16x16 [color=#FFFFFF]
  • trunk/Source/WebCore/ChangeLog

    r156653 r156656  
     12013-09-27  Jer Noble  <jer.noble@apple.com>
     2
     3        REGRESSION(r156546): media/video-no-audio.html broken
     4        https://bugs.webkit.org/show_bug.cgi?id=122049
     5
     6        Reviewed by Eric Carlson.
     7
     8        Now that our video elements have audio tracks, use their presence or
     9        absense to show or hide the volume controls.
     10
     11        * Modules/mediacontrols/mediaControlsApple.js:
     12        (Controller):
     13        (Controller.prototype.addVideoListeners): Listen for audioTrack changes.
     14        (Controller.prototype.removeVideoListeners): Stop listening to same.
     15        (Controller.prototype.handleAudioTrackChange): Call this.updateHasAudio()
     16        (Controller.prototype.handleAudioTrackAdd): Ditto.
     17        (Controller.prototype.handleAudioTrackRemove): Ditto.
     18        (Controller.prototype.updateHasAudio): Hide the volume controls if no
     19            audioTracks are present, and vice versa.
     20
    1212013-09-30  Jer Noble  <jer.noble@apple.com>
    222
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

    r156546 r156656  
    2626    this.updateCaptionContainer();
    2727    this.updateVolume();
     28    this.updateHasAudio();
    2829};
    2930
     
    113114        this.listenFor(this.video.textTracks, 'removetrack', this.handleTextTrackRemove);
    114115
     116        /* audio tracks */
     117        this.listenFor(this.video.audioTracks, 'change', this.updateHasAudio);
     118        this.listenFor(this.video.audioTracks, 'addtrack', this.updateHasAudio);
     119        this.listenFor(this.video.audioTracks, 'removetrack', this.updateHasAudio);
     120
    115121        /* controls attribute */
    116122        this.controlsObserver = new MutationObserver(this.handleControlsChange.bind(this));
     
    128134        this.stopListeningFor(this.video.textTracks, 'addtrack', this.handleTextTrackAdd);
    129135        this.stopListeningFor(this.video.textTracks, 'removetrack', this.handleTextTrackRemove);
     136
     137        /* audio tracks */
     138        this.stopListeningFor(this.video.audioTracks, 'change', this.updateHasAudio);
     139        this.stopListeningFor(this.video.audioTracks, 'addtrack', this.updateHasAudio);
     140        this.stopListeningFor(this.video.audioTracks, 'removetrack', this.updateHasAudio);
    130141
    131142        /* controls attribute */
     
    915926    },
    916927
     928    updateHasAudio: function()
     929    {
     930        if (this.video.audioTracks.length)
     931            this.controls.muteBox.classList.remove(this.ClassNames.hidden);
     932        else
     933            this.controls.muteBox.classList.add(this.ClassNames.hidden);
     934    },
     935
    917936    updateVolume: function()
    918937    {
Note: See TracChangeset for help on using the changeset viewer.