Title: [166858] trunk/Source/WebCore
- Revision
- 166858
- Author
- bfulg...@apple.com
- Date
- 2014-04-06 16:21:46 -0700 (Sun, 06 Apr 2014)
Log Message
Honor System-Level User Preferences for Caption Display
https://bugs.webkit.org/show_bug.cgi?id=131258
Reviewed by Eric Carlson.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setSelectedTextTrack): Allow preferenced change to fully dispatch
so we can properly deal with captions being turned off.
(WebCore::HTMLMediaElement::captionPreferencesChanged): Use 'webkit' variant of the
setWebKitClosedCaptionsVisible method so we properly adjust settings needed for the JS API call.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay): When captions are turned off, e.g.
because the user turned off the preference, don't inadvertently turn them back on just bacause there
was an existing track that was not in a 'hidden' state.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (166857 => 166858)
--- trunk/Source/WebCore/ChangeLog 2014-04-06 22:12:09 UTC (rev 166857)
+++ trunk/Source/WebCore/ChangeLog 2014-04-06 23:21:46 UTC (rev 166858)
@@ -1,3 +1,20 @@
+2014-04-06 Brent Fulgham <bfulg...@apple.com>
+
+ Honor System-Level User Preferences for Caption Display
+ https://bugs.webkit.org/show_bug.cgi?id=131258
+
+ Reviewed by Eric Carlson.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::setSelectedTextTrack): Allow preferenced change to fully dispatch
+ so we can properly deal with captions being turned off.
+ (WebCore::HTMLMediaElement::captionPreferencesChanged): Use 'webkit' variant of the
+ setWebKitClosedCaptionsVisible method so we properly adjust settings needed for the JS API call.
+ * html/shadow/MediaControlElements.cpp:
+ (WebCore::MediaControlTextTrackContainerElement::updateDisplay): When captions are turned off, e.g.
+ because the user turned off the preference, don't inadvertently turn them back on just bacause there
+ was an existing track that was not in a 'hidden' state.
+
2014-04-06 Brian J. Burg <b...@cs.washington.edu>
Web Replay: add methods to encode a frame's index based on its FrameTree position
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (166857 => 166858)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2014-04-06 22:12:09 UTC (rev 166857)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2014-04-06 23:21:46 UTC (rev 166858)
@@ -3708,9 +3708,6 @@
displayMode = CaptionUserPreferences::AlwaysOn;
if (trackToSelect->language().length())
captionPreferences->setPreferredLanguage(trackToSelect->language());
-
- // Set m_captionDisplayMode here so we don't reconfigure again when the preference changed notification comes through.
- m_captionDisplayMode = displayMode;
}
captionPreferences->setCaptionDisplayMode(displayMode);
@@ -5420,7 +5417,7 @@
return;
m_captionDisplayMode = displayMode;
- setClosedCaptionsVisible(m_captionDisplayMode == CaptionUserPreferences::AlwaysOn);
+ setWebkitClosedCaptionsVisible(m_captionDisplayMode == CaptionUserPreferences::AlwaysOn);
}
void HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured(ReconfigureMode mode)
Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (166857 => 166858)
--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp 2014-04-06 22:12:09 UTC (rev 166857)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp 2014-04-06 23:21:46 UTC (rev 166858)
@@ -1310,6 +1310,9 @@
// corresponding CSS boxes added to output, in text track cue order, run the
// following substeps:
for (size_t i = 0; i < activeCues.size(); ++i) {
+ if (!mediaController()->closedCaptionsVisible())
+ continue;
+
TextTrackCue* textTrackCue = activeCues[i].data();
if (!textTrackCue->isRenderable())
continue;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes