Changeset 152422 in webkit


Ignore:
Timestamp:
Jul 5, 2013 1:35:11 PM (11 years ago)
Author:
eric.carlson@apple.com
Message:

[Mac] .webkitClosedCaptionsVisible doesn't work with "Automatic" caption mode
https://bugs.webkit.org/show_bug.cgi?id=118319

Reviewed by Jer Noble.

Source/WebCore:

Track when captions are enabled with the old 'webkitClosedCaptionsVisible' attribute and
consider that when determining which track should be enabled.

Test: media/track/track-legacyapi-with-automatic-mode.html

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_webkitLegacyClosedCaptionOverride.
(WebCore::HTMLMediaElement::setWebkitClosedCaptionsVisible): Set m_webkitLegacyClosedCaptionOverride.
(WebCore::HTMLMediaElement::webkitClosedCaptionsVisible): Return m_webkitLegacyClosedCaptionOverride.

  • html/HTMLMediaElement.h:
  • page/CaptionUserPreferencesMediaAF.cpp:

(WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Don't apply "automatic"

logic when captions were enabled with .webkitClosedCaptionsVisible.

LayoutTests:

  • media/track/track-legacyapi-with-automatic-mode-expected.txt: Added.
  • media/track/track-legacyapi-with-automatic-mode.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r152419 r152422  
     12013-07-05  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Mac] .webkitClosedCaptionsVisible doesn't work with "Automatic" caption mode
     4        https://bugs.webkit.org/show_bug.cgi?id=118319
     5
     6        Reviewed by Jer Noble.
     7
     8        * media/track/track-legacyapi-with-automatic-mode-expected.txt: Added.
     9        * media/track/track-legacyapi-with-automatic-mode.html: Added.
     10
    1112013-07-05  Mario Sanchez Prada  <mario.prada@samsung.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r152416 r152422  
     12013-07-05  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Mac] .webkitClosedCaptionsVisible doesn't work with "Automatic" caption mode
     4        https://bugs.webkit.org/show_bug.cgi?id=118319
     5
     6        Reviewed by Jer Noble.
     7
     8        Track when captions are enabled with the old 'webkitClosedCaptionsVisible' attribute and
     9        consider that when determining which track should be enabled.
     10
     11        Test: media/track/track-legacyapi-with-automatic-mode.html
     12
     13        * html/HTMLMediaElement.cpp:
     14        (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_webkitLegacyClosedCaptionOverride.
     15        (WebCore::HTMLMediaElement::setWebkitClosedCaptionsVisible): Set m_webkitLegacyClosedCaptionOverride.
     16        (WebCore::HTMLMediaElement::webkitClosedCaptionsVisible): Return m_webkitLegacyClosedCaptionOverride.
     17        * html/HTMLMediaElement.h:
     18
     19        * page/CaptionUserPreferencesMediaAF.cpp:
     20        (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Don't apply "automatic"
     21            logic when captions were enabled with .webkitClosedCaptionsVisible.
     22
    1232013-07-05  Benjamin Dupont   <bdupont@nds.com>
    224
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r151947 r152422  
    299299    , m_isFullscreen(false)
    300300    , m_closedCaptionsVisible(false)
     301    , m_webkitLegacyClosedCaptionOverride(false)
    301302#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    302303    , m_needWidgetUpdate(false)
     
    45274528void HTMLMediaElement::setWebkitClosedCaptionsVisible(bool visible)
    45284529{
     4530    m_webkitLegacyClosedCaptionOverride = visible;
    45294531    setClosedCaptionsVisible(visible);
    45304532}
     
    45324534bool HTMLMediaElement::webkitClosedCaptionsVisible() const
    45334535{
    4534     return m_closedCaptionsVisible;
     4536    return m_webkitLegacyClosedCaptionOverride && m_closedCaptionsVisible;
    45354537}
    45364538
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r152150 r152422  
    711711    bool m_isFullscreen : 1;
    712712    bool m_closedCaptionsVisible : 1;
     713    bool m_webkitLegacyClosedCaptionOverride : 1;
    713714
    714715#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
  • trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp

    r152333 r152422  
    681681    Vector<String> userPreferredCaptionLanguages = preferredLanguages();
    682682
    683     if (displayMode == Automatic || trackHasOnlyForcedSubtitles) {
     683    if ((displayMode == Automatic && !legacyOverride) || trackHasOnlyForcedSubtitles) {
    684684
    685685        if (!mediaElement || !mediaElement->player())
Note: See TracChangeset for help on using the changeset viewer.