Changeset 147001 in webkit


Ignore:
Timestamp:
Mar 27, 2013, 11:45:29 AM (13 years ago)
Author:
eric.carlson@apple.com
Message:

[Mac] webkitClosedCaptionsVisible doesn't work
https://bugs.webkit.org/show_bug.cgi?id=113417

Reviewed by Jer Noble.

Source/WebCore:

Test: media/track/track-in-band-legacy-api.html

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::HTMLMediaElement): Delete m_disableCaptions, it is no longer used.
(WebCore::HTMLMediaElement::configureTextTrackGroup): Pass this to textTrackSelectionScore.
(WebCore::HTMLMediaElement::setClosedCaptionsVisible): Delete m_disableCaptions, it is no longer used.

  • html/HTMLMediaElement.h: Ditto.
  • page/CaptionUserPreferences.cpp:

(WebCore::CaptionUserPreferences::textTrackSelectionScore): Add an HTMLMediaElement parameter.

  • page/CaptionUserPreferences.h:
  • page/CaptionUserPreferencesMac.h:
  • page/CaptionUserPreferencesMac.mm:

(WebCore::CaptionUserPreferencesMac::textTrackSelectionScore): Return a score if the media element

is showing captions, even if the preference says captions are disabled.

LayoutTests:

  • media/track/track-in-band-legacy-api-expected.txt: Added.
  • media/track/track-in-band-legacy-api.html: Added.
  • platform/chromium/TestExpectations: Skip new test.
  • platform/efl/TestExpectations: Ditto.
  • platform/gtk/TestExpectations: Ditto.
  • platform/mac/TestExpectations: Ditto.
  • platform/qt/TestExpectations: Ditto.
  • platform/win/TestExpectations: Ditto.
