Add Settings for text track types
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2011 16:53:14 +0000 (16:53 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2011 16:53:14 +0000 (16:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73383

Reviewed by Darin Adler.

No new tests, settings are not used yet.

* page/Settings.cpp:
(WebCore::Settings::Settings): Initialize new settings.
* page/Settings.h:
(WebCore::Settings::setShouldDisplaySubtitles): New.
(WebCore::Settings::shouldDisplaySubtitles): Ditto.
(WebCore::Settings::setShouldDisplayCaptions): Ditto.
(WebCore::Settings::shouldDisplayCaptions): Ditto.
(WebCore::Settings::setShouldDisplayTextDescriptions): Ditto.
(WebCore::Settings::shouldDisplayTextDescriptions): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101674 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h

index f5a050c..fdec0a7 100644 (file)
@@ -1,5 +1,24 @@
 2011-12-01  Eric Carlson  <eric.carlson@apple.com>
 
+        Add Settings for text track types
+        https://bugs.webkit.org/show_bug.cgi?id=73383
+
+        Reviewed by Darin Adler.
+
+        No new tests, settings are not used yet.
+
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings): Initialize new settings.
+        * page/Settings.h:
+        (WebCore::Settings::setShouldDisplaySubtitles): New.
+        (WebCore::Settings::shouldDisplaySubtitles): Ditto.
+        (WebCore::Settings::setShouldDisplayCaptions): Ditto.
+        (WebCore::Settings::shouldDisplayCaptions): Ditto.
+        (WebCore::Settings::setShouldDisplayTextDescriptions): Ditto.
+        (WebCore::Settings::shouldDisplayTextDescriptions): Ditto.
+
+2011-12-01  Eric Carlson  <eric.carlson@apple.com>
+
         HTMLTrackElement.readyState should return TextTrack "readiness state".
         https://bugs.webkit.org/show_bug.cgi?id=73466
 
index 4a77d0b..493a370 100644 (file)
@@ -229,6 +229,11 @@ Settings::Settings(Page* page)
     , m_suppressIncrementalRendering(false)
     , m_backspaceKeyNavigationEnabled(true)
     , m_visualWordMovementEnabled(false)
+#if ENABLE(VIDEO_TRACK)
+    , m_shouldDisplaySubtitles(false)
+    , m_shouldDisplayCaptions(false)
+    , m_shouldDisplayTextDescriptions(false)
+#endif
     , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
 {
     // A Frame may not have been created yet, so we initialize the AtomicString 
index 08f8c87..3dd34b6 100644 (file)
@@ -486,6 +486,17 @@ namespace WebCore {
         void setVisualWordMovementEnabled(bool enabled) { m_visualWordMovementEnabled = enabled; }
         bool visualWordMovementEnabled() const { return m_visualWordMovementEnabled; }
 
+#if ENABLE(VIDEO_TRACK)
+        void setShouldDisplaySubtitles(bool flag) { m_shouldDisplaySubtitles = flag; }
+        bool shouldDisplaySubtitles() const { return m_shouldDisplaySubtitles; }
+
+        void setShouldDisplayCaptions(bool flag) { m_shouldDisplayCaptions = flag; }
+        bool shouldDisplayCaptions() const { return m_shouldDisplayCaptions; }
+
+        void setShouldDisplayTextDescriptions(bool flag) { m_shouldDisplayTextDescriptions = flag; }
+        bool shouldDisplayTextDescriptions() const { return m_shouldDisplayTextDescriptions; }
+#endif
+
     private:
         Page* m_page;
 
@@ -612,6 +623,12 @@ namespace WebCore {
         bool m_backspaceKeyNavigationEnabled : 1;
         bool m_visualWordMovementEnabled : 1;
 
+#if ENABLE(VIDEO_TRACK)
+        bool m_shouldDisplaySubtitles : 1;
+        bool m_shouldDisplayCaptions : 1;
+        bool m_shouldDisplayTextDescriptions : 1;
+#endif
+
         Timer<Settings> m_loadsImagesAutomaticallyTimer;
         void loadsImagesAutomaticallyTimerFired(Timer<Settings>*);