Diff
Modified: trunk/LayoutTests/ChangeLog (141956 => 141957)
--- trunk/LayoutTests/ChangeLog 2013-02-06 02:10:49 UTC (rev 141956)
+++ trunk/LayoutTests/ChangeLog 2013-02-06 02:15:33 UTC (rev 141957)
@@ -1,3 +1,15 @@
+2013-02-05 Eric Carlson <[email protected]>
+
+ [Mac] Complete plumbing so captions menu can indicate track type
+ https://bugs.webkit.org/show_bug.cgi?id=108994
+
+ Reviewed by Dean Jackson.
+
+ Update test results now that the Mac media engine identifies CC tracks.
+
+ * media/video-controls-captions-trackmenu-localized.html:
+ * platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt:
+
2013-02-05 Vineet Chaudhary <[email protected]>
formenctype to have empty string as default value.
Modified: trunk/LayoutTests/media/video-controls-captions-trackmenu-localized.html (141956 => 141957)
--- trunk/LayoutTests/media/video-controls-captions-trackmenu-localized.html 2013-02-06 02:10:49 UTC (rev 141956)
+++ trunk/LayoutTests/media/video-controls-captions-trackmenu-localized.html 2013-02-06 02:15:33 UTC (rev 141957)
@@ -26,7 +26,7 @@
return;
}
- logConsole("Heading should be labelled 'Subtitles'");
+ consoleWrite("Heading should be labelled 'Subtitles'");
testExpected("trackListSection.textContent", "Subtitles");
var captionsEntries = trackListElement.querySelectorAll("li");
@@ -36,18 +36,28 @@
}
item = captionsEntries[0];
- logConsole("First item in captions menu should be labelled 'Off'");
+ consoleWrite("<br>First item in captions menu should be labelled 'Off'");
testExpected("item.textContent", "Off");
+
item = captionsEntries[1];
- logConsole("Second item in captions menu should be labelled 'No label'");
+ consoleWrite("<br>Second item in captions menu should be labelled 'English CC'");
+ testExpected("item.textContent", "English CC");
+
+ item = captionsEntries[2];
+ consoleWrite("<br>Third item in captions menu should be labelled 'No label'");
testExpected("item.textContent", "No label");
+
+ item = captionsEntries[3];
+ consoleWrite("<br>Fourth item in captions menu should be labelled 'No label'");
+ testExpected("item.textContent", "No label");
+
endTest();
}
function start()
{
findMediaElement();
- video.src = "" 'content/test');
+ video.src = '';
waitForEvent('canplaythrough', function () { startTrackMenuTest(testMenuHeaders); });
}
</script>
Modified: trunk/LayoutTests/platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt (141956 => 141957)
--- trunk/LayoutTests/platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt 2013-02-06 02:10:49 UTC (rev 141956)
+++ trunk/LayoutTests/platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt 2013-02-06 02:15:33 UTC (rev 141957)
@@ -4,8 +4,19 @@
*** Set the user language preference.
RUN(internals.setUserPreferredLanguages(['en']))
+Heading should be labelled 'Subtitles'
EXPECTED (trackListSection.textContent == 'Subtitles') OK
+
+First item in captions menu should be labelled 'Off'
EXPECTED (item.textContent == 'Off') OK
+
+Second item in captions menu should be labelled 'English CC'
+EXPECTED (item.textContent == 'English CC') OK
+
+Third item in captions menu should be labelled 'No label'
EXPECTED (item.textContent == 'No label') OK
+
+Fourth item in captions menu should be labelled 'No label'
+EXPECTED (item.textContent == 'No label') OK
END OF TEST
Modified: trunk/Source/WebCore/ChangeLog (141956 => 141957)
--- trunk/Source/WebCore/ChangeLog 2013-02-06 02:10:49 UTC (rev 141956)
+++ trunk/Source/WebCore/ChangeLog 2013-02-06 02:15:33 UTC (rev 141957)
@@ -1,3 +1,29 @@
+2013-02-05 Eric Carlson <[email protected]>
+
+ [Mac] Complete plumbing so captions menu can indicate track type
+ https://bugs.webkit.org/show_bug.cgi?id=108994
+
+ Reviewed by Dean Jackson.
+
+ Plumb "isClosedCaptions" through to the Mac media engine.
+
+ Updated media/video-controls-captions-trackmenu-localized.html and results.
+
+ * html/track/InbandTextTrack.cpp:
+ (WebCore::InbandTextTrack::isClosedCaptions): New, pass the call through to the private track.
+ * html/track/InbandTextTrack.h:
+ (InbandTextTrack):
+ * html/track/TextTrack.cpp:
+ (WebCore::TextTrack::TextTrack): Lose the member variable, this won't be accessed often enough
+ to make it worth caching the value.
+ * html/track/TextTrack.h:
+ (WebCore::TextTrack::isClosedCaptions): Make virtual so derived classes can oveerride.
+ * platform/graphics/InbandTextTrackPrivate.h:
+ (WebCore::InbandTextTrackPrivate::isClosedCaptions): New.
+ * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h:
+ * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
+ (WebCore::InbandTextTrackPrivateAVFObjC::isClosedCaptions): New.
+
2013-02-05 Mark Lam <[email protected]>
Change DatabaseTask and DatabaseThread to work with DatabaseBackendAsync
Modified: trunk/Source/WebCore/html/track/InbandTextTrack.cpp (141956 => 141957)
--- trunk/Source/WebCore/html/track/InbandTextTrack.cpp 2013-02-06 02:10:49 UTC (rev 141956)
+++ trunk/Source/WebCore/html/track/InbandTextTrack.cpp 2013-02-06 02:15:33 UTC (rev 141957)
@@ -94,6 +94,14 @@
ASSERT_NOT_REACHED();
}
+bool InbandTextTrack::isClosedCaptions() const
+{
+ if (!m_private)
+ return false;
+
+ return m_private->isClosedCaptions();
+}
+
size_t InbandTextTrack::inbandTrackIndex()
{
ASSERT(m_private);
Modified: trunk/Source/WebCore/html/track/InbandTextTrack.h (141956 => 141957)
--- trunk/Source/WebCore/html/track/InbandTextTrack.h 2013-02-06 02:10:49 UTC (rev 141956)
+++ trunk/Source/WebCore/html/track/InbandTextTrack.h 2013-02-06 02:15:33 UTC (rev 141957)
@@ -45,6 +45,7 @@
static PassRefPtr<InbandTextTrack> create(ScriptExecutionContext*, TextTrackClient*, PassRefPtr<InbandTextTrackPrivate>);
virtual ~InbandTextTrack();
+ virtual bool isClosedCaptions() const OVERRIDE;
virtual void setMode(const AtomicString&) OVERRIDE;
size_t inbandTrackIndex();
Modified: trunk/Source/WebCore/html/track/TextTrack.cpp (141956 => 141957)
--- trunk/Source/WebCore/html/track/TextTrack.cpp 2013-02-06 02:10:49 UTC (rev 141956)
+++ trunk/Source/WebCore/html/track/TextTrack.cpp 2013-02-06 02:15:33 UTC (rev 141957)
@@ -107,7 +107,6 @@
, m_trackIndex(invalidTrackIndex)
, m_renderedTrackIndex(invalidTrackIndex)
, m_hasBeenConfigured(false)
- , m_isClosedCaptions(false)
{
setKind(kind);
}
Modified: trunk/Source/WebCore/html/track/TextTrack.h (141956 => 141957)
--- trunk/Source/WebCore/html/track/TextTrack.h 2013-02-06 02:10:49 UTC (rev 141956)
+++ trunk/Source/WebCore/html/track/TextTrack.h 2013-02-06 02:15:33 UTC (rev 141957)
@@ -109,8 +109,7 @@
enum TextTrackType { TrackElement, AddTrack, InBand };
TextTrackType trackType() const { return m_trackType; }
- bool isClosedCaptions() const { return m_isClosedCaptions; }
- void setIsClosedCaptions(bool isClosedCaptions) { m_isClosedCaptions = isClosedCaptions; }
+ virtual bool isClosedCaptions() const { return false; }
int trackIndex();
void invalidateTrackIndex();
@@ -144,7 +143,6 @@
int m_trackIndex;
int m_renderedTrackIndex;
bool m_hasBeenConfigured;
- bool m_isClosedCaptions;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h (141956 => 141957)
--- trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h 2013-02-06 02:10:49 UTC (rev 141956)
+++ trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h 2013-02-06 02:15:33 UTC (rev 141957)
@@ -55,6 +55,7 @@
enum Kind { Subtitles, Captions, Descriptions, Chapters, Metadata, None };
virtual Kind kind() const { return Subtitles; }
+ virtual bool isClosedCaptions() const { return false; }
virtual AtomicString label() const { return emptyAtom; }
virtual AtomicString language() const { return emptyAtom; }
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h (141956 => 141957)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h 2013-02-06 02:10:49 UTC (rev 141956)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h 2013-02-06 02:15:33 UTC (rev 141957)
@@ -48,6 +48,7 @@
~InbandTextTrackPrivateAVFObjC() { }
virtual InbandTextTrackPrivate::Kind kind() const OVERRIDE;
+ virtual bool isClosedCaptions() const OVERRIDE;
virtual AtomicString label() const OVERRIDE;
virtual AtomicString language() const OVERRIDE;
virtual bool isDefault() const OVERRIDE;
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm (141956 => 141957)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm 2013-02-06 02:10:49 UTC (rev 141956)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm 2013-02-06 02:15:33 UTC (rev 141957)
@@ -111,6 +111,14 @@
return Captions;
}
+bool InbandTextTrackPrivateAVFObjC::isClosedCaptions() const
+{
+ if (!m_mediaSelectionOption)
+ return false;
+
+ return [[m_mediaSelectionOption mediaType] isEqualToString:AVMediaTypeClosedCaption];
+}
+
AtomicString InbandTextTrackPrivateAVFObjC::label() const
{
if (!m_mediaSelectionOption)