Location:
trunk
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147000 r147001  
     12013-03-27  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Mac] webkitClosedCaptionsVisible doesn't work
     4        https://bugs.webkit.org/show_bug.cgi?id=113417
     5
     6        Reviewed by Jer Noble.
     7
     8        * media/track/track-in-band-legacy-api-expected.txt: Added.
     9        * media/track/track-in-band-legacy-api.html: Added.
     10
     11        * platform/chromium/TestExpectations: Skip new test.
     12        * platform/efl/TestExpectations: Ditto.
     13        * platform/gtk/TestExpectations: Ditto.
     14        * platform/mac/TestExpectations: Ditto.
     15        * platform/qt/TestExpectations: Ditto.
     16        * platform/win/TestExpectations: Ditto.
     17
    1182013-03-27  Eric Carlson  <eric.carlson@apple.com>
    219
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r146942 r147001  
    35793579webkit.org/b/103767  [ Win Mac Linux ] media/track/track-in-band-cues-added-once.html [ Skip ]
    35803580webkit.org/b/103767  [ Win Mac Linux ] media/track/track-in-band-style.html [ Skip ]
     3581webkit.org/b/103767  [ Win Mac Linux ] media/track/track-in-band-legacy-api.html [ Skip ]
    35813582
    35823583# Flaky on Win (perhaps due to lighttpd?)
  • trunk/LayoutTests/platform/efl/TestExpectations

    r146980 r147001  
    16231623Bug(EFL) media/track/track-in-band-cues-added-once.html [ Skip ]
    16241624Bug(EFL) media/track/track-in-band-style.html [ Skip ]
     1625Bug(EFL) media/track/track-in-band-legacy-api.html [ Skip ]
    16251626
    16261627# All debug bots timeout (crash) on this one
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r146994 r147001  
    407407webkit.org/b/103771 media/track/track-in-band-cues-added-once.html [ Timeout ]
    408408webkit.org/b/103771 media/track/track-in-band-style.html [ Timeout ]
     409webkit.org/b/103771 media/track/track-in-band-legacy-api.html [ Timeout ]
    409410
    410411#Incorrect rebaseline
  • trunk/LayoutTests/platform/mac/TestExpectations

    r146986 r147001  
    13561356webkit.org/b/103663 [ MountainLion Lion SnowLeopard ] media/track/track-in-band-cues-added-once.html
    13571357webkit.org/b/103663 [ MountainLion Lion SnowLeopard ] media/track/track-in-band-style.html
     1358webkit.org/b/103663 [ MountainLion Lion SnowLeopard ] media/track/track-in-band-legacy-api.html
    13581359
    13591360# These two tests sometimes timeout
  • trunk/LayoutTests/platform/qt/TestExpectations

    r146910 r147001  
    26192619webkit.org/b/103769 media/track/track-in-band-cues-added-once.html [ Skip ]
    26202620webkit.org/b/103769 media/track/track-in-band-style.html [ Skip ]
     2621webkit.org/b/103769 media/track/track-in-band-legacy-api.html [ Skip ]
    26212622
    26222623webkit.org/b/104150 fast/media/implicit-media-all.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/platform/win/TestExpectations

    r146837 r147001  
    25162516webkit.org/b/103770 media/track/track-in-band-cues-added-once.html [ Skip ]
    25172517webkit.org/b/103770 media/track/track-in-band-style.html [ Skip ]
     2518webkit.org/b/103770 media/track/track-in-band-legacy-api.html [ Skip ]
    25182519
    25192520# https://bugs.webkit.org/show_bug.cgi?id=97026
  • trunk/Source/WebCore/ChangeLog

    r147000 r147001  
     12013-03-27  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Mac] webkitClosedCaptionsVisible doesn't work
     4        https://bugs.webkit.org/show_bug.cgi?id=113417
     5
     6        Reviewed by Jer Noble.
     7
     8        Test: media/track/track-in-band-legacy-api.html
     9
     10        * html/HTMLMediaElement.cpp:
     11        (WebCore::HTMLMediaElement::HTMLMediaElement): Delete m_disableCaptions, it is no longer used.
     12        (WebCore::HTMLMediaElement::configureTextTrackGroup): Pass this to textTrackSelectionScore.
     13        (WebCore::HTMLMediaElement::setClosedCaptionsVisible):  Delete m_disableCaptions, it is no longer used.
     14        * html/HTMLMediaElement.h: Ditto.
     15
     16        * page/CaptionUserPreferences.cpp:
     17        (WebCore::CaptionUserPreferences::textTrackSelectionScore): Add an HTMLMediaElement parameter.
     18        * page/CaptionUserPreferences.h:
     19
     20        * page/CaptionUserPreferencesMac.h:
     21        * page/CaptionUserPreferencesMac.mm:
     22        (WebCore::CaptionUserPreferencesMac::textTrackSelectionScore): Return a score if the media element
     23            is showing captions, even if the preference says captions are disabled.
     24
    1252013-03-27  Eric Carlson  <eric.carlson@apple.com>
    226
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r146801 r147001  
    298298    , m_textTracks(0)
    299299    , m_ignoreTrackDisplayUpdate(0)
    300     , m_disableCaptions(false)
    301300#endif
    302301#if ENABLE(WEB_AUDIO)
     
    318317#if ENABLE(VIDEO_TRACK)
    319318    document->registerForCaptionPreferencesChangedCallbacks(this);
    320     if (document->page()) {
    321         CaptionUserPreferences* captionPreferences = document->page()->group().captionPreferences();
    322         if (captionPreferences->userHasCaptionPreferences())
    323             m_disableCaptions = !captionPreferences->shouldShowCaptions();
    324     }
    325319#endif
    326320}
     
    30993093            currentlyEnabledTracks.append(textTrack);
    31003094
    3101         int trackScore = captionPreferences ? captionPreferences->textTrackSelectionScore(textTrack.get()) : 0;
     3095        int trackScore = captionPreferences ? captionPreferences->textTrackSelectionScore(textTrack.get(), this) : 0;
    31023096        if (trackScore) {
    31033097            // * If the text track kind is { [subtitles or captions] [descriptions] } and the user has indicated an interest in having a
     
    42964290    if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) {
    42974291        m_processingPreferenceChange = true;
    4298         m_disableCaptions = !m_closedCaptionsVisible;
    4299 
    43004292        markCaptionAndSubtitleTracksAsUnconfigured();
    4301 
    43024293        updateTextTrackDisplay();
    43034294    }
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r146647 r147001  
    706706    CueList m_currentlyActiveCues;
    707707    int m_ignoreTrackDisplayUpdate;
    708     bool m_disableCaptions;
    709708#endif
    710709
  • trunk/Source/WebCore/page/CaptionUserPreferences.cpp

    r146647 r147001  
    193193}
    194194
    195 int CaptionUserPreferences::textTrackSelectionScore(TextTrack* track) const
     195int CaptionUserPreferences::textTrackSelectionScore(TextTrack* track, HTMLMediaElement*) const
    196196{
    197197    int trackScore = 0;
  • trunk/Source/WebCore/page/CaptionUserPreferences.h

    r146647 r147001  
    3838namespace WebCore {
    3939
     40class HTMLMediaElement;
    4041class PageGroup;
    4142class TextTrackList;
     
    5051    virtual void setShouldShowCaptions(bool);
    5152
    52     virtual int textTrackSelectionScore(TextTrack*) const;
     53    virtual int textTrackSelectionScore(TextTrack*, HTMLMediaElement*) const;
    5354    virtual int textTrackLanguageSelectionScore(TextTrack*) const;
    5455
  • trunk/Source/WebCore/page/CaptionUserPreferencesMac.h

    r146647 r147001  
    6161#endif
    6262
    63     virtual int textTrackSelectionScore(TextTrack*) const OVERRIDE;
     63    virtual int textTrackSelectionScore(TextTrack*, HTMLMediaElement*) const OVERRIDE;
    6464    virtual Vector<RefPtr<TextTrack> > sortedTrackListForMenu(TextTrackList*) OVERRIDE;
    6565    virtual String displayNameForTrack(TextTrack*) const OVERRIDE;
  • trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm

    r147000 r147001  
    3434#import "DOMWrapperWorld.h"
    3535#import "FloatConversion.h"
     36#import "HTMLMediaElement.h"
    3637#import "KURL.h"
    3738#import "Language.h"
     
    537538    String language = languageCF.get();
    538539    if (!label.isEmpty()) {
    539         if (language.isEmpty() || label.contains(language)) {
     540        if (language.isEmpty() || label.contains(language))
    540541            displayName.append(label);
    541         } else {
     542        else {
    542543            RetainPtr<CFDictionaryRef> localeDict(AdoptCF, CFLocaleCreateComponentsFromLocaleIdentifier(kCFAllocatorDefault, localeIdentifier.get()));
    543544            if (localeDict) {
     
    601602}
    602603
    603 int CaptionUserPreferencesMac::textTrackSelectionScore(TextTrack* track) const
    604 {
    605     if (!shouldShowCaptions())
     604int CaptionUserPreferencesMac::textTrackSelectionScore(TextTrack* track, HTMLMediaElement* mediaElement) const
     605{
     606    if (!shouldShowCaptions() && !mediaElement->webkitClosedCaptionsVisible())
    606607        return 0;
    607608    if (track->kind() != TextTrack::captionsKeyword() && track->kind() != TextTrack::subtitlesKeyword())
Note: See TracChangeset for help on using the changeset viewer.