Diff
Modified: trunk/LayoutTests/ChangeLog (147000 => 147001)
--- trunk/LayoutTests/ChangeLog 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/LayoutTests/ChangeLog 2013-03-27 18:45:29 UTC (rev 147001)
@@ -1,5 +1,22 @@
2013-03-27 Eric Carlson <eric.carl...@apple.com>
+ [Mac] webkitClosedCaptionsVisible doesn't work
+ https://bugs.webkit.org/show_bug.cgi?id=113417
+
+ Reviewed by Jer Noble.
+
+ * 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.
+
+2013-03-27 Eric Carlson <eric.carl...@apple.com>
+
[Mac] Text track menu items sometimes labeled incorrectly
https://bugs.webkit.org/show_bug.cgi?id=113406
Added: trunk/LayoutTests/media/track/track-in-band-legacy-api-expected.txt (0 => 147001)
--- trunk/LayoutTests/media/track/track-in-band-legacy-api-expected.txt (rev 0)
+++ trunk/LayoutTests/media/track/track-in-band-legacy-api-expected.txt 2013-03-27 18:45:29 UTC (rev 147001)
@@ -0,0 +1,27 @@
+Test that in-band tracks work with .webkitClosedCaptionsVisible.
+
+EVENT(canplaythrough)
+
+** Check initial in-band track states
+EXPECTED (video.textTracks.length == '1') OK
+RUN(inbandTrack1 = video.textTracks[0])
+EXPECTED (inbandTrack1.mode == 'disabled') OK
+EXPECTED (inbandTrack1.cues == 'null') OK
+EXPECTED (inbandTrack1.language == 'en') OK
+EXPECTED (inbandTrack1.kind == 'captions') OK
+
+** Enable cues and let them load
+RUN(video.webkitClosedCaptionsVisible = true)
+RUN(video.play())
+EVENT(seeked)
+
+** Test to make sure captions are displaying
+EXPECTED (inbandTrack1.cues != 'null') OK
+EXPECTED (textTrackDisplayElement(video, 'cue').textContent != 'null') OK
+
+** Disable captions, cues should be flushed
+RUN(video.webkitClosedCaptionsVisible = false)
+EXPECTED (inbandTrack1.cues == 'null') OK
+
+END OF TEST
+
Added: trunk/LayoutTests/media/track/track-in-band-legacy-api.html (0 => 147001)
--- trunk/LayoutTests/media/track/track-in-band-legacy-api.html (rev 0)
+++ trunk/LayoutTests/media/track/track-in-band-legacy-api.html 2013-03-27 18:45:29 UTC (rev 147001)
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>In-band tracks enabled/disabled with legacy API</title>
+
+ <script src=""
+ <script src=""
+ <script src=""
+ <script>
+
+ function seeked()
+ {
+ consoleWrite("<br><i>** Test to make sure captions are displaying<" + "/i>");
+
+ testExpected("inbandTrack1.cues", null, '!=');
+ testExpected("textTrackDisplayElement(video, 'cue').textContent", null, '!=');
+
+ consoleWrite("<br><i>** Disable captions, cues should be flushed<" + "/i>");
+ run("video.webkitClosedCaptionsVisible = false");
+ testExpected("inbandTrack1.cues", null);
+
+ consoleWrite("");
+ endTest();
+ }
+
+ function canplaythrough()
+ {
+ consoleWrite("<br><i>** Check initial in-band track states<" + "/i>");
+ testExpected("video.textTracks.length", 1);
+ run("inbandTrack1 = video.textTracks[0]");
+ testExpected("inbandTrack1.mode", "disabled");
+ testExpected("inbandTrack1.cues", null);
+ testExpected("inbandTrack1.language", "en");
+ testExpected("inbandTrack1.kind", "captions");
+
+ consoleWrite("<br><i>** Enable cues and let them load<" + "/i>");
+ run("video.webkitClosedCaptionsVisible = true");
+ run("video.play()");
+ setTimeout(function() { video.pause(); video.currentTime = 0.3; }, 1000);
+ }
+
+ function setup()
+ {
+ findMediaElement();
+ video.src = '';
+ waitForEvent('seeked', seeked);
+ waitForEvent('canplaythrough', canplaythrough);
+ }
+
+ </script>
+ </head>
+ <body _onload_="setup()">
+ <video controls></video>
+ <p>Test that in-band tracks work with .webkitClosedCaptionsVisible.</p>
+ </body>
+</html>
Modified: trunk/LayoutTests/platform/chromium/TestExpectations (147000 => 147001)
--- trunk/LayoutTests/platform/chromium/TestExpectations 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/LayoutTests/platform/chromium/TestExpectations 2013-03-27 18:45:29 UTC (rev 147001)
@@ -3578,6 +3578,7 @@
webkit.org/b/103767 [ Win Mac Linux ] media/track/track-in-band.html [ Skip ]
webkit.org/b/103767 [ Win Mac Linux ] media/track/track-in-band-cues-added-once.html [ Skip ]
webkit.org/b/103767 [ Win Mac Linux ] media/track/track-in-band-style.html [ Skip ]
+webkit.org/b/103767 [ Win Mac Linux ] media/track/track-in-band-legacy-api.html [ Skip ]
# Flaky on Win (perhaps due to lighttpd?)
webkit.org/b/104489 [ Win ] http/tests/w3c/webperf/submission/Google/resource-timing/html/test_resource_attribute_order.html [ Failure Pass ]
Modified: trunk/LayoutTests/platform/efl/TestExpectations (147000 => 147001)
--- trunk/LayoutTests/platform/efl/TestExpectations 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/LayoutTests/platform/efl/TestExpectations 2013-03-27 18:45:29 UTC (rev 147001)
@@ -1622,6 +1622,7 @@
Bug(EFL) media/track/track-in-band.html [ Skip ]
Bug(EFL) media/track/track-in-band-cues-added-once.html [ Skip ]
Bug(EFL) media/track/track-in-band-style.html [ Skip ]
+Bug(EFL) media/track/track-in-band-legacy-api.html [ Skip ]
# All debug bots timeout (crash) on this one
webkit.org/b/56496 [ Debug ] fast/js/array-sort-modifying-tostring.html [ Crash Pass ]
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (147000 => 147001)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2013-03-27 18:45:29 UTC (rev 147001)
@@ -406,6 +406,7 @@
webkit.org/b/103771 media/track/track-in-band.html [ Failure ]
webkit.org/b/103771 media/track/track-in-band-cues-added-once.html [ Timeout ]
webkit.org/b/103771 media/track/track-in-band-style.html [ Timeout ]
+webkit.org/b/103771 media/track/track-in-band-legacy-api.html [ Timeout ]
#Incorrect rebaseline
webkit.org/b/107818 media/controls-styling.html [ Failure ]
Modified: trunk/LayoutTests/platform/mac/TestExpectations (147000 => 147001)
--- trunk/LayoutTests/platform/mac/TestExpectations 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/LayoutTests/platform/mac/TestExpectations 2013-03-27 18:45:29 UTC (rev 147001)
@@ -1355,6 +1355,7 @@
webkit.org/b/103663 [ MountainLion Lion SnowLeopard ] media/track/track-in-band.html
webkit.org/b/103663 [ MountainLion Lion SnowLeopard ] media/track/track-in-band-cues-added-once.html
webkit.org/b/103663 [ MountainLion Lion SnowLeopard ] media/track/track-in-band-style.html
+webkit.org/b/103663 [ MountainLion Lion SnowLeopard ] media/track/track-in-band-legacy-api.html
# These two tests sometimes timeout
webkit.org/b/112492 media/track/track-language-preference.html [ Failure Pass ]
Modified: trunk/LayoutTests/platform/qt/TestExpectations (147000 => 147001)
--- trunk/LayoutTests/platform/qt/TestExpectations 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/LayoutTests/platform/qt/TestExpectations 2013-03-27 18:45:29 UTC (rev 147001)
@@ -2618,6 +2618,7 @@
webkit.org/b/103769 media/track/track-in-band.html [ Skip ]
webkit.org/b/103769 media/track/track-in-band-cues-added-once.html [ Skip ]
webkit.org/b/103769 media/track/track-in-band-style.html [ Skip ]
+webkit.org/b/103769 media/track/track-in-band-legacy-api.html [ Skip ]
webkit.org/b/104150 fast/media/implicit-media-all.html [ ImageOnlyFailure ]
Modified: trunk/LayoutTests/platform/win/TestExpectations (147000 => 147001)
--- trunk/LayoutTests/platform/win/TestExpectations 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/LayoutTests/platform/win/TestExpectations 2013-03-27 18:45:29 UTC (rev 147001)
@@ -2515,6 +2515,7 @@
webkit.org/b/103770 media/track/track-in-band.html [ Skip ]
webkit.org/b/103770 media/track/track-in-band-cues-added-once.html [ Skip ]
webkit.org/b/103770 media/track/track-in-band-style.html [ Skip ]
+webkit.org/b/103770 media/track/track-in-band-legacy-api.html [ Skip ]
# https://bugs.webkit.org/show_bug.cgi?id=97026
fast/events/keydown-leftright-keys.html
Modified: trunk/Source/WebCore/ChangeLog (147000 => 147001)
--- trunk/Source/WebCore/ChangeLog 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/Source/WebCore/ChangeLog 2013-03-27 18:45:29 UTC (rev 147001)
@@ -1,5 +1,29 @@
2013-03-27 Eric Carlson <eric.carl...@apple.com>
+ [Mac] webkitClosedCaptionsVisible doesn't work
+ https://bugs.webkit.org/show_bug.cgi?id=113417
+
+ Reviewed by Jer Noble.
+
+ 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.
+
+2013-03-27 Eric Carlson <eric.carl...@apple.com>
+
[Mac] Text track menu items sometimes labeled incorrectly
https://bugs.webkit.org/show_bug.cgi?id=113406
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (147000 => 147001)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2013-03-27 18:45:29 UTC (rev 147001)
@@ -297,7 +297,6 @@
, m_lastTextTrackUpdateTime(-1)
, m_textTracks(0)
, m_ignoreTrackDisplayUpdate(0)
- , m_disableCaptions(false)
#endif
#if ENABLE(WEB_AUDIO)
, m_audioSourceNode(0)
@@ -317,11 +316,6 @@
#if ENABLE(VIDEO_TRACK)
document->registerForCaptionPreferencesChangedCallbacks(this);
- if (document->page()) {
- CaptionUserPreferences* captionPreferences = document->page()->group().captionPreferences();
- if (captionPreferences->userHasCaptionPreferences())
- m_disableCaptions = !captionPreferences->shouldShowCaptions();
- }
#endif
}
@@ -3098,7 +3092,7 @@
if (m_processingPreferenceChange && textTrack->mode() == TextTrack::showingKeyword())
currentlyEnabledTracks.append(textTrack);
- int trackScore = captionPreferences ? captionPreferences->textTrackSelectionScore(textTrack.get()) : 0;
+ int trackScore = captionPreferences ? captionPreferences->textTrackSelectionScore(textTrack.get(), this) : 0;
if (trackScore) {
// * If the text track kind is { [subtitles or captions] [descriptions] } and the user has indicated an interest in having a
// track with this text track kind, text track language, and text track label enabled, and there is no
@@ -4295,10 +4289,7 @@
#if ENABLE(VIDEO_TRACK)
if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) {
m_processingPreferenceChange = true;
- m_disableCaptions = !m_closedCaptionsVisible;
-
markCaptionAndSubtitleTracksAsUnconfigured();
-
updateTextTrackDisplay();
}
#else
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (147000 => 147001)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2013-03-27 18:45:29 UTC (rev 147001)
@@ -705,7 +705,6 @@
CueList m_currentlyActiveCues;
int m_ignoreTrackDisplayUpdate;
- bool m_disableCaptions;
#endif
#if ENABLE(WEB_AUDIO)
Modified: trunk/Source/WebCore/page/CaptionUserPreferences.cpp (147000 => 147001)
--- trunk/Source/WebCore/page/CaptionUserPreferences.cpp 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/Source/WebCore/page/CaptionUserPreferences.cpp 2013-03-27 18:45:29 UTC (rev 147001)
@@ -192,7 +192,7 @@
return tracksForMenu;
}
-int CaptionUserPreferences::textTrackSelectionScore(TextTrack* track) const
+int CaptionUserPreferences::textTrackSelectionScore(TextTrack* track, HTMLMediaElement*) const
{
int trackScore = 0;
Modified: trunk/Source/WebCore/page/CaptionUserPreferences.h (147000 => 147001)
--- trunk/Source/WebCore/page/CaptionUserPreferences.h 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/Source/WebCore/page/CaptionUserPreferences.h 2013-03-27 18:45:29 UTC (rev 147001)
@@ -37,6 +37,7 @@
namespace WebCore {
+class HTMLMediaElement;
class PageGroup;
class TextTrackList;
@@ -49,7 +50,7 @@
virtual bool shouldShowCaptions() const;
virtual void setShouldShowCaptions(bool);
- virtual int textTrackSelectionScore(TextTrack*) const;
+ virtual int textTrackSelectionScore(TextTrack*, HTMLMediaElement*) const;
virtual int textTrackLanguageSelectionScore(TextTrack*) const;
virtual bool userPrefersCaptions() const;
Modified: trunk/Source/WebCore/page/CaptionUserPreferencesMac.h (147000 => 147001)
--- trunk/Source/WebCore/page/CaptionUserPreferencesMac.h 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/Source/WebCore/page/CaptionUserPreferencesMac.h 2013-03-27 18:45:29 UTC (rev 147001)
@@ -60,7 +60,7 @@
#endif
- virtual int textTrackSelectionScore(TextTrack*) const OVERRIDE;
+ virtual int textTrackSelectionScore(TextTrack*, HTMLMediaElement*) const OVERRIDE;
virtual Vector<RefPtr<TextTrack> > sortedTrackListForMenu(TextTrackList*) OVERRIDE;
virtual String displayNameForTrack(TextTrack*) const OVERRIDE;
Modified: trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm (147000 => 147001)
--- trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm 2013-03-27 18:33:16 UTC (rev 147000)
+++ trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm 2013-03-27 18:45:29 UTC (rev 147001)
@@ -33,6 +33,7 @@
#import "CoreText/CoreText.h"
#import "DOMWrapperWorld.h"
#import "FloatConversion.h"
+#import "HTMLMediaElement.h"
#import "KURL.h"
#import "Language.h"
#import "LocalizedStrings.h"
@@ -536,9 +537,9 @@
RetainPtr<CFStringRef> languageCF(AdoptCF, CFLocaleCopyDisplayNameForPropertyValue(currentLocale.get(), kCFLocaleLanguageCode, localeIdentifier.get()));
String language = languageCF.get();
if (!label.isEmpty()) {
- if (language.isEmpty() || label.contains(language)) {
+ if (language.isEmpty() || label.contains(language))
displayName.append(label);
- } else {
+ else {
RetainPtr<CFDictionaryRef> localeDict(AdoptCF, CFLocaleCreateComponentsFromLocaleIdentifier(kCFAllocatorDefault, localeIdentifier.get()));
if (localeDict) {
CFStringRef countryCode = 0;
@@ -600,9 +601,9 @@
return lowercaseLanguageCode;
}
-int CaptionUserPreferencesMac::textTrackSelectionScore(TextTrack* track) const
+int CaptionUserPreferencesMac::textTrackSelectionScore(TextTrack* track, HTMLMediaElement* mediaElement) const
{
- if (!shouldShowCaptions())
+ if (!shouldShowCaptions() && !mediaElement->webkitClosedCaptionsVisible())
return 0;
if (track->kind() != TextTrack::captionsKeyword() && track->kind() != TextTrack::subtitlesKeyword())
return 0;