<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[196477] branches/safari-601.1.46-branch</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/196477">196477</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2016-02-12 09:00:22 -0800 (Fri, 12 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/196401">r196401</a>.  rdar://problem/24611749</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsChangeLog">branches/safari-601.1.46-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601146branchLayoutTestsmediatracktrackmanualmodeexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/media/track/track-manual-mode-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestsmediatracktrackmanualmodehtml">branches/safari-601.1.46-branch/LayoutTests/media/track/track-manual-mode.html</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreChangeLog">branches/safari-601.1.46-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreEnglishlprojLocalizablestrings">branches/safari-601.1.46-branch/Source/WebCore/English.lproj/Localizable.strings</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlHTMLMediaElementcpp">branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmltrackTextTrackcpp">branches/safari-601.1.46-branch/Source/WebCore/html/track/TextTrack.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmltrackTextTrackh">branches/safari-601.1.46-branch/Source/WebCore/html/track/TextTrack.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmltrackTrackBaseh">branches/safari-601.1.46-branch/Source/WebCore/html/track/TrackBase.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorepageCaptionUserPreferencesMediaAFcpp">branches/safari-601.1.46-branch/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformLocalizedStringscpp">branches/safari-601.1.46-branch/Source/WebCore/platform/LocalizedStrings.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformLocalizedStringsh">branches/safari-601.1.46-branch/Source/WebCore/platform/LocalizedStrings.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601146branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-02-12  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
+        Merge r196401.
+
+    2016-02-10  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+            Update &quot;manual&quot; caption track logic
+            https://bugs.webkit.org/show_bug.cgi?id=154084
+            &lt;rdar://problem/24530516&gt;
+
+            Reviewed by Dean Jackson.
+
+            * media/track/track-manual-mode-expected.txt:
+            * media/track/track-manual-mode.html:
+
</ins><span class="cx"> 2016-02-03  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r195837. rdar://problem/24001782
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsmediatracktrackmanualmodeexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/media/track/track-manual-mode-expected.txt (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/media/track/track-manual-mode-expected.txt        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/LayoutTests/media/track/track-manual-mode-expected.txt        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -6,19 +6,31 @@
</span><span class="cx"> RUN(internals.setCaptionDisplayMode('manual'))
</span><span class="cx"> EVENT(canplaythrough)
</span><span class="cx"> 
</span><del>-** Forced tracks should be in .textTracks as well as in the menu,
-** but should be labeled as 'subtitles'
-
</del><ins>+** Forced tracks should be in .textTracks as well as in the menu
</ins><span class="cx"> EXPECTED (video.textTracks.length == '9') OK
</span><span class="cx"> EXPECTED (trackMenuItems.length == '11') OK
</span><span class="cx"> 
</span><ins>+** 'forced' should be in the title of a forced track menu item
+Track menu:
+0: &quot;Off&quot;, checked
+1: &quot;Auto (Recommended)&quot;
+2: &quot;English Closed Captions CC&quot;
+3: &quot;English Subtitles&quot;
+4: &quot;English Subtitles Forced&quot;
+5: &quot;French Subtitles&quot;
+6: &quot;French Subtitles Forced&quot;
+7: &quot;German Subtitles&quot;
+8: &quot;German Subtitles Forced&quot;
+9: &quot;Spanish Subtitles&quot;
+10: &quot;Spanish Subtitles Forced&quot;
+
</ins><span class="cx"> ** No track should be enabled by default
</span><span class="cx"> EXPECTED (video.textTracks[0].language == 'en') OK
</span><span class="cx"> EXPECTED (video.textTracks[0].kind == 'subtitles') OK
</span><span class="cx"> EXPECTED (video.textTracks[0].mode == 'disabled') OK
</span><span class="cx"> 
</span><span class="cx"> EXPECTED (video.textTracks[1].language == 'en') OK
</span><del>-EXPECTED (video.textTracks[1].kind == 'subtitles') OK
</del><ins>+EXPECTED (video.textTracks[1].kind == 'forced') OK
</ins><span class="cx"> EXPECTED (video.textTracks[1].mode == 'disabled') OK
</span><span class="cx"> 
</span><span class="cx"> EXPECTED (video.textTracks[2].language == 'fr') OK
</span><span class="lines">@@ -26,7 +38,7 @@
</span><span class="cx"> EXPECTED (video.textTracks[2].mode == 'disabled') OK
</span><span class="cx"> 
</span><span class="cx"> EXPECTED (video.textTracks[3].language == 'fr') OK
</span><del>-EXPECTED (video.textTracks[3].kind == 'subtitles') OK
</del><ins>+EXPECTED (video.textTracks[3].kind == 'forced') OK
</ins><span class="cx"> EXPECTED (video.textTracks[3].mode == 'disabled') OK
</span><span class="cx"> 
</span><span class="cx"> EXPECTED (video.textTracks[4].language == 'es') OK
</span><span class="lines">@@ -34,7 +46,7 @@
</span><span class="cx"> EXPECTED (video.textTracks[4].mode == 'disabled') OK
</span><span class="cx"> 
</span><span class="cx"> EXPECTED (video.textTracks[5].language == 'es') OK
</span><del>-EXPECTED (video.textTracks[5].kind == 'subtitles') OK
</del><ins>+EXPECTED (video.textTracks[5].kind == 'forced') OK
</ins><span class="cx"> EXPECTED (video.textTracks[5].mode == 'disabled') OK
</span><span class="cx"> 
</span><span class="cx"> EXPECTED (video.textTracks[6].language == 'de') OK
</span><span class="lines">@@ -42,7 +54,7 @@
</span><span class="cx"> EXPECTED (video.textTracks[6].mode == 'disabled') OK
</span><span class="cx"> 
</span><span class="cx"> EXPECTED (video.textTracks[7].language == 'de') OK
</span><del>-EXPECTED (video.textTracks[7].kind == 'subtitles') OK
</del><ins>+EXPECTED (video.textTracks[7].kind == 'forced') OK
</ins><span class="cx"> EXPECTED (video.textTracks[7].mode == 'disabled') OK
</span><span class="cx"> 
</span><span class="cx"> EXPECTED (video.textTracks[8].language == 'en') OK
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsmediatracktrackmanualmodehtml"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/media/track/track-manual-mode.html (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/media/track/track-manual-mode.html        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/LayoutTests/media/track/track-manual-mode.html        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -10,8 +10,7 @@
</span><span class="cx"> 
</span><span class="cx">             function testTracks()
</span><span class="cx">             {
</span><del>-                consoleWrite(`&lt;br&gt;&lt;i&gt;** Forced tracks should be in .textTracks as well as in the menu,`);
-                consoleWrite(`&lt;i&gt;** but should be labeled as 'subtitles'&lt;/i&gt;&lt;br&gt;`);
</del><ins>+                consoleWrite(`&lt;br&gt;&lt;i&gt;** Forced tracks should be in .textTracks as well as in the menu`);
</ins><span class="cx">                 testExpected(&quot;video.textTracks.length&quot;, 9);
</span><span class="cx"> 
</span><span class="cx">                 // Click the CC button to show the menu because it isn't created until it becomes visible.
</span><span class="lines">@@ -24,6 +23,9 @@
</span><span class="cx">                 }
</span><span class="cx">                 testExpected(&quot;trackMenuItems.length&quot;, 11);
</span><span class="cx"> 
</span><ins>+                consoleWrite(`&lt;br&gt;&lt;i&gt;** 'forced' should be in the title of a forced track menu item&lt;i&gt;`);
+                listTrackMenu();
+
</ins><span class="cx">                 consoleWrite(&quot;&lt;br&gt;&lt;i&gt;** No track should be enabled by default&lt;&quot; + &quot;/i&gt;&quot;);
</span><span class="cx">                 testExpected(&quot;video.textTracks[0].language&quot;, &quot;en&quot;);
</span><span class="cx">                 testExpected(&quot;video.textTracks[0].kind&quot;, &quot;subtitles&quot;);
</span><span class="lines">@@ -31,7 +33,7 @@
</span><span class="cx">                 consoleWrite(&quot;&quot;);
</span><span class="cx"> 
</span><span class="cx">                 testExpected(&quot;video.textTracks[1].language&quot;, &quot;en&quot;);
</span><del>-                testExpected(&quot;video.textTracks[1].kind&quot;, &quot;subtitles&quot;);
</del><ins>+                testExpected(&quot;video.textTracks[1].kind&quot;, &quot;forced&quot;);
</ins><span class="cx">                 testExpected(&quot;video.textTracks[1].mode&quot;, &quot;disabled&quot;);
</span><span class="cx">                 consoleWrite(&quot;&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -41,7 +43,7 @@
</span><span class="cx">                 consoleWrite(&quot;&quot;);
</span><span class="cx"> 
</span><span class="cx">                 testExpected(&quot;video.textTracks[3].language&quot;, &quot;fr&quot;);
</span><del>-                testExpected(&quot;video.textTracks[3].kind&quot;, &quot;subtitles&quot;);
</del><ins>+                testExpected(&quot;video.textTracks[3].kind&quot;, &quot;forced&quot;);
</ins><span class="cx">                 testExpected(&quot;video.textTracks[3].mode&quot;, &quot;disabled&quot;);
</span><span class="cx">                 consoleWrite(&quot;&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -51,7 +53,7 @@
</span><span class="cx">                 consoleWrite(&quot;&quot;);
</span><span class="cx"> 
</span><span class="cx">                 testExpected(&quot;video.textTracks[5].language&quot;, &quot;es&quot;);
</span><del>-                testExpected(&quot;video.textTracks[5].kind&quot;, &quot;subtitles&quot;);
</del><ins>+                testExpected(&quot;video.textTracks[5].kind&quot;, &quot;forced&quot;);
</ins><span class="cx">                 testExpected(&quot;video.textTracks[5].mode&quot;, &quot;disabled&quot;);
</span><span class="cx">                 consoleWrite(&quot;&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -61,7 +63,7 @@
</span><span class="cx">                 consoleWrite(&quot;&quot;);
</span><span class="cx"> 
</span><span class="cx">                 testExpected(&quot;video.textTracks[7].language&quot;, &quot;de&quot;);
</span><del>-                testExpected(&quot;video.textTracks[7].kind&quot;, &quot;subtitles&quot;);
</del><ins>+                testExpected(&quot;video.textTracks[7].kind&quot;, &quot;forced&quot;);
</ins><span class="cx">                 testExpected(&quot;video.textTracks[7].mode&quot;, &quot;disabled&quot;);
</span><span class="cx">                 consoleWrite(&quot;&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2016-02-12  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
+        Merge r196401.
+
+    2016-02-10  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+            Update &quot;manual&quot; caption track logic
+            https://bugs.webkit.org/show_bug.cgi?id=154084
+            &lt;rdar://problem/24530516&gt;
+
+            Reviewed by Dean Jackson.
+
+            No new tests, media/track/track-manual-mode.html was updated.
+
+            * English.lproj/Localizable.strings: Add new string.
+
+            * html/HTMLMediaElement.cpp:
+            (WebCore::HTMLMediaElement::addTextTrack): track.setManualSelectionMode is no more.
+            (WebCore::HTMLMediaElement::configureTextTrackGroup): Never enable a track automatically when
+              in manual selection mode.
+            (WebCore::HTMLMediaElement::captionPreferencesChanged):  track.setManualSelectionMode is no more.
+
+            * html/track/TextTrack.cpp:
+            (WebCore::TextTrack::containsOnlyForcedSubtitles): Return true for forced tracks.
+            (WebCore::TextTrack::kind): Deleted.
+            * html/track/TextTrack.h:
+
+            * html/track/TrackBase.h:
+            (WebCore::TrackBase::kind): De-virtualize, nobody overrides it.
+
+            * page/CaptionUserPreferencesMediaAF.cpp:
+            (WebCore::trackDisplayName): Include &quot;forced&quot; in the name of forced tracks.
+
+            * platform/LocalizedStrings.cpp:
+            (WebCore::forcedTrackMenuItemText): New.
+            * platform/LocalizedStrings.h:
+
</ins><span class="cx"> 2016-02-03  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r195837. rdar://problem/24001782
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreEnglishlprojLocalizablestrings"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/English.lproj/Localizable.strings (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/English.lproj/Localizable.strings        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/Source/WebCore/English.lproj/Localizable.strings        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -40,6 +40,9 @@
</span><span class="cx"> /* Text track contains simplified (3rd grade level) subtitles */
</span><span class="cx"> &quot;%@ Easy Reader&quot; = &quot;%@ Easy Reader&quot;;
</span><span class="cx"> 
</span><ins>+/* Text track contains forced subtitles */
+&quot;%@ Forced&quot; = &quot;%@ Forced&quot;;
+
</ins><span class="cx"> /* visible name of the network process. The argument is the application name. */
</span><span class="cx"> &quot;%@ Networking&quot; = &quot;%@ Networking&quot;;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.cpp (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.cpp        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.cpp        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -3517,7 +3517,6 @@
</span><span class="cx">             m_captionDisplayMode = page-&gt;group().captionPreferences()-&gt;captionDisplayMode();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    track-&gt;setManualSelectionMode(m_captionDisplayMode == CaptionUserPreferences::Manual);
</del><span class="cx">     textTracks()-&gt;append(track);
</span><span class="cx"> 
</span><span class="cx">     closeCaptionTracksChanged();
</span><span class="lines">@@ -3780,30 +3779,32 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!trackToEnable &amp;&amp; defaultTrack)
-        trackToEnable = defaultTrack;
-    
-    // If no track matches the user's preferred language, none was marked as 'default', and there is a forced subtitle track
-    // in the same language as the language of the primary audio track, enable it.
-    if (!trackToEnable &amp;&amp; forcedSubitleTrack)
-        trackToEnable = forcedSubitleTrack;
</del><ins>+    if (displayMode != CaptionUserPreferences::Manual) {
+        if (!trackToEnable &amp;&amp; defaultTrack)
+            trackToEnable = defaultTrack;
</ins><span class="cx"> 
</span><del>-    // If no track matches, don't disable an already visible track unless preferences say they all should be off.
-    if (group.kind != TrackGroup::CaptionsAndSubtitles || displayMode != CaptionUserPreferences::ForcedOnly) {
-        if (!trackToEnable &amp;&amp; !defaultTrack &amp;&amp; group.visibleTrack)
-            trackToEnable = group.visibleTrack;
</del><ins>+        // If no track matches the user's preferred language, none was marked as 'default', and there is a forced subtitle track
+        // in the same language as the language of the primary audio track, enable it.
+        if (!trackToEnable &amp;&amp; forcedSubitleTrack)
+            trackToEnable = forcedSubitleTrack;
+
+        // If no track matches, don't disable an already visible track unless preferences say they all should be off.
+        if (group.kind != TrackGroup::CaptionsAndSubtitles || displayMode != CaptionUserPreferences::ForcedOnly) {
+            if (!trackToEnable &amp;&amp; !defaultTrack &amp;&amp; group.visibleTrack)
+                trackToEnable = group.visibleTrack;
+        }
+
+        // If no track matches the user's preferred language and non was marked 'default', enable the first track
+        // because the user has explicitly stated a preference for this kind of track.
+        if (!trackToEnable &amp;&amp; fallbackTrack)
+            trackToEnable = fallbackTrack;
+
+        if (trackToEnable)
+            m_subtitleTrackLanguage = trackToEnable-&gt;language();
+        else
+            m_subtitleTrackLanguage = emptyString();
</ins><span class="cx">     }
</span><del>-    
-    // If no track matches the user's preferred language and non was marked 'default', enable the first track
-    // because the user has explicitly stated a preference for this kind of track.
-    if (!trackToEnable &amp;&amp; fallbackTrack)
-        trackToEnable = fallbackTrack;
</del><span class="cx"> 
</span><del>-    if (trackToEnable)
-        m_subtitleTrackLanguage = trackToEnable-&gt;language();
-    else
-        m_subtitleTrackLanguage = emptyString();
-    
</del><span class="cx">     if (currentlyEnabledTracks.size()) {
</span><span class="cx">         for (size_t i = 0; i &lt; currentlyEnabledTracks.size(); ++i) {
</span><span class="cx">             RefPtr&lt;TextTrack&gt; textTrack = currentlyEnabledTracks[i];
</span><span class="lines">@@ -5631,11 +5632,6 @@
</span><span class="cx">     if (m_captionDisplayMode == displayMode)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (m_captionDisplayMode == CaptionUserPreferences::Manual || displayMode == CaptionUserPreferences::Manual) {
-        for (unsigned i = 0; i &lt; m_textTracks-&gt;length(); ++i)
-            m_textTracks-&gt;item(i)-&gt;setManualSelectionMode(displayMode == CaptionUserPreferences::Manual);
-    }
-
</del><span class="cx">     m_captionDisplayMode = displayMode;
</span><span class="cx">     setWebkitClosedCaptionsVisible(m_captionDisplayMode == CaptionUserPreferences::AlwaysOn);
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmltrackTextTrackcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/track/TextTrack.cpp (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/track/TextTrack.cpp        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/track/TextTrack.cpp        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -177,15 +177,6 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AtomicString TextTrack::kind() const
-{
-    AtomicString kind = TrackBase::kind();
-    if (!m_manualSelectionMode || kind != forcedKeyword())
-        return kind;
-
-    return subtitlesKeyword();
-}
-
</del><span class="cx"> void TextTrack::setKind(const AtomicString&amp; newKind)
</span><span class="cx"> {
</span><span class="cx">     String oldKind = kind();
</span><span class="lines">@@ -602,6 +593,11 @@
</span><span class="cx">     return kind() == captionsKeyword();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool TextTrack::containsOnlyForcedSubtitles() const
+{
+    return kind() == forcedKeyword();
+}
+
</ins><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx"> void TextTrack::setLanguage(const AtomicString&amp; language)
</span><span class="cx"> {
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmltrackTextTrackh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/track/TextTrack.h (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/track/TextTrack.h        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/track/TextTrack.h        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -92,8 +92,7 @@
</span><span class="cx">     static const AtomicString&amp; hiddenKeyword();
</span><span class="cx">     static const AtomicString&amp; showingKeyword();
</span><span class="cx"> 
</span><del>-    void setKind(const AtomicString&amp;) override;
-    AtomicString kind() const override;
</del><ins>+    virtual void setKind(const AtomicString&amp;) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual AtomicString inBandMetadataTrackDispatchType() const { return emptyString(); }
</span><span class="cx"> 
</span><span class="lines">@@ -129,7 +128,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool isClosedCaptions() const { return false; }
</span><span class="cx">     virtual bool isSDH() const { return false; }
</span><del>-    virtual bool containsOnlyForcedSubtitles() const { return false; }
</del><ins>+    virtual bool containsOnlyForcedSubtitles() const;
</ins><span class="cx">     virtual bool isMainProgramContent() const;
</span><span class="cx">     virtual bool isEasyToRead() const { return false; }
</span><span class="cx"> 
</span><span class="lines">@@ -159,8 +158,6 @@
</span><span class="cx"> 
</span><span class="cx">     virtual MediaTime startTimeVariance() const { return MediaTime::zeroTime(); }
</span><span class="cx"> 
</span><del>-    void setManualSelectionMode(bool mode) { m_manualSelectionMode = mode; }
-
</del><span class="cx">     using RefCounted&lt;TrackBase&gt;::ref;
</span><span class="cx">     using RefCounted&lt;TrackBase&gt;::deref;
</span><span class="cx"> 
</span><span class="lines">@@ -198,7 +195,6 @@
</span><span class="cx">     int m_trackIndex;
</span><span class="cx">     int m_renderedTrackIndex;
</span><span class="cx">     bool m_hasBeenConfigured;
</span><del>-    bool m_manualSelectionMode { false };
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline TextTrack* toTextTrack(TrackBase* track)
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmltrackTrackBaseh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/track/TrackBase.h (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/track/TrackBase.h        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/track/TrackBase.h        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">     virtual AtomicString id() const { return m_id; }
</span><span class="cx">     virtual void setId(const AtomicString&amp; id) { m_id = id; }
</span><span class="cx"> 
</span><del>-    virtual AtomicString kind() const { return m_kind; }
</del><ins>+    AtomicString kind() const { return m_kind; }
</ins><span class="cx">     virtual void setKind(const AtomicString&amp;);
</span><span class="cx"> 
</span><span class="cx">     AtomicString label() const { return m_label; }
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorepageCaptionUserPreferencesMediaAFcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -666,22 +666,32 @@
</span><span class="cx">     if (track == TextTrack::captionMenuAutomaticItem())
</span><span class="cx">         return textTrackAutomaticMenuItemText();
</span><span class="cx"> 
</span><del>-    StringBuilder displayName;
-    buildDisplayStringForTrackBase(displayName, *track);
</del><ins>+    StringBuilder displayNameBuilder;
+    buildDisplayStringForTrackBase(displayNameBuilder, *track);
</ins><span class="cx"> 
</span><del>-    if (displayName.isEmpty())
-        displayName.append(textTrackNoLabelText());
-    
-    if (track-&gt;isEasyToRead())
-        return easyReaderTrackMenuItemText(displayName.toString());
-    
-    if (track-&gt;isClosedCaptions())
-        return closedCaptionTrackMenuItemText(displayName.toString());
</del><ins>+    if (displayNameBuilder.isEmpty())
+        displayNameBuilder.append(textTrackNoLabelText());
</ins><span class="cx"> 
</span><ins>+    String displayName = displayNameBuilder.toString();
+
+    if (track-&gt;isClosedCaptions()) {
+        displayName = closedCaptionTrackMenuItemText(displayName);
+        if (track-&gt;isEasyToRead())
+            displayName = easyReaderTrackMenuItemText(displayName);
+
+        return displayName;
+    }
+
</ins><span class="cx">     if (track-&gt;isSDH())
</span><del>-        return sdhTrackMenuItemText(displayName.toString());
</del><ins>+        displayName = sdhTrackMenuItemText(displayName);
</ins><span class="cx"> 
</span><del>-    return displayName.toString();
</del><ins>+    if (track-&gt;containsOnlyForcedSubtitles())
+        displayName = forcedTrackMenuItemText(displayName);
+
+    if (track-&gt;isEasyToRead())
+        displayName = easyReaderTrackMenuItemText(displayName);
+
+    return displayName;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String CaptionUserPreferencesMediaAF::displayNameForTrack(TextTrack* track) const
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformLocalizedStringscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/LocalizedStrings.cpp (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/LocalizedStrings.cpp        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/LocalizedStrings.cpp        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -1110,6 +1110,11 @@
</span><span class="cx"> {
</span><span class="cx">     return formatLocalizedString(WEB_UI_STRING(&quot;%@ Easy Reader&quot;, &quot;Text track contains simplified (3rd grade level) subtitles&quot;), title.createCFString().get());
</span><span class="cx"> }
</span><ins>+
+String forcedTrackMenuItemText(const String&amp; title)
+{
+    return formatLocalizedString(WEB_UI_STRING(&quot;%@ Forced&quot;, &quot;Text track contains forced subtitles&quot;), title.createCFString().get());
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformLocalizedStringsh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/LocalizedStrings.h (196476 => 196477)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/LocalizedStrings.h        2016-02-12 16:49:01 UTC (rev 196476)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/LocalizedStrings.h        2016-02-12 17:00:22 UTC (rev 196477)
</span><span class="lines">@@ -257,6 +257,7 @@
</span><span class="cx">     String closedCaptionTrackMenuItemText(const String&amp;);
</span><span class="cx">     String sdhTrackMenuItemText(const String&amp;);
</span><span class="cx">     String easyReaderTrackMenuItemText(const String&amp;);
</span><ins>+    String forcedTrackMenuItemText(const String&amp;);
</ins><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>