Changeset 201883 in webkit


Ignore:
Timestamp:
Jun 9, 2016 2:30:35 PM (8 years ago)
Author:
eric.carlson@apple.com
Message:

Don't show the caption menu if a video has only forced tracks
https://bugs.webkit.org/show_bug.cgi?id=158573
<rdar://problem/24632384>

Reviewed by Jer Noble.

Source/WebCore:

Test: media/controls/forced-tracks-only.html

  • Modules/mediacontrols/mediaControlsApple.js:

(Controller.prototype.updateCaptionButton): Don't show the button of there are no user-selectable

text or audio tracks.

  • page/CaptionUserPreferencesMediaAF.cpp:

(WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Return an empty Vector if

there are no user-selectable tracks.

LayoutTests:

  • media/controls/forced-tracks-only-expected.txt: Added.
  • media/controls/forced-tracks-only.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r201876 r201883  
     12016-06-09  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Don't show the caption menu if a video has only forced tracks
     4        https://bugs.webkit.org/show_bug.cgi?id=158573
     5        <rdar://problem/24632384>
     6
     7        Reviewed by Jer Noble.
     8
     9        * media/controls/forced-tracks-only-expected.txt: Added.
     10        * media/controls/forced-tracks-only.html: Added.
     11
    1122016-06-09  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r201882 r201883  
     12016-06-09  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Don't show the caption menu if a video has only forced tracks
     4        https://bugs.webkit.org/show_bug.cgi?id=158573
     5        <rdar://problem/24632384>
     6
     7        Reviewed by Jer Noble.
     8
     9        Test: media/controls/forced-tracks-only.html
     10
     11        * Modules/mediacontrols/mediaControlsApple.js:
     12        (Controller.prototype.updateCaptionButton): Don't show the button of there are no user-selectable
     13          text or audio tracks.
     14
     15        * page/CaptionUserPreferencesMediaAF.cpp:
     16        (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Return an empty Vector if
     17          there are no user-selectable tracks.
     18
    1192016-06-09  Jer Noble  <jer.noble@apple.com>
    220
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

    r201691 r201883  
    17421742    updateCaptionButton: function()
    17431743    {
    1744         if (this.video.webkitHasClosedCaptions || this.video.audioTracks.length > 1)
     1744        var audioTracks = this.host.sortedTrackListForMenu(this.video.audioTracks);
     1745        var textTracks = this.host.sortedTrackListForMenu(this.video.textTracks);
     1746
     1747        if ((textTracks && textTracks.length) || (audioTracks && audioTracks.length > 1))
    17451748            this.controls.captionButton.classList.remove(this.ClassNames.hidden);
    17461749        else
  • trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp

    r201333 r201883  
    945945    }
    946946
     947    if (tracksForMenu.isEmpty())
     948        return tracksForMenu;
     949
    947950    std::sort(tracksForMenu.begin(), tracksForMenu.end(), textTrackCompare);
    948951
Note: See TracChangeset for help on using the changeset viewer.