<!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>[152112] tags/Safari-537.47/Source/WebCore</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/152112">152112</a></dd>
<dt>Author</dt> <dd>lforschler@apple.com</dd>
<dt>Date</dt> <dd>2013-06-27 10:47:44 -0700 (Thu, 27 Jun 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/152004">r152004</a>.  &lt;rdar://problem/14278574&gt;</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#tagsSafari53747SourceWebCoreChangeLog">tags/Safari-537.47/Source/WebCore/ChangeLog</a></li>
<li><a href="#tagsSafari53747SourceWebCoreWebCorevcxprojWebCorevcxproj">tags/Safari-537.47/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#tagsSafari53747SourceWebCoreWebCorevcxprojWebCorevcxprojfilters">tags/Safari-537.47/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#tagsSafari53747SourceWebCoreWebCorexcodeprojprojectpbxproj">tags/Safari-537.47/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#tagsSafari53747SourceWebCorepagePageGroupcpp">tags/Safari-537.47/Source/WebCore/page/PageGroup.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#tagsSafari53747SourceWebCorepageCaptionUserPreferencesMediaAFcpp">tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp</a></li>
<li><a href="#tagsSafari53747SourceWebCorepageCaptionUserPreferencesMediaAFh">tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMediaAF.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#tagsSafari53747SourceWebCorepageCaptionUserPreferencesMach">tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMac.h</a></li>
<li><a href="#tagsSafari53747SourceWebCorepageCaptionUserPreferencesMacmm">tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="tagsSafari53747SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: tags/Safari-537.47/Source/WebCore/ChangeLog (152111 => 152112)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-537.47/Source/WebCore/ChangeLog        2013-06-27 17:45:17 UTC (rev 152111)
+++ tags/Safari-537.47/Source/WebCore/ChangeLog        2013-06-27 17:47:44 UTC (rev 152112)
</span><span class="lines">@@ -1,5 +1,26 @@
</span><span class="cx"> 2013-06-27  Lucas Forschler  &lt;lforschler@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r152004
+
+    2013-06-26  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+            Prepare CaptionUserPreferencesMac for use on Windows port.
+            https://bugs.webkit.org/show_bug.cgi?id=118069
+
+            Reviewed by Eric Carlson.
+
+            * WebCore.vcxproj/WebCore.vcxproj: Add new files.
+            * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
+            * WebCore.xcodeproj/project.pbxproj: Update for new file name.
+            * page/CaptionUserPreferencesMac.h: Removed.
+            * page/CaptionUserPreferencesMac.mm: Removed.
+            * page/CaptionUserPreferencesMediaAF.cpp: Copied from page/CaptionUserPreferencesMac.mm.
+            * page/CaptionUserPreferencesMediaAF.h: Copied from page/CaptionUserPreferencesMac.h.
+            * page/PageGroup.cpp:
+            (WebCore::PageGroup::captionPreferences): Updated to new class name.
+
+2013-06-27  Lucas Forschler  &lt;lforschler@apple.com&gt;
+
</ins><span class="cx">         Merge r151868
</span><span class="cx"> 
</span><span class="cx">     2013-06-21  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span></span></pre></div>
<a id="tagsSafari53747SourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: tags/Safari-537.47/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (152111 => 152112)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-537.47/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-06-27 17:45:17 UTC (rev 152111)
+++ tags/Safari-537.47/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-06-27 17:47:44 UTC (rev 152112)
</span><span class="lines">@@ -3898,6 +3898,14 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\AutoscrollController.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\BarProp.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\CaptionUserPreferences.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\page\CaptionUserPreferencesMediaAF.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\page\Chrome.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\animation\CompositeAnimation.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\Console.cpp&quot; /&gt;
</span><span class="lines">@@ -11319,6 +11327,8 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\animation\AnimationControllerPrivate.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\AutoscrollController.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\BarProp.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\page\CaptionUserPreferences.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\page\CaptionUserPreferencesMediaAF.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\page\Chrome.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\ChromeClient.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\animation\CompositeAnimation.h&quot; /&gt;
</span></span></pre></div>
<a id="tagsSafari53747SourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: tags/Safari-537.47/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (152111 => 152112)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-537.47/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2013-06-27 17:45:17 UTC (rev 152111)
+++ tags/Safari-537.47/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2013-06-27 17:47:44 UTC (rev 152112)
</span><span class="lines">@@ -6787,6 +6787,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\accessibility\AccessibilityNodeObject.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;accessibility&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\page\CaptionUserPreferencesMediaAF.cpp&quot;&gt;
+      &lt;Filter&gt;page&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">   &lt;/ItemGroup&gt;
</span><span class="cx">   &lt;ItemGroup&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\Modules\filesystem\AsyncFileWriter.h&quot;&gt;
</span><span class="lines">@@ -14249,6 +14252,12 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\accessibility\AccessibilityNodeObject.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;accessibility&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\page\CaptionUserPreferences.h&quot;&gt;
+      &lt;Filter&gt;page&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\page\CaptionUserPreferencesMediaAF.h&quot;&gt;
+      &lt;Filter&gt;page&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">   &lt;/ItemGroup&gt;
</span><span class="cx">   &lt;ItemGroup&gt;
</span><span class="cx">     &lt;None Include=&quot;..\css\CSSGrammar.y.in&quot;&gt;
</span></span></pre></div>
<a id="tagsSafari53747SourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: tags/Safari-537.47/Source/WebCore/WebCore.xcodeproj/project.pbxproj (152111 => 152112)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-537.47/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-06-27 17:45:17 UTC (rev 152111)
+++ tags/Safari-537.47/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-06-27 17:47:44 UTC (rev 152112)
</span><span class="lines">@@ -121,8 +121,8 @@
</span><span class="cx">                 07941792166E855F009416C2 /* InbandTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 07941790166E855F009416C2 /* InbandTextTrack.h */; };
</span><span class="cx">                 07941794166EA04E009416C2 /* InbandTextTrackPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07941793166EA04E009416C2 /* InbandTextTrackPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 079D0868162F20E800DB8658 /* CaptionUserPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 079D0867162F20E800DB8658 /* CaptionUserPreferences.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                079D086B162F21F900DB8658 /* CaptionUserPreferencesMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 079D0869162F21F900DB8658 /* CaptionUserPreferencesMac.h */; };
-                079D086C162F21F900DB8658 /* CaptionUserPreferencesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 079D086A162F21F900DB8658 /* CaptionUserPreferencesMac.mm */; };
</del><ins>+                079D086B162F21F900DB8658 /* CaptionUserPreferencesMediaAF.h in Headers */ = {isa = PBXBuildFile; fileRef = 079D0869162F21F900DB8658 /* CaptionUserPreferencesMediaAF.h */; };
+                079D086C162F21F900DB8658 /* CaptionUserPreferencesMediaAF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 079D086A162F21F900DB8658 /* CaptionUserPreferencesMediaAF.cpp */; };
</ins><span class="cx">                 07A6D1EB1491137700051D0C /* MediaFragmentURIParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07A6D1E91491137700051D0C /* MediaFragmentURIParser.cpp */; };
</span><span class="cx">                 07A6D1EC1491137700051D0C /* MediaFragmentURIParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 07A6D1EA1491137700051D0C /* MediaFragmentURIParser.h */; };
</span><span class="cx">                 07AA6B6B166D2C0700D45671 /* InbandTextTrackPrivateAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07AA6B6A166D019500D45671 /* InbandTextTrackPrivateAVFObjC.mm */; };
</span><span class="lines">@@ -6320,8 +6320,8 @@
</span><span class="cx">                 07941790166E855F009416C2 /* InbandTextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InbandTextTrack.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07941793166EA04E009416C2 /* InbandTextTrackPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InbandTextTrackPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 079D0867162F20E800DB8658 /* CaptionUserPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CaptionUserPreferences.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                079D0869162F21F900DB8658 /* CaptionUserPreferencesMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CaptionUserPreferencesMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                079D086A162F21F900DB8658 /* CaptionUserPreferencesMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CaptionUserPreferencesMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                079D0869162F21F900DB8658 /* CaptionUserPreferencesMediaAF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CaptionUserPreferencesMediaAF.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                079D086A162F21F900DB8658 /* CaptionUserPreferencesMediaAF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CaptionUserPreferencesMediaAF.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 079F5E4B0F3BEBEA005E0782 /* MediaPlayerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07A6D1E91491137700051D0C /* MediaFragmentURIParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaFragmentURIParser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07A6D1EA1491137700051D0C /* MediaFragmentURIParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaFragmentURIParser.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14659,8 +14659,8 @@
</span><span class="cx">                                 BC124EE60C2641CD009E2349 /* BarProp.idl */,
</span><span class="cx">                                 072CA86016CB4DC3008AE131 /* CaptionUserPreferences.cpp */,
</span><span class="cx">                                 079D0867162F20E800DB8658 /* CaptionUserPreferences.h */,
</span><del>-                                079D0869162F21F900DB8658 /* CaptionUserPreferencesMac.h */,
-                                079D086A162F21F900DB8658 /* CaptionUserPreferencesMac.mm */,
</del><ins>+                                079D0869162F21F900DB8658 /* CaptionUserPreferencesMediaAF.h */,
+                                079D086A162F21F900DB8658 /* CaptionUserPreferencesMediaAF.cpp */,
</ins><span class="cx">                                 14D8238A0AF92DF60004F057 /* Chrome.cpp */,
</span><span class="cx">                                 14D823500AF92A790004F057 /* Chrome.h */,
</span><span class="cx">                                 14D824060AF93AEB0004F057 /* ChromeClient.h */,
</span><span class="lines">@@ -21058,7 +21058,7 @@
</span><span class="cx">                                 49484FCB102CF23C00187DD3 /* CanvasRenderingContext2D.h in Headers */,
</span><span class="cx">                                 49484FCE102CF23C00187DD3 /* CanvasStyle.h in Headers */,
</span><span class="cx">                                 079D0868162F20E800DB8658 /* CaptionUserPreferences.h in Headers */,
</span><del>-                                079D086B162F21F900DB8658 /* CaptionUserPreferencesMac.h in Headers */,
</del><ins>+                                079D086B162F21F900DB8658 /* CaptionUserPreferencesMediaAF.h in Headers */,
</ins><span class="cx">                                 6550B69E099DF0270090D781 /* CDATASection.h in Headers */,
</span><span class="cx">                                 FE36FD1516C7826500F887C1 /* ChangeVersionData.h in Headers */,
</span><span class="cx">                                 97BC69DD1505F076001B74AC /* ChangeVersionWrapper.h in Headers */,
</span><span class="lines">@@ -24496,7 +24496,7 @@
</span><span class="cx">                                 49484FCA102CF23C00187DD3 /* CanvasRenderingContext2D.cpp in Sources */,
</span><span class="cx">                                 49484FCD102CF23C00187DD3 /* CanvasStyle.cpp in Sources */,
</span><span class="cx">                                 072CA86116CB4DC3008AE131 /* CaptionUserPreferences.cpp in Sources */,
</span><del>-                                079D086C162F21F900DB8658 /* CaptionUserPreferencesMac.mm in Sources */,
</del><ins>+                                079D086C162F21F900DB8658 /* CaptionUserPreferencesMediaAF.cpp in Sources */,
</ins><span class="cx">                                 6550B69D099DF0270090D781 /* CDATASection.cpp in Sources */,
</span><span class="cx">                                 CDA98E0B1603CD6000FEA3B1 /* CDM.cpp in Sources */,
</span><span class="cx">                                 CD47B3FC16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm in Sources */,
</span></span></pre></div>
<a id="tagsSafari53747SourceWebCorepageCaptionUserPreferencesMach"></a>
<div class="delfile"><h4>Deleted: tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMac.h (152111 => 152112)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMac.h        2013-06-27 17:45:17 UTC (rev 152111)
+++ tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMac.h        2013-06-27 17:47:44 UTC (rev 152112)
</span><span class="lines">@@ -1,91 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef CaptionUserPreferencesMac_h
-#define CaptionUserPreferencesMac_h
-
-#if ENABLE(VIDEO_TRACK)
-
-#include &quot;CSSPropertyNames.h&quot;
-#include &quot;CaptionUserPreferences.h&quot;
-#include &quot;Color.h&quot;
-#include &lt;wtf/HashSet.h&gt;
-
-namespace WebCore {
-
-class CaptionUserPreferencesMac : public CaptionUserPreferences {
-public:
-    static PassOwnPtr&lt;CaptionUserPreferencesMac&gt; create(PageGroup* group) { return adoptPtr(new CaptionUserPreferencesMac(group)); }
-    virtual ~CaptionUserPreferencesMac();
-
-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-    virtual CaptionDisplayMode captionDisplayMode() const OVERRIDE;
-    virtual void setCaptionDisplayMode(CaptionDisplayMode) OVERRIDE;
-
-    virtual bool userPrefersCaptions() const OVERRIDE;
-    virtual bool userPrefersSubtitles() const OVERRIDE;
-    
-    virtual float captionFontSizeScaleAndImportance(bool&amp;) const OVERRIDE;
-
-    virtual void setInterestedInCaptionPreferenceChanges() OVERRIDE;
-
-    virtual void setPreferredLanguage(const String&amp;) OVERRIDE;
-    virtual Vector&lt;String&gt; preferredLanguages() const OVERRIDE;
-
-    virtual void captionPreferencesChanged() OVERRIDE;
-
-    bool shouldFilterTrackMenu() const { return true; }
-#else
-    bool shouldFilterTrackMenu() const { return false; }
-#endif
-
-    virtual String captionsStyleSheetOverride() const OVERRIDE;
-    virtual int textTrackSelectionScore(TextTrack*, HTMLMediaElement*) const OVERRIDE;
-    virtual Vector&lt;RefPtr&lt;TextTrack&gt; &gt; sortedTrackListForMenu(TextTrackList*) OVERRIDE;
-    virtual String displayNameForTrack(TextTrack*) const OVERRIDE;
-
-private:
-    CaptionUserPreferencesMac(PageGroup*);
-
-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-    String captionsWindowCSS() const;
-    String captionsBackgroundCSS() const;
-    String captionsTextColorCSS() const;
-    Color captionsTextColor(bool&amp;) const;
-    String captionsDefaultFontCSS() const;
-    Color captionsEdgeColorForTextColor(const Color&amp;) const;
-    String windowRoundedCornerRadiusCSS() const;
-    String captionsTextEdgeCSS() const;
-    String cssPropertyWithTextEdgeColor(CSSPropertyID, const String&amp;, const Color&amp;, bool) const;
-    String colorPropertyCSS(CSSPropertyID, const Color&amp;, bool) const;
-
-    bool m_listeningForPreferenceChanges;
-#endif
-};
-    
-}
-#endif
-
-#endif
</del></span></pre></div>
<a id="tagsSafari53747SourceWebCorepageCaptionUserPreferencesMacmm"></a>
<div class="delfile"><h4>Deleted: tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMac.mm (152111 => 152112)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMac.mm        2013-06-27 17:45:17 UTC (rev 152111)
+++ tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMac.mm        2013-06-27 17:47:44 UTC (rev 152112)
</span><span class="lines">@@ -1,802 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#import &quot;config.h&quot;
-
-#if ENABLE(VIDEO_TRACK)
-
-#import &quot;CaptionUserPreferencesMac.h&quot;
-
-#import &quot;ColorMac.h&quot;
-#import &quot;CoreText/CoreText.h&quot;
-#import &quot;DOMWrapperWorld.h&quot;
-#import &quot;FloatConversion.h&quot;
-#import &quot;HTMLMediaElement.h&quot;
-#import &quot;KURL.h&quot;
-#import &quot;Language.h&quot;
-#import &quot;LocalizedStrings.h&quot;
-#import &quot;Logging.h&quot;
-#import &quot;MediaControlElements.h&quot;
-#import &quot;PageGroup.h&quot;
-#import &quot;SoftLinking.h&quot;
-#import &quot;TextTrackCue.h&quot;
-#import &quot;TextTrackList.h&quot;
-#import &quot;UserStyleSheetTypes.h&quot;
-#import &lt;wtf/NonCopyingSort.h&gt;
-#import &lt;wtf/RetainPtr.h&gt;
-#import &lt;wtf/text/StringBuilder.h&gt;
-
-#if PLATFORM(IOS)
-#import &quot;WebCoreThreadRun.h&quot;
-#endif
-
-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-#import &quot;MediaAccessibility/MediaAccessibility.h&quot;
-#endif
-
-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-
-SOFT_LINK_FRAMEWORK_OPTIONAL(MediaAccessibility)
-
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetDisplayType, MACaptionAppearanceDisplayType, (MACaptionAppearanceDomain domain), (domain))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceSetDisplayType, void, (MACaptionAppearanceDomain domain, MACaptionAppearanceDisplayType displayType), (domain, displayType))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopyForegroundColor, CGColorRef, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopyBackgroundColor, CGColorRef, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopyWindowColor, CGColorRef, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetForegroundOpacity, CGFloat, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetBackgroundOpacity, CGFloat, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetWindowOpacity, CGFloat, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetWindowRoundedCornerRadius, CGFloat, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopyFontDescriptorForStyle, CTFontDescriptorRef, (MACaptionAppearanceDomain domain,  MACaptionAppearanceBehavior *behavior, MACaptionAppearanceFontStyle fontStyle), (domain, behavior, fontStyle))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetRelativeCharacterSize, CGFloat, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetTextEdgeStyle, MACaptionAppearanceTextEdgeStyle, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceAddSelectedLanguage, bool, (MACaptionAppearanceDomain domain, CFStringRef language), (domain, language));
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopySelectedLanguages, CFArrayRef, (MACaptionAppearanceDomain domain), (domain));
-SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics,  CFArrayRef, (MACaptionAppearanceDomain domain), (domain));
-
-SOFT_LINK_POINTER(MediaAccessibility, kMAXCaptionAppearanceSettingsChangedNotification, CFStringRef)
-#define kMAXCaptionAppearanceSettingsChangedNotification getkMAXCaptionAppearanceSettingsChangedNotification()
-
-#endif
-
-using namespace std;
-
-namespace WebCore {
-
-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-static void userCaptionPreferencesChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void *, CFDictionaryRef)
-{
-#if !PLATFORM(IOS)
-    static_cast&lt;CaptionUserPreferencesMac*&gt;(observer)-&gt;captionPreferencesChanged();
-#else
-    WebThreadRun(^{
-        static_cast&lt;CaptionUserPreferencesMac*&gt;(observer)-&gt;captionPreferencesChanged();
-    });
-#endif
-}
-#endif
-
-CaptionUserPreferencesMac::CaptionUserPreferencesMac(PageGroup* group)
-    : CaptionUserPreferences(group)
-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-    , m_listeningForPreferenceChanges(false)
-#endif
-{
-}
-
-CaptionUserPreferencesMac::~CaptionUserPreferencesMac()
-{
-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-    if (kMAXCaptionAppearanceSettingsChangedNotification)
-        CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(), this, kMAXCaptionAppearanceSettingsChangedNotification, NULL);
-#endif
-}
-
-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-
-CaptionUserPreferences::CaptionDisplayMode CaptionUserPreferencesMac::captionDisplayMode() const
-{
-    if (testingMode() || !MediaAccessibilityLibrary())
-        return CaptionUserPreferences::captionDisplayMode();
-
-    MACaptionAppearanceDisplayType displayType = MACaptionAppearanceGetDisplayType(kMACaptionAppearanceDomainUser);
-    switch (displayType) {
-    case kMACaptionAppearanceDisplayTypeForcedOnly:
-        return ForcedOnly;
-        break;
-
-    case kMACaptionAppearanceDisplayTypeAutomatic:
-        return Automatic;
-        break;
-
-    case kMACaptionAppearanceDisplayTypeAlwaysOn:
-        return AlwaysOn;
-        break;
-    }
-
-    ASSERT_NOT_REACHED();
-    return ForcedOnly;
-}
-    
-void CaptionUserPreferencesMac::setCaptionDisplayMode(CaptionUserPreferences::CaptionDisplayMode mode)
-{
-    if (testingMode() || !MediaAccessibilityLibrary()) {
-        CaptionUserPreferences::setCaptionDisplayMode(mode);
-        return;
-    }
-
-    MACaptionAppearanceDisplayType displayType = kMACaptionAppearanceDisplayTypeForcedOnly;
-    switch (mode) {
-        case Automatic:
-            displayType = kMACaptionAppearanceDisplayTypeAutomatic;
-            break;
-        case ForcedOnly:
-            displayType = kMACaptionAppearanceDisplayTypeForcedOnly;
-            break;
-        case AlwaysOn:
-            displayType = kMACaptionAppearanceDisplayTypeAlwaysOn;
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-            break;
-    }
-
-    MACaptionAppearanceSetDisplayType(kMACaptionAppearanceDomainUser, displayType);
-}
-
-bool CaptionUserPreferencesMac::userPrefersCaptions() const
-{
-    bool captionSetting = CaptionUserPreferences::userPrefersCaptions();
-    if (captionSetting || testingMode() || !MediaAccessibilityLibrary())
-        return captionSetting;
-    
-    RetainPtr&lt;CFArrayRef&gt; captioningMediaCharacteristics = adoptCF(MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(kMACaptionAppearanceDomainUser));
-    return captioningMediaCharacteristics &amp;&amp; CFArrayGetCount(captioningMediaCharacteristics.get());
-}
-
-bool CaptionUserPreferencesMac::userPrefersSubtitles() const
-{
-    bool subtitlesSetting = CaptionUserPreferences::userPrefersSubtitles();
-    if (subtitlesSetting || testingMode() || !MediaAccessibilityLibrary())
-        return subtitlesSetting;
-    
-    RetainPtr&lt;CFArrayRef&gt; captioningMediaCharacteristics = adoptCF(MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(kMACaptionAppearanceDomainUser));
-    return !(captioningMediaCharacteristics &amp;&amp; CFArrayGetCount(captioningMediaCharacteristics.get()));
-}
-
-void CaptionUserPreferencesMac::setInterestedInCaptionPreferenceChanges()
-{
-    if (!MediaAccessibilityLibrary())
-        return;
-
-    if (!kMAXCaptionAppearanceSettingsChangedNotification)
-        return;
-
-    if (!m_listeningForPreferenceChanges) {
-        m_listeningForPreferenceChanges = true;
-        CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, userCaptionPreferencesChangedNotificationCallback, kMAXCaptionAppearanceSettingsChangedNotification, NULL, CFNotificationSuspensionBehaviorCoalesce);
-    }
-    
-    updateCaptionStyleSheetOveride();
-}
-
-void CaptionUserPreferencesMac::captionPreferencesChanged()
-{
-    if (m_listeningForPreferenceChanges)
-        updateCaptionStyleSheetOveride();
-
-    CaptionUserPreferences::captionPreferencesChanged();
-}
-
-String CaptionUserPreferencesMac::captionsWindowCSS() const
-{
-    MACaptionAppearanceBehavior behavior;
-    RetainPtr&lt;CGColorRef&gt; color = adoptCF(MACaptionAppearanceCopyWindowColor(kMACaptionAppearanceDomainUser, &amp;behavior));
-
-    Color windowColor(color.get());
-    if (!windowColor.isValid())
-        windowColor = Color::transparent;
-
-    bool important = behavior == kMACaptionAppearanceBehaviorUseValue;
-    CGFloat opacity = MACaptionAppearanceGetWindowOpacity(kMACaptionAppearanceDomainUser, &amp;behavior);
-    if (!important)
-        important = behavior == kMACaptionAppearanceBehaviorUseValue;
-    String windowStyle = colorPropertyCSS(CSSPropertyBackgroundColor, Color(windowColor.red(), windowColor.green(), windowColor.blue(), static_cast&lt;int&gt;(opacity * 255)), important);
-
-    if (!opacity)
-        return windowStyle;
-
-    StringBuilder builder;
-    builder.append(windowStyle);
-    builder.append(getPropertyNameString(CSSPropertyPadding));
-    builder.append(&quot;: .4em !important;&quot;);
-
-    return builder.toString();
-}
-
-String CaptionUserPreferencesMac::captionsBackgroundCSS() const
-{
-    // This default value must be the same as the one specified in mediaControls.css for -webkit-media-text-track-past-nodes
-    // and webkit-media-text-track-future-nodes.
-    DEFINE_STATIC_LOCAL(Color, defaultBackgroundColor, (Color(0, 0, 0, 0.8 * 255)));
-
-    MACaptionAppearanceBehavior behavior;
-
-    RetainPtr&lt;CGColorRef&gt; color = adoptCF(MACaptionAppearanceCopyBackgroundColor(kMACaptionAppearanceDomainUser, &amp;behavior));
-    Color backgroundColor(color.get());
-    if (!backgroundColor.isValid())
-        backgroundColor = defaultBackgroundColor;
-
-    bool important = behavior == kMACaptionAppearanceBehaviorUseValue;
-    CGFloat opacity = MACaptionAppearanceGetBackgroundOpacity(kMACaptionAppearanceDomainUser, &amp;behavior);
-    if (!important)
-        important = behavior == kMACaptionAppearanceBehaviorUseValue;
-    return colorPropertyCSS(CSSPropertyBackgroundColor, Color(backgroundColor.red(), backgroundColor.green(), backgroundColor.blue(), static_cast&lt;int&gt;(opacity * 255)), important);
-}
-
-Color CaptionUserPreferencesMac::captionsTextColor(bool&amp; important) const
-{
-    MACaptionAppearanceBehavior behavior;
-    RetainPtr&lt;CGColorRef&gt; color = adoptCF(MACaptionAppearanceCopyForegroundColor(kMACaptionAppearanceDomainUser, &amp;behavior));
-    Color textColor(color.get());
-    if (!textColor.isValid())
-        // This default value must be the same as the one specified in mediaControls.css for -webkit-media-text-track-container.
-        textColor = Color::white;
-    
-    important = behavior == kMACaptionAppearanceBehaviorUseValue;
-    CGFloat opacity = MACaptionAppearanceGetForegroundOpacity(kMACaptionAppearanceDomainUser, &amp;behavior);
-    if (!important)
-        important = behavior == kMACaptionAppearanceBehaviorUseValue;
-    return Color(textColor.red(), textColor.green(), textColor.blue(), static_cast&lt;int&gt;(opacity * 255));
-}
-    
-String CaptionUserPreferencesMac::captionsTextColorCSS() const
-{
-    bool important;
-    Color textColor = captionsTextColor(important);
-
-    if (!textColor.isValid())
-        return emptyString();
-
-    return colorPropertyCSS(CSSPropertyColor, textColor, important);
-}
-    
-String CaptionUserPreferencesMac::windowRoundedCornerRadiusCSS() const
-{
-    MACaptionAppearanceBehavior behavior;
-    CGFloat radius = MACaptionAppearanceGetWindowRoundedCornerRadius(kMACaptionAppearanceDomainUser, &amp;behavior);
-    if (!radius)
-        return emptyString();
-
-    StringBuilder builder;
-    builder.append(getPropertyNameString(CSSPropertyBorderRadius));
-    builder.append(String::format(&quot;:%.02fpx&quot;, radius));
-    if (behavior == kMACaptionAppearanceBehaviorUseValue)
-        builder.append(&quot; !important&quot;);
-    builder.append(';');
-
-    return builder.toString();
-}
-    
-Color CaptionUserPreferencesMac::captionsEdgeColorForTextColor(const Color&amp; textColor) const
-{
-    int distanceFromWhite = differenceSquared(textColor, Color::white);
-    int distanceFromBlack = differenceSquared(textColor, Color::black);
-    
-    if (distanceFromWhite &lt; distanceFromBlack)
-        return textColor.dark();
-    
-    return textColor.light();
-}
-
-String CaptionUserPreferencesMac::cssPropertyWithTextEdgeColor(CSSPropertyID id, const String&amp; value, const Color&amp; textColor, bool important) const
-{
-    StringBuilder builder;
-    
-    builder.append(getPropertyNameString(id));
-    builder.append(':');
-    builder.append(value);
-    builder.append(' ');
-    builder.append(captionsEdgeColorForTextColor(textColor).serialized());
-    if (important)
-        builder.append(&quot; !important&quot;);
-    builder.append(';');
-    
-    return builder.toString();
-}
-
-String CaptionUserPreferencesMac::colorPropertyCSS(CSSPropertyID id, const Color&amp; color, bool important) const
-{
-    StringBuilder builder;
-    
-    builder.append(getPropertyNameString(id));
-    builder.append(':');
-    builder.append(color.serialized());
-    if (important)
-        builder.append(&quot; !important&quot;);
-    builder.append(';');
-    
-    return builder.toString();
-}
-
-String CaptionUserPreferencesMac::captionsTextEdgeCSS() const
-{
-    DEFINE_STATIC_LOCAL(const String, edgeStyleRaised, (&quot; -.05em -.05em 0 &quot;, String::ConstructFromLiteral));
-    DEFINE_STATIC_LOCAL(const String, edgeStyleDepressed, (&quot; .05em .05em 0 &quot;, String::ConstructFromLiteral));
-    DEFINE_STATIC_LOCAL(const String, edgeStyleDropShadow, (&quot; .075em .075em 0 &quot;, String::ConstructFromLiteral));
-    DEFINE_STATIC_LOCAL(const String, edgeStyleUniform, (&quot; .03em &quot;, String::ConstructFromLiteral));
-
-    bool unused;
-    Color color = captionsTextColor(unused);
-    if (!color.isValid())
-        color.setNamedColor(&quot;black&quot;);
-    color = captionsEdgeColorForTextColor(color);
-
-    MACaptionAppearanceBehavior behavior;
-    MACaptionAppearanceTextEdgeStyle textEdgeStyle = MACaptionAppearanceGetTextEdgeStyle(kMACaptionAppearanceDomainUser, &amp;behavior);
-    switch (textEdgeStyle) {
-        case kMACaptionAppearanceTextEdgeStyleUndefined:
-        case kMACaptionAppearanceTextEdgeStyleNone:
-            return emptyString();
-            
-        case kMACaptionAppearanceTextEdgeStyleRaised:
-            return cssPropertyWithTextEdgeColor(CSSPropertyTextShadow, edgeStyleRaised, color, behavior == kMACaptionAppearanceBehaviorUseValue);
-        case kMACaptionAppearanceTextEdgeStyleDepressed:
-            return cssPropertyWithTextEdgeColor(CSSPropertyTextShadow, edgeStyleDepressed, color, behavior == kMACaptionAppearanceBehaviorUseValue);
-        case kMACaptionAppearanceTextEdgeStyleDropShadow:
-            return cssPropertyWithTextEdgeColor(CSSPropertyTextShadow, edgeStyleDropShadow, color, behavior == kMACaptionAppearanceBehaviorUseValue);
-        case kMACaptionAppearanceTextEdgeStyleUniform:
-            return cssPropertyWithTextEdgeColor(CSSPropertyWebkitTextStroke, edgeStyleUniform, color, behavior == kMACaptionAppearanceBehaviorUseValue);
-            
-        default:
-            ASSERT_NOT_REACHED();
-            break;
-    }
-    
-    return emptyString();
-}
-
-String CaptionUserPreferencesMac::captionsDefaultFontCSS() const
-{
-    MACaptionAppearanceBehavior behavior;
-    
-    RetainPtr&lt;CTFontDescriptorRef&gt; font = adoptCF(MACaptionAppearanceCopyFontDescriptorForStyle(kMACaptionAppearanceDomainUser, &amp;behavior, kMACaptionAppearanceFontStyleDefault));
-    if (!font)
-        return emptyString();
-
-    RetainPtr&lt;CFTypeRef&gt; name = adoptCF(CTFontDescriptorCopyAttribute(font.get(), kCTFontNameAttribute));
-    if (!name)
-        return emptyString();
-    
-    StringBuilder builder;
-    
-    builder.append(getPropertyNameString(CSSPropertyFontFamily));
-    builder.append(&quot;: \&quot;&quot;);
-    builder.append(static_cast&lt;CFStringRef&gt;(name.get()));
-    builder.append('&quot;');
-    if (behavior == kMACaptionAppearanceBehaviorUseValue)
-        builder.append(&quot; !important&quot;);
-    builder.append(';');
-    
-    return builder.toString();
-}
-
-float CaptionUserPreferencesMac::captionFontSizeScaleAndImportance(bool&amp; important) const
-{
-    if (testingMode() || !MediaAccessibilityLibrary())
-        return CaptionUserPreferences::captionFontSizeScaleAndImportance(important);
-
-    MACaptionAppearanceBehavior behavior;
-    CGFloat characterScale = CaptionUserPreferences::captionFontSizeScaleAndImportance(important);
-    CGFloat scaleAdjustment = MACaptionAppearanceGetRelativeCharacterSize(kMACaptionAppearanceDomainUser, &amp;behavior);
-
-    if (!scaleAdjustment)
-        return characterScale;
-
-    important = behavior == kMACaptionAppearanceBehaviorUseValue;
-#if defined(__LP64__) &amp;&amp; __LP64__
-    return narrowPrecisionToFloat(scaleAdjustment * characterScale);
-#else
-    return scaleAdjustment * characterScale;
-#endif
-}
-
-void CaptionUserPreferencesMac::setPreferredLanguage(const String&amp; language)
-{
-    if (testingMode() || !MediaAccessibilityLibrary()) {
-        CaptionUserPreferences::setPreferredLanguage(language);
-        return;
-    }
-
-    MACaptionAppearanceAddSelectedLanguage(kMACaptionAppearanceDomainUser, language.createCFString().get());
-}
-
-Vector&lt;String&gt; CaptionUserPreferencesMac::preferredLanguages() const
-{
-    if (testingMode() || !MediaAccessibilityLibrary())
-        return CaptionUserPreferences::preferredLanguages();
-
-    Vector&lt;String&gt; platformLanguages = platformUserPreferredLanguages();
-    Vector&lt;String&gt; override = userPreferredLanguagesOverride();
-    if (!override.isEmpty()) {
-        if (platformLanguages.size() != override.size())
-            return override;
-        for (size_t i = 0; i &lt; override.size(); i++) {
-            if (override[i] != platformLanguages[i])
-                return override;
-        }
-    }
-
-    CFIndex languageCount = 0;
-    RetainPtr&lt;CFArrayRef&gt; languages = adoptCF(MACaptionAppearanceCopySelectedLanguages(kMACaptionAppearanceDomainUser));
-    if (languages)
-        languageCount = CFArrayGetCount(languages.get());
-
-    if (!languageCount)
-        return CaptionUserPreferences::preferredLanguages();
-
-    Vector&lt;String&gt; userPreferredLanguages;
-    userPreferredLanguages.reserveCapacity(languageCount + platformLanguages.size());
-    for (CFIndex i = 0; i &lt; languageCount; i++)
-        userPreferredLanguages.append(static_cast&lt;CFStringRef&gt;(CFArrayGetValueAtIndex(languages.get(), i)));
-
-    userPreferredLanguages.appendVector(platformLanguages);
-
-    return userPreferredLanguages;
-}
-#endif  // HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-
-String CaptionUserPreferencesMac::captionsStyleSheetOverride() const
-{
-    if (testingMode())
-        return CaptionUserPreferences::captionsStyleSheetOverride();
-    
-    StringBuilder captionsOverrideStyleSheet;
-
-#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-    if (!MediaAccessibilityLibrary())
-        return CaptionUserPreferences::captionsStyleSheetOverride();
-    
-    String captionsColor = captionsTextColorCSS();
-    String edgeStyle = captionsTextEdgeCSS();
-    String fontName = captionsDefaultFontCSS();
-    String background = captionsBackgroundCSS();
-    if (!background.isEmpty() || !captionsColor.isEmpty() || !edgeStyle.isEmpty() || !fontName.isEmpty()) {
-        captionsOverrideStyleSheet.append(&quot; video::&quot;);
-        captionsOverrideStyleSheet.append(TextTrackCue::cueShadowPseudoId());
-        captionsOverrideStyleSheet.append('{');
-        
-        if (!background.isEmpty())
-            captionsOverrideStyleSheet.append(background);
-        if (!captionsColor.isEmpty())
-            captionsOverrideStyleSheet.append(captionsColor);
-        if (!edgeStyle.isEmpty())
-            captionsOverrideStyleSheet.append(edgeStyle);
-        if (!fontName.isEmpty())
-            captionsOverrideStyleSheet.append(fontName);
-        
-        captionsOverrideStyleSheet.append('}');
-    }
-    
-    String windowColor = captionsWindowCSS();
-    String windowCornerRadius = windowRoundedCornerRadiusCSS();
-    if (!windowColor.isEmpty() || !windowCornerRadius.isEmpty()) {
-        captionsOverrideStyleSheet.append(&quot; video::&quot;);
-        captionsOverrideStyleSheet.append(TextTrackCueBox::textTrackCueBoxShadowPseudoId());
-        captionsOverrideStyleSheet.append('{');
-        
-        if (!windowColor.isEmpty())
-            captionsOverrideStyleSheet.append(windowColor);
-        if (!windowCornerRadius.isEmpty())
-            captionsOverrideStyleSheet.append(windowCornerRadius);
-        
-        captionsOverrideStyleSheet.append('}');
-    }
-#endif  // HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
-
-    LOG(Media, &quot;CaptionUserPreferencesMac::captionsStyleSheetOverrideSetting sytle to:\n%s&quot;, captionsOverrideStyleSheet.toString().utf8().data());
-
-    return captionsOverrideStyleSheet.toString();
-}
-
-static String languageIdentifier(const String&amp; languageCode)
-{
-    if (languageCode.isEmpty())
-        return languageCode;
-
-    String lowercaseLanguageCode = languageCode.lower();
-
-    // Need 2U here to disambiguate String::operator[] from operator(NSString*, int)[] in a production build.
-    if (lowercaseLanguageCode.length() &gt;= 3 &amp;&amp; (lowercaseLanguageCode[2U] == '_' || lowercaseLanguageCode[2U] == '-'))
-        lowercaseLanguageCode.truncate(2);
-
-    return lowercaseLanguageCode;
-}
-
-static String trackDisplayName(TextTrack* track)
-{
-    if (track == TextTrack::captionMenuOffItem())
-        return textTrackOffMenuItemText();
-    if (track == TextTrack::captionMenuAutomaticItem())
-        return textTrackAutomaticMenuItemText();
-
-    StringBuilder displayName;
-    String label = track-&gt;label();
-    String trackLanguageIdentifier = track-&gt;language();
-
-    RetainPtr&lt;CFLocaleRef&gt; currentLocale = adoptCF(CFLocaleCopyCurrent());
-    RetainPtr&lt;CFStringRef&gt; localeIdentifier = adoptCF(CFLocaleCreateCanonicalLocaleIdentifierFromString(kCFAllocatorDefault, trackLanguageIdentifier.createCFString().get()));
-    RetainPtr&lt;CFStringRef&gt; languageCF = adoptCF(CFLocaleCopyDisplayNameForPropertyValue(currentLocale.get(), kCFLocaleLanguageCode, localeIdentifier.get()));
-    String language = languageCF.get();
-    if (!label.isEmpty()) {
-        if (language.isEmpty() || label.contains(language))
-            displayName.append(label);
-        else {
-            RetainPtr&lt;CFDictionaryRef&gt; localeDict = adoptCF(CFLocaleCreateComponentsFromLocaleIdentifier(kCFAllocatorDefault, localeIdentifier.get()));
-            if (localeDict) {
-                CFStringRef countryCode = 0;
-                String countryName;
-                
-                CFDictionaryGetValueIfPresent(localeDict.get(), kCFLocaleCountryCode, (const void **)&amp;countryCode);
-                if (countryCode) {
-                    RetainPtr&lt;CFStringRef&gt; countryNameCF = adoptCF(CFLocaleCopyDisplayNameForPropertyValue(currentLocale.get(), kCFLocaleCountryCode, countryCode));
-                    countryName = countryNameCF.get();
-                }
-                
-                if (!countryName.isEmpty())
-                    displayName.append(textTrackCountryAndLanguageMenuItemText(label, countryName, language));
-                else
-                    displayName.append(textTrackLanguageMenuItemText(label, language));
-            }
-        }
-    } else {
-        String languageAndLocale = CFLocaleCopyDisplayNameForPropertyValue(currentLocale.get(), kCFLocaleIdentifier, trackLanguageIdentifier.createCFString().get());
-        if (!languageAndLocale.isEmpty())
-            displayName.append(languageAndLocale);
-        else if (!language.isEmpty())
-            displayName.append(language);
-        else
-            displayName.append(localeIdentifier.get());
-    }
-    
-    if (displayName.isEmpty())
-        displayName.append(textTrackNoLabelText());
-    
-    if (track-&gt;isEasyToRead())
-        return easyReaderTrackMenuItemText(displayName.toString());
-    
-    if (track-&gt;isClosedCaptions())
-        return closedCaptionTrackMenuItemText(displayName.toString());
-
-    if (track-&gt;isSDH())
-        return sdhTrackMenuItemText(displayName.toString());
-
-    return displayName.toString();
-}
-
-String CaptionUserPreferencesMac::displayNameForTrack(TextTrack* track) const
-{
-    return trackDisplayName(track);
-}
-
-int CaptionUserPreferencesMac::textTrackSelectionScore(TextTrack* track, HTMLMediaElement* mediaElement) const
-{
-    CaptionDisplayMode displayMode = captionDisplayMode();
-    bool legacyOverride = mediaElement-&gt;webkitClosedCaptionsVisible();
-    if (displayMode == AlwaysOn &amp;&amp; (!userPrefersSubtitles() &amp;&amp; !userPrefersCaptions() &amp;&amp; !legacyOverride))
-        return 0;
-    if (track-&gt;kind() != TextTrack::captionsKeyword() &amp;&amp; track-&gt;kind() != TextTrack::subtitlesKeyword() &amp;&amp; track-&gt;kind() != TextTrack::forcedKeyword())
-        return 0;
-    if (!track-&gt;isMainProgramContent())
-        return 0;
-
-    bool trackHasOnlyForcedSubtitles = track-&gt;containsOnlyForcedSubtitles();
-    if (!legacyOverride &amp;&amp; ((trackHasOnlyForcedSubtitles &amp;&amp; displayMode != ForcedOnly) || (!trackHasOnlyForcedSubtitles &amp;&amp; displayMode == ForcedOnly)))
-        return 0;
-
-    Vector&lt;String&gt; userPreferredCaptionLanguages = preferredLanguages();
-
-    if (displayMode == Automatic || trackHasOnlyForcedSubtitles) {
-
-        if (!mediaElement || !mediaElement-&gt;player())
-            return 0;
-
-        String textTrackLanguage = track-&gt;language();
-        if (textTrackLanguage.isEmpty())
-            return 0;
-
-        Vector&lt;String&gt; languageList;
-        languageList.reserveCapacity(1);
-
-        String audioTrackLanguage;
-        if (testingMode())
-            audioTrackLanguage = primaryAudioTrackLanguageOverride();
-        else
-            audioTrackLanguage = mediaElement-&gt;player()-&gt;languageOfPrimaryAudioTrack();
-
-        if (audioTrackLanguage.isEmpty())
-            return 0;
-
-        if (trackHasOnlyForcedSubtitles) {
-            languageList.append(audioTrackLanguage);
-            size_t offset = indexOfBestMatchingLanguageInList(textTrackLanguage, languageList);
-
-            // Only consider a forced-only track if it IS in the same language as the primary audio track.
-            if (offset)
-                return 0;
-        } else {
-            languageList.append(defaultLanguage());
-
-            // Only enable a text track if the current audio track is NOT in the user's preferred language ...
-            size_t offset = indexOfBestMatchingLanguageInList(audioTrackLanguage, languageList);
-            if (!offset)
-                return 0;
-
-            // and the text track matches the user's preferred language.
-            offset = indexOfBestMatchingLanguageInList(textTrackLanguage, languageList);
-            if (offset)
-                return 0;
-        }
-
-        userPreferredCaptionLanguages = languageList;
-    }
-
-    int trackScore = 0;
-
-    if (userPrefersCaptions()) {
-        // When the user prefers accessiblity tracks, rank is SDH, then CC, then subtitles.
-        if (track-&gt;kind() == track-&gt;subtitlesKeyword())
-            trackScore = 1;
-        else if (track-&gt;isClosedCaptions())
-            trackScore = 2;
-        else
-            trackScore = 3;
-    } else {
-        // When the user prefers translation tracks, rank is subtitles, then SDH, then CC tracks.
-        if (track-&gt;kind() == track-&gt;subtitlesKeyword())
-            trackScore = 3;
-        else if (!track-&gt;isClosedCaptions())
-            trackScore = 2;
-        else
-            trackScore = 1;
-    }
-
-    return trackScore + textTrackLanguageSelectionScore(track, userPreferredCaptionLanguages);
-}
-
-static bool textTrackCompare(const RefPtr&lt;TextTrack&gt;&amp; a, const RefPtr&lt;TextTrack&gt;&amp; b)
-{
-    String preferredLanguageDisplayName = displayNameForLanguageLocale(languageIdentifier(defaultLanguage()));
-    String aLanguageDisplayName = displayNameForLanguageLocale(languageIdentifier(a-&gt;language()));
-    String bLanguageDisplayName = displayNameForLanguageLocale(languageIdentifier(b-&gt;language()));
-
-    // Tracks in the user's preferred language are always at the top of the menu.
-    bool aIsPreferredLanguage = !codePointCompare(aLanguageDisplayName, preferredLanguageDisplayName);
-    bool bIsPreferredLanguage = !codePointCompare(bLanguageDisplayName, preferredLanguageDisplayName);
-    if ((aIsPreferredLanguage || bIsPreferredLanguage) &amp;&amp; (aIsPreferredLanguage != bIsPreferredLanguage))
-        return aIsPreferredLanguage;
-
-    // Tracks not in the user's preferred language sort first by language ...
-    if (codePointCompare(aLanguageDisplayName, bLanguageDisplayName))
-        return codePointCompare(aLanguageDisplayName, bLanguageDisplayName) &lt; 0;
-
-    // ... but when tracks have the same language, main program content sorts next highest ...
-    bool aIsMainContent = a-&gt;isMainProgramContent();
-    bool bIsMainContent = b-&gt;isMainProgramContent();
-    if ((aIsMainContent || bIsMainContent) &amp;&amp; (aIsMainContent != bIsMainContent))
-        return aIsMainContent;
-
-    // ... and main program trakcs sort higher than CC tracks ...
-    bool aIsCC = a-&gt;isClosedCaptions();
-    bool bIsCC = b-&gt;isClosedCaptions();
-    if ((aIsCC || bIsCC) &amp;&amp; (aIsCC != bIsCC)) {
-        if (aIsCC)
-            return aIsMainContent;
-        return bIsMainContent;
-    }
-
-    // ... and tracks of the same type and language sort by the menu item text.
-    return codePointCompare(trackDisplayName(a.get()), trackDisplayName(b.get())) &lt; 0;
-}
-
-Vector&lt;RefPtr&lt;TextTrack&gt; &gt; CaptionUserPreferencesMac::sortedTrackListForMenu(TextTrackList* trackList)
-{
-    ASSERT(trackList);
-
-    Vector&lt;RefPtr&lt;TextTrack&gt; &gt; tracksForMenu;
-    HashSet&lt;String&gt; languagesIncluded;
-    bool prefersAccessibilityTracks = userPrefersCaptions();
-    bool filterTrackList = shouldFilterTrackMenu();
-
-    for (unsigned i = 0, length = trackList-&gt;length(); i &lt; length; ++i) {
-        TextTrack* track = trackList-&gt;item(i);
-        String language = displayNameForLanguageLocale(track-&gt;language());
-
-        if (track-&gt;containsOnlyForcedSubtitles())
-            continue;
-        
-        if (track-&gt;isEasyToRead()) {
-            if (!language.isEmpty())
-                languagesIncluded.add(language);
-            tracksForMenu.append(track);
-            continue;
-        }
-
-        if (!language.isEmpty() &amp;&amp; track-&gt;isMainProgramContent()) {
-            bool isAccessibilityTrack = track-&gt;kind() == track-&gt;captionsKeyword();
-            if (prefersAccessibilityTracks) {
-                // In the first pass, include only caption tracks if the user prefers accessibility tracks.
-                if (!isAccessibilityTrack &amp;&amp; filterTrackList) {
-                    LOG(Media, &quot;CaptionUserPreferencesMac::sortedTrackListForMenu - skipping '%s' track with language '%s' because it is NOT an accessibility track&quot;, track-&gt;kind().string().utf8().data(), language.utf8().data());
-                    continue;
-                }
-            } else {
-                // In the first pass, only include the first non-CC or SDH track with each language if the user prefers translation tracks.
-                if (isAccessibilityTrack &amp;&amp; filterTrackList) {
-                    LOG(Media, &quot;CaptionUserPreferencesMac::sortedTrackListForMenu - skipping '%s' track with language '%s' because it is an accessibility track&quot;, track-&gt;kind().string().utf8().data(), language.utf8().data());
-                    continue;
-                }
-                if (languagesIncluded.contains(language)  &amp;&amp; filterTrackList) {
-                    LOG(Media, &quot;CaptionUserPreferencesMac::sortedTrackListForMenu - skipping '%s' track with language '%s' because it is not the first with this language&quot;, track-&gt;kind().string().utf8().data(), language.utf8().data());
-                    continue;
-                }
-            }
-        }
-
-        if (!language.isEmpty())
-            languagesIncluded.add(language);
-        tracksForMenu.append(track);
-    }
-
-    // Now that we have filtered for the user's accessibility/translation preference, add  all tracks with a unique language without regard to track type.
-    for (unsigned i = 0, length = trackList-&gt;length(); i &lt; length; ++i) {
-        TextTrack* track = trackList-&gt;item(i);
-        String language = displayNameForLanguageLocale(track-&gt;language());
-
-        // All candidates with no languge were added the first time through.
-        if (language.isEmpty())
-            continue;
-
-        if (track-&gt;containsOnlyForcedSubtitles())
-            continue;

-        if (!languagesIncluded.contains(language) &amp;&amp; track-&gt;isMainProgramContent()) {
-            languagesIncluded.add(language);
-            tracksForMenu.append(track);
-            LOG(Media, &quot;CaptionUserPreferencesMac::sortedTrackListForMenu - adding '%s' track with language '%s' because it is the only track with this language&quot;, track-&gt;kind().string().utf8().data(), language.utf8().data());
-        }
-    }
-
-    nonCopyingSort(tracksForMenu.begin(), tracksForMenu.end(), textTrackCompare);
-
-    tracksForMenu.insert(0, TextTrack::captionMenuOffItem());
-    tracksForMenu.insert(1, TextTrack::captionMenuAutomaticItem());
-
-    return tracksForMenu;
-}
-    
-}
-
-#endif // ENABLE(VIDEO_TRACK)
</del></span></pre></div>
<a id="tagsSafari53747SourceWebCorepageCaptionUserPreferencesMediaAFcppfromrev152004trunkSourceWebCorepageCaptionUserPreferencesMediaAFcpp"></a>
<div class="copfile"><h4>Copied: tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp (from rev 152004, trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp) (0 => 152112)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp                                (rev 0)
+++ tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp        2013-06-27 17:47:44 UTC (rev 152112)
</span><span class="lines">@@ -0,0 +1,857 @@
</span><ins>+/*
+ * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+
+#if ENABLE(VIDEO_TRACK)
+
+#include &quot;CaptionUserPreferencesMediaAF.h&quot;
+
+#include &quot;CoreText/CoreText.h&quot;
+#include &quot;DOMWrapperWorld.h&quot;
+#include &quot;FloatConversion.h&quot;
+#include &quot;HTMLMediaElement.h&quot;
+#include &quot;KURL.h&quot;
+#include &quot;Language.h&quot;
+#include &quot;LocalizedStrings.h&quot;
+#include &quot;Logging.h&quot;
+#include &quot;MediaControlElements.h&quot;
+#include &quot;PageGroup.h&quot;
+#include &quot;SoftLinking.h&quot;
+#include &quot;TextTrackCue.h&quot;
+#include &quot;TextTrackList.h&quot;
+#include &quot;UserStyleSheetTypes.h&quot;
+#include &lt;wtf/NonCopyingSort.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/text/StringBuilder.h&gt;
+
+#if PLATFORM(IOS)
+#import &quot;WebCoreThreadRun.h&quot;
+#endif
+
+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+#include &quot;MediaAccessibility/MediaAccessibility.h&quot;
+#endif
+
+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+#if !PLATFORM(WIN)
+SOFT_LINK_FRAMEWORK_OPTIONAL(MediaAccessibility)
+
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetDisplayType, MACaptionAppearanceDisplayType, (MACaptionAppearanceDomain domain), (domain))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceSetDisplayType, void, (MACaptionAppearanceDomain domain, MACaptionAppearanceDisplayType displayType), (domain, displayType))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopyForegroundColor, CGColorRef, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopyBackgroundColor, CGColorRef, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopyWindowColor, CGColorRef, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetForegroundOpacity, CGFloat, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetBackgroundOpacity, CGFloat, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetWindowOpacity, CGFloat, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetWindowRoundedCornerRadius, CGFloat, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopyFontDescriptorForStyle, CTFontDescriptorRef, (MACaptionAppearanceDomain domain,  MACaptionAppearanceBehavior *behavior, MACaptionAppearanceFontStyle fontStyle), (domain, behavior, fontStyle))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetRelativeCharacterSize, CGFloat, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceGetTextEdgeStyle, MACaptionAppearanceTextEdgeStyle, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceAddSelectedLanguage, bool, (MACaptionAppearanceDomain domain, CFStringRef language), (domain, language));
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopySelectedLanguages, CFArrayRef, (MACaptionAppearanceDomain domain), (domain));
+SOFT_LINK(MediaAccessibility, MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics,  CFArrayRef, (MACaptionAppearanceDomain domain), (domain));
+
+SOFT_LINK_POINTER(MediaAccessibility, kMAXCaptionAppearanceSettingsChangedNotification, CFStringRef)
+#define kMAXCaptionAppearanceSettingsChangedNotification getkMAXCaptionAppearanceSettingsChangedNotification()
+
+#else
+SOFT_LINK_LIBRARY(MediaAccessibility)
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceGetDisplayType, MACaptionAppearanceDisplayType, __cdecl, (MACaptionAppearanceDomain domain), (domain))
+#define MACaptionAppearanceGetDisplayType softLink_MACaptionAppearanceGetDisplayType
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceSetDisplayType, void, __cdecl, (MACaptionAppearanceDomain domain, MACaptionAppearanceDisplayType displayType), (domain, displayType))
+#define MACaptionAppearanceSetDisplayType softLink_MACaptionAppearanceSetDisplayType
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceCopyForegroundColor, CGColorRef, __cdecl, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+#define MACaptionAppearanceCopyForegroundColor softLink_MACaptionAppearanceCopyForegroundColor
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceCopyBackgroundColor, CGColorRef, __cdecl, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+#define MACaptionAppearanceCopyBackgroundColor softLink_MACaptionAppearanceCopyBackgroundColor
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceCopyWindowColor, CGColorRef, __cdecl, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+#define MACaptionAppearanceCopyWindowColor softLink_MACaptionAppearanceCopyWindowColor
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceGetForegroundOpacity, CGFloat, __cdecl, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+#define MACaptionAppearanceGetForegroundOpacity softLink_MACaptionAppearanceGetForegroundOpacity
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceGetBackgroundOpacity, CGFloat, __cdecl, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+#define MACaptionAppearanceGetBackgroundOpacity softLink_MACaptionAppearanceGetBackgroundOpacity
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceGetWindowOpacity, CGFloat, __cdecl, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+#define MACaptionAppearanceGetWindowOpacity softLink_MACaptionAppearanceGetWindowOpacity
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceGetWindowRoundedCornerRadius, CGFloat, __cdecl, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+#define MACaptionAppearanceGetWindowRoundedCornerRadius softLink_MACaptionAppearanceGetWindowRoundedCornerRadius
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceCopyFontDescriptorForStyle, CTFontDescriptorRef, __cdecl, (MACaptionAppearanceDomain domain,  MACaptionAppearanceBehavior *behavior, MACaptionAppearanceFontStyle fontStyle), (domain, behavior, fontStyle))
+#define MACaptionAppearanceCopyFontDescriptorForStyle softLink_MACaptionAppearanceCopyFontDescriptorForStyle
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceGetRelativeCharacterSize, CGFloat, __cdecl, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+#define MACaptionAppearanceGetRelativeCharacterSize softLink_MACaptionAppearanceGetRelativeCharacterSize
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceGetTextEdgeStyle, MACaptionAppearanceTextEdgeStyle, __cdecl, (MACaptionAppearanceDomain domain, MACaptionAppearanceBehavior *behavior), (domain, behavior))
+#define MACaptionAppearanceGetTextEdgeStyle softLink_MACaptionAppearanceGetTextEdgeStyle
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceAddSelectedLanguage, bool, __cdecl, (MACaptionAppearanceDomain domain, CFStringRef language), (domain, language));
+#define MACaptionAppearanceAddSelectedLanguage softLink_MACaptionAppearanceAddSelectedLanguage
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceCopySelectedLanguages, CFArrayRef, __cdecl, (MACaptionAppearanceDomain domain), (domain));
+#define MACaptionAppearanceCopySelectedLanguages softLink_MACaptionAppearanceCopySelectedLanguages
+
+SOFT_LINK_DLL_IMPORT(MediaAccessibility, MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics,  CFArrayRef, __cdecl, (MACaptionAppearanceDomain domain), (domain));
+#define MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics softLink_MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics
+
+SOFT_LINK_VARIABLE_DLL_IMPORT(MediaAccessibility, kMAXCaptionAppearanceSettingsChangedNotification, CFStringRef)
+#define kMAXCaptionAppearanceSettingsChangedNotification get_kMAXCaptionAppearanceSettingsChangedNotification()
+
+SOFT_LINK_LIBRARY(CoreText)
+
+
+#endif
+
+#endif
+
+using namespace std;
+
+namespace WebCore {
+
+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+static void userCaptionPreferencesChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void *, CFDictionaryRef)
+{
+#if !PLATFORM(IOS)
+    static_cast&lt;CaptionUserPreferencesMediaAF*&gt;(observer)-&gt;captionPreferencesChanged();
+#else
+    WebThreadRun(^{
+        static_cast&lt;CaptionUserPreferencesMediaAF*&gt;(observer)-&gt;captionPreferencesChanged();
+    });
+#endif
+}
+#endif
+
+CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF(PageGroup* group)
+    : CaptionUserPreferences(group)
+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+    , m_listeningForPreferenceChanges(false)
+#endif
+{
+}
+
+CaptionUserPreferencesMediaAF::~CaptionUserPreferencesMediaAF()
+{
+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+    if (kMAXCaptionAppearanceSettingsChangedNotification)
+        CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(), this, kMAXCaptionAppearanceSettingsChangedNotification, 0);
+#endif
+}
+
+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+
+CaptionUserPreferences::CaptionDisplayMode CaptionUserPreferencesMediaAF::captionDisplayMode() const
+{
+    if (testingMode() || !MediaAccessibilityLibrary())
+        return CaptionUserPreferences::captionDisplayMode();
+
+    MACaptionAppearanceDisplayType displayType = MACaptionAppearanceGetDisplayType(kMACaptionAppearanceDomainUser);
+    switch (displayType) {
+    case kMACaptionAppearanceDisplayTypeForcedOnly:
+        return ForcedOnly;
+        break;
+
+    case kMACaptionAppearanceDisplayTypeAutomatic:
+        return Automatic;
+        break;
+
+    case kMACaptionAppearanceDisplayTypeAlwaysOn:
+        return AlwaysOn;
+        break;
+    }
+
+    ASSERT_NOT_REACHED();
+    return ForcedOnly;
+}
+    
+void CaptionUserPreferencesMediaAF::setCaptionDisplayMode(CaptionUserPreferences::CaptionDisplayMode mode)
+{
+    if (testingMode() || !MediaAccessibilityLibrary()) {
+        CaptionUserPreferences::setCaptionDisplayMode(mode);
+        return;
+    }
+
+    MACaptionAppearanceDisplayType displayType = kMACaptionAppearanceDisplayTypeForcedOnly;
+    switch (mode) {
+    case Automatic:
+        displayType = kMACaptionAppearanceDisplayTypeAutomatic;
+        break;
+    case ForcedOnly:
+        displayType = kMACaptionAppearanceDisplayTypeForcedOnly;
+        break;
+    case AlwaysOn:
+        displayType = kMACaptionAppearanceDisplayTypeAlwaysOn;
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+
+    MACaptionAppearanceSetDisplayType(kMACaptionAppearanceDomainUser, displayType);
+}
+
+bool CaptionUserPreferencesMediaAF::userPrefersCaptions() const
+{
+    bool captionSetting = CaptionUserPreferences::userPrefersCaptions();
+    if (captionSetting || testingMode() || !MediaAccessibilityLibrary())
+        return captionSetting;
+    
+    RetainPtr&lt;CFArrayRef&gt; captioningMediaCharacteristics = adoptCF(MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(kMACaptionAppearanceDomainUser));
+    return captioningMediaCharacteristics &amp;&amp; CFArrayGetCount(captioningMediaCharacteristics.get());
+}
+
+bool CaptionUserPreferencesMediaAF::userPrefersSubtitles() const
+{
+    bool subtitlesSetting = CaptionUserPreferences::userPrefersSubtitles();
+    if (subtitlesSetting || testingMode() || !MediaAccessibilityLibrary())
+        return subtitlesSetting;
+    
+    RetainPtr&lt;CFArrayRef&gt; captioningMediaCharacteristics = adoptCF(MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(kMACaptionAppearanceDomainUser));
+    return !(captioningMediaCharacteristics &amp;&amp; CFArrayGetCount(captioningMediaCharacteristics.get()));
+}
+
+void CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges()
+{
+    if (!MediaAccessibilityLibrary())
+        return;
+
+    if (!kMAXCaptionAppearanceSettingsChangedNotification)
+        return;
+
+    if (!m_listeningForPreferenceChanges) {
+        m_listeningForPreferenceChanges = true;
+        CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, userCaptionPreferencesChangedNotificationCallback, kMAXCaptionAppearanceSettingsChangedNotification, 0, CFNotificationSuspensionBehaviorCoalesce);
+    }
+    
+    updateCaptionStyleSheetOveride();
+}
+
+void CaptionUserPreferencesMediaAF::captionPreferencesChanged()
+{
+    if (m_listeningForPreferenceChanges)
+        updateCaptionStyleSheetOveride();
+
+    CaptionUserPreferences::captionPreferencesChanged();
+}
+
+String CaptionUserPreferencesMediaAF::captionsWindowCSS() const
+{
+    MACaptionAppearanceBehavior behavior;
+    RetainPtr&lt;CGColorRef&gt; color = adoptCF(MACaptionAppearanceCopyWindowColor(kMACaptionAppearanceDomainUser, &amp;behavior));
+
+    Color windowColor(color.get());
+    if (!windowColor.isValid())
+        windowColor = Color::transparent;
+
+    bool important = behavior == kMACaptionAppearanceBehaviorUseValue;
+    CGFloat opacity = MACaptionAppearanceGetWindowOpacity(kMACaptionAppearanceDomainUser, &amp;behavior);
+    if (!important)
+        important = behavior == kMACaptionAppearanceBehaviorUseValue;
+    String windowStyle = colorPropertyCSS(CSSPropertyBackgroundColor, Color(windowColor.red(), windowColor.green(), windowColor.blue(), static_cast&lt;int&gt;(opacity * 255)), important);
+
+    if (!opacity)
+        return windowStyle;
+
+    StringBuilder builder;
+    builder.append(windowStyle);
+    builder.append(getPropertyNameString(CSSPropertyPadding));
+    builder.append(&quot;: .4em !important;&quot;);
+
+    return builder.toString();
+}
+
+String CaptionUserPreferencesMediaAF::captionsBackgroundCSS() const
+{
+    // This default value must be the same as the one specified in mediaControls.css for -webkit-media-text-track-past-nodes
+    // and webkit-media-text-track-future-nodes.
+    DEFINE_STATIC_LOCAL(Color, defaultBackgroundColor, (Color(0, 0, 0, 0.8 * 255)));
+
+    MACaptionAppearanceBehavior behavior;
+
+    RetainPtr&lt;CGColorRef&gt; color = adoptCF(MACaptionAppearanceCopyBackgroundColor(kMACaptionAppearanceDomainUser, &amp;behavior));
+    Color backgroundColor(color.get());
+    if (!backgroundColor.isValid())
+        backgroundColor = defaultBackgroundColor;
+
+    bool important = behavior == kMACaptionAppearanceBehaviorUseValue;
+    CGFloat opacity = MACaptionAppearanceGetBackgroundOpacity(kMACaptionAppearanceDomainUser, &amp;behavior);
+    if (!important)
+        important = behavior == kMACaptionAppearanceBehaviorUseValue;
+    return colorPropertyCSS(CSSPropertyBackgroundColor, Color(backgroundColor.red(), backgroundColor.green(), backgroundColor.blue(), static_cast&lt;int&gt;(opacity * 255)), important);
+}
+
+Color CaptionUserPreferencesMediaAF::captionsTextColor(bool&amp; important) const
+{
+    MACaptionAppearanceBehavior behavior;
+    RetainPtr&lt;CGColorRef&gt; color = adoptCF(MACaptionAppearanceCopyForegroundColor(kMACaptionAppearanceDomainUser, &amp;behavior));
+    Color textColor(color.get());
+    if (!textColor.isValid())
+        // This default value must be the same as the one specified in mediaControls.css for -webkit-media-text-track-container.
+        textColor = Color::white;
+    
+    important = behavior == kMACaptionAppearanceBehaviorUseValue;
+    CGFloat opacity = MACaptionAppearanceGetForegroundOpacity(kMACaptionAppearanceDomainUser, &amp;behavior);
+    if (!important)
+        important = behavior == kMACaptionAppearanceBehaviorUseValue;
+    return Color(textColor.red(), textColor.green(), textColor.blue(), static_cast&lt;int&gt;(opacity * 255));
+}
+    
+String CaptionUserPreferencesMediaAF::captionsTextColorCSS() const
+{
+    bool important;
+    Color textColor = captionsTextColor(important);
+
+    if (!textColor.isValid())
+        return emptyString();
+
+    return colorPropertyCSS(CSSPropertyColor, textColor, important);
+}
+    
+String CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS() const
+{
+    MACaptionAppearanceBehavior behavior;
+    CGFloat radius = MACaptionAppearanceGetWindowRoundedCornerRadius(kMACaptionAppearanceDomainUser, &amp;behavior);
+    if (!radius)
+        return emptyString();
+
+    StringBuilder builder;
+    builder.append(getPropertyNameString(CSSPropertyBorderRadius));
+    builder.append(String::format(&quot;:%.02fpx&quot;, radius));
+    if (behavior == kMACaptionAppearanceBehaviorUseValue)
+        builder.append(&quot; !important&quot;);
+    builder.append(';');
+
+    return builder.toString();
+}
+    
+Color CaptionUserPreferencesMediaAF::captionsEdgeColorForTextColor(const Color&amp; textColor) const
+{
+    int distanceFromWhite = differenceSquared(textColor, Color::white);
+    int distanceFromBlack = differenceSquared(textColor, Color::black);
+    
+    if (distanceFromWhite &lt; distanceFromBlack)
+        return textColor.dark();
+    
+    return textColor.light();
+}
+
+String CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor(CSSPropertyID id, const String&amp; value, const Color&amp; textColor, bool important) const
+{
+    StringBuilder builder;
+    
+    builder.append(getPropertyNameString(id));
+    builder.append(':');
+    builder.append(value);
+    builder.append(' ');
+    builder.append(captionsEdgeColorForTextColor(textColor).serialized());
+    if (important)
+        builder.append(&quot; !important&quot;);
+    builder.append(';');
+    
+    return builder.toString();
+}
+
+String CaptionUserPreferencesMediaAF::colorPropertyCSS(CSSPropertyID id, const Color&amp; color, bool important) const
+{
+    StringBuilder builder;
+    
+    builder.append(getPropertyNameString(id));
+    builder.append(':');
+    builder.append(color.serialized());
+    if (important)
+        builder.append(&quot; !important&quot;);
+    builder.append(';');
+    
+    return builder.toString();
+}
+
+String CaptionUserPreferencesMediaAF::captionsTextEdgeCSS() const
+{
+    DEFINE_STATIC_LOCAL(const String, edgeStyleRaised, (&quot; -.05em -.05em 0 &quot;, String::ConstructFromLiteral));
+    DEFINE_STATIC_LOCAL(const String, edgeStyleDepressed, (&quot; .05em .05em 0 &quot;, String::ConstructFromLiteral));
+    DEFINE_STATIC_LOCAL(const String, edgeStyleDropShadow, (&quot; .075em .075em 0 &quot;, String::ConstructFromLiteral));
+    DEFINE_STATIC_LOCAL(const String, edgeStyleUniform, (&quot; .03em &quot;, String::ConstructFromLiteral));
+
+    bool unused;
+    Color color = captionsTextColor(unused);
+    if (!color.isValid())
+        color.setNamedColor(&quot;black&quot;);
+    color = captionsEdgeColorForTextColor(color);
+
+    MACaptionAppearanceBehavior behavior;
+    MACaptionAppearanceTextEdgeStyle textEdgeStyle = MACaptionAppearanceGetTextEdgeStyle(kMACaptionAppearanceDomainUser, &amp;behavior);
+    switch (textEdgeStyle) {
+    case kMACaptionAppearanceTextEdgeStyleUndefined:
+    case kMACaptionAppearanceTextEdgeStyleNone:
+        return emptyString();
+            
+    case kMACaptionAppearanceTextEdgeStyleRaised:
+        return cssPropertyWithTextEdgeColor(CSSPropertyTextShadow, edgeStyleRaised, color, behavior == kMACaptionAppearanceBehaviorUseValue);
+    case kMACaptionAppearanceTextEdgeStyleDepressed:
+        return cssPropertyWithTextEdgeColor(CSSPropertyTextShadow, edgeStyleDepressed, color, behavior == kMACaptionAppearanceBehaviorUseValue);
+    case kMACaptionAppearanceTextEdgeStyleDropShadow:
+        return cssPropertyWithTextEdgeColor(CSSPropertyTextShadow, edgeStyleDropShadow, color, behavior == kMACaptionAppearanceBehaviorUseValue);
+    case kMACaptionAppearanceTextEdgeStyleUniform:
+        return cssPropertyWithTextEdgeColor(CSSPropertyWebkitTextStroke, edgeStyleUniform, color, behavior == kMACaptionAppearanceBehaviorUseValue);
+            
+    default:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+    
+    return emptyString();
+}
+
+String CaptionUserPreferencesMediaAF::captionsDefaultFontCSS() const
+{
+    MACaptionAppearanceBehavior behavior;
+    
+    RetainPtr&lt;CTFontDescriptorRef&gt; font = adoptCF(MACaptionAppearanceCopyFontDescriptorForStyle(kMACaptionAppearanceDomainUser, &amp;behavior, kMACaptionAppearanceFontStyleDefault));
+    if (!font)
+        return emptyString();
+
+    RetainPtr&lt;CFTypeRef&gt; name = adoptCF(CTFontDescriptorCopyAttribute(font.get(), kCTFontNameAttribute));
+    if (!name)
+        return emptyString();
+    
+    StringBuilder builder;
+    
+    builder.append(getPropertyNameString(CSSPropertyFontFamily));
+    builder.append(&quot;: \&quot;&quot;);
+    builder.append(static_cast&lt;CFStringRef&gt;(name.get()));
+    builder.append('&quot;');
+    if (behavior == kMACaptionAppearanceBehaviorUseValue)
+        builder.append(&quot; !important&quot;);
+    builder.append(';');
+    
+    return builder.toString();
+}
+
+float CaptionUserPreferencesMediaAF::captionFontSizeScaleAndImportance(bool&amp; important) const
+{
+    if (testingMode() || !MediaAccessibilityLibrary())
+        return CaptionUserPreferences::captionFontSizeScaleAndImportance(important);
+
+    MACaptionAppearanceBehavior behavior;
+    CGFloat characterScale = CaptionUserPreferences::captionFontSizeScaleAndImportance(important);
+    CGFloat scaleAdjustment = MACaptionAppearanceGetRelativeCharacterSize(kMACaptionAppearanceDomainUser, &amp;behavior);
+
+    if (!scaleAdjustment)
+        return characterScale;
+
+    important = behavior == kMACaptionAppearanceBehaviorUseValue;
+#if defined(__LP64__) &amp;&amp; __LP64__
+    return narrowPrecisionToFloat(scaleAdjustment * characterScale);
+#else
+    return scaleAdjustment * characterScale;
+#endif
+}
+
+void CaptionUserPreferencesMediaAF::setPreferredLanguage(const String&amp; language)
+{
+    if (testingMode() || !MediaAccessibilityLibrary()) {
+        CaptionUserPreferences::setPreferredLanguage(language);
+        return;
+    }
+
+    MACaptionAppearanceAddSelectedLanguage(kMACaptionAppearanceDomainUser, language.createCFString().get());
+}
+
+Vector&lt;String&gt; CaptionUserPreferencesMediaAF::preferredLanguages() const
+{
+    if (testingMode() || !MediaAccessibilityLibrary())
+        return CaptionUserPreferences::preferredLanguages();
+
+    Vector&lt;String&gt; platformLanguages = platformUserPreferredLanguages();
+    Vector&lt;String&gt; override = userPreferredLanguagesOverride();
+    if (!override.isEmpty()) {
+        if (platformLanguages.size() != override.size())
+            return override;
+        for (size_t i = 0; i &lt; override.size(); i++) {
+            if (override[i] != platformLanguages[i])
+                return override;
+        }
+    }
+
+    CFIndex languageCount = 0;
+    RetainPtr&lt;CFArrayRef&gt; languages = adoptCF(MACaptionAppearanceCopySelectedLanguages(kMACaptionAppearanceDomainUser));
+    if (languages)
+        languageCount = CFArrayGetCount(languages.get());
+
+    if (!languageCount)
+        return CaptionUserPreferences::preferredLanguages();
+
+    Vector&lt;String&gt; userPreferredLanguages;
+    userPreferredLanguages.reserveCapacity(languageCount + platformLanguages.size());
+    for (CFIndex i = 0; i &lt; languageCount; i++)
+        userPreferredLanguages.append(static_cast&lt;CFStringRef&gt;(CFArrayGetValueAtIndex(languages.get(), i)));
+
+    userPreferredLanguages.appendVector(platformLanguages);
+
+    return userPreferredLanguages;
+}
+#endif // HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+
+String CaptionUserPreferencesMediaAF::captionsStyleSheetOverride() const
+{
+    if (testingMode())
+        return CaptionUserPreferences::captionsStyleSheetOverride();
+    
+    StringBuilder captionsOverrideStyleSheet;
+
+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+    if (!MediaAccessibilityLibrary())
+        return CaptionUserPreferences::captionsStyleSheetOverride();
+    
+    String captionsColor = captionsTextColorCSS();
+    String edgeStyle = captionsTextEdgeCSS();
+    String fontName = captionsDefaultFontCSS();
+    String background = captionsBackgroundCSS();
+    if (!background.isEmpty() || !captionsColor.isEmpty() || !edgeStyle.isEmpty() || !fontName.isEmpty()) {
+        captionsOverrideStyleSheet.append(&quot; video::&quot;);
+        captionsOverrideStyleSheet.append(TextTrackCue::cueShadowPseudoId());
+        captionsOverrideStyleSheet.append('{');
+        
+        if (!background.isEmpty())
+            captionsOverrideStyleSheet.append(background);
+        if (!captionsColor.isEmpty())
+            captionsOverrideStyleSheet.append(captionsColor);
+        if (!edgeStyle.isEmpty())
+            captionsOverrideStyleSheet.append(edgeStyle);
+        if (!fontName.isEmpty())
+            captionsOverrideStyleSheet.append(fontName);
+        
+        captionsOverrideStyleSheet.append('}');
+    }
+    
+    String windowColor = captionsWindowCSS();
+    String windowCornerRadius = windowRoundedCornerRadiusCSS();
+    if (!windowColor.isEmpty() || !windowCornerRadius.isEmpty()) {
+        captionsOverrideStyleSheet.append(&quot; video::&quot;);
+        captionsOverrideStyleSheet.append(TextTrackCueBox::textTrackCueBoxShadowPseudoId());
+        captionsOverrideStyleSheet.append('{');
+        
+        if (!windowColor.isEmpty())
+            captionsOverrideStyleSheet.append(windowColor);
+        if (!windowCornerRadius.isEmpty())
+            captionsOverrideStyleSheet.append(windowCornerRadius);
+        
+        captionsOverrideStyleSheet.append('}');
+    }
+#endif // HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+
+    LOG(Media, &quot;CaptionUserPreferencesMediaAF::captionsStyleSheetOverrideSetting sytle to:\n%s&quot;, captionsOverrideStyleSheet.toString().utf8().data());
+
+    return captionsOverrideStyleSheet.toString();
+}
+
+static String languageIdentifier(const String&amp; languageCode)
+{
+    if (languageCode.isEmpty())
+        return languageCode;
+
+    String lowercaseLanguageCode = languageCode.lower();
+
+    // Need 2U here to disambiguate String::operator[] from operator(NSString*, int)[] in a production build.
+    if (lowercaseLanguageCode.length() &gt;= 3 &amp;&amp; (lowercaseLanguageCode[2U] == '_' || lowercaseLanguageCode[2U] == '-'))
+        lowercaseLanguageCode.truncate(2);
+
+    return lowercaseLanguageCode;
+}
+
+static String trackDisplayName(TextTrack* track)
+{
+    if (track == TextTrack::captionMenuOffItem())
+        return textTrackOffMenuItemText();
+    if (track == TextTrack::captionMenuAutomaticItem())
+        return textTrackAutomaticMenuItemText();
+
+    StringBuilder displayName;
+    String label = track-&gt;label();
+    String trackLanguageIdentifier = track-&gt;language();
+
+    RetainPtr&lt;CFLocaleRef&gt; currentLocale = adoptCF(CFLocaleCopyCurrent());
+    RetainPtr&lt;CFStringRef&gt; localeIdentifier = adoptCF(CFLocaleCreateCanonicalLocaleIdentifierFromString(kCFAllocatorDefault, trackLanguageIdentifier.createCFString().get()));
+    RetainPtr&lt;CFStringRef&gt; languageCF = adoptCF(CFLocaleCopyDisplayNameForPropertyValue(currentLocale.get(), kCFLocaleLanguageCode, localeIdentifier.get()));
+    String language = languageCF.get();
+    if (!label.isEmpty()) {
+        if (language.isEmpty() || label.contains(language))
+            displayName.append(label);
+        else {
+            RetainPtr&lt;CFDictionaryRef&gt; localeDict = adoptCF(CFLocaleCreateComponentsFromLocaleIdentifier(kCFAllocatorDefault, localeIdentifier.get()));
+            if (localeDict) {
+                CFStringRef countryCode = 0;
+                String countryName;
+                
+                CFDictionaryGetValueIfPresent(localeDict.get(), kCFLocaleCountryCode, (const void **)&amp;countryCode);
+                if (countryCode) {
+                    RetainPtr&lt;CFStringRef&gt; countryNameCF = adoptCF(CFLocaleCopyDisplayNameForPropertyValue(currentLocale.get(), kCFLocaleCountryCode, countryCode));
+                    countryName = countryNameCF.get();
+                }
+                
+                if (!countryName.isEmpty())
+                    displayName.append(textTrackCountryAndLanguageMenuItemText(label, countryName, language));
+                else
+                    displayName.append(textTrackLanguageMenuItemText(label, language));
+            }
+        }
+    } else {
+        String languageAndLocale = CFLocaleCopyDisplayNameForPropertyValue(currentLocale.get(), kCFLocaleIdentifier, trackLanguageIdentifier.createCFString().get());
+        if (!languageAndLocale.isEmpty())
+            displayName.append(languageAndLocale);
+        else if (!language.isEmpty())
+            displayName.append(language);
+        else
+            displayName.append(localeIdentifier.get());
+    }
+    
+    if (displayName.isEmpty())
+        displayName.append(textTrackNoLabelText());
+    
+    if (track-&gt;isEasyToRead())
+        return easyReaderTrackMenuItemText(displayName.toString());
+    
+    if (track-&gt;isClosedCaptions())
+        return closedCaptionTrackMenuItemText(displayName.toString());
+
+    if (track-&gt;isSDH())
+        return sdhTrackMenuItemText(displayName.toString());
+
+    return displayName.toString();
+}
+
+String CaptionUserPreferencesMediaAF::displayNameForTrack(TextTrack* track) const
+{
+    return trackDisplayName(track);
+}
+
+int CaptionUserPreferencesMediaAF::textTrackSelectionScore(TextTrack* track, HTMLMediaElement* mediaElement) const
+{
+    CaptionDisplayMode displayMode = captionDisplayMode();
+    bool legacyOverride = mediaElement-&gt;webkitClosedCaptionsVisible();
+    if (displayMode == AlwaysOn &amp;&amp; (!userPrefersSubtitles() &amp;&amp; !userPrefersCaptions() &amp;&amp; !legacyOverride))
+        return 0;
+    if (track-&gt;kind() != TextTrack::captionsKeyword() &amp;&amp; track-&gt;kind() != TextTrack::subtitlesKeyword() &amp;&amp; track-&gt;kind() != TextTrack::forcedKeyword())
+        return 0;
+    if (!track-&gt;isMainProgramContent())
+        return 0;
+
+    bool trackHasOnlyForcedSubtitles = track-&gt;containsOnlyForcedSubtitles();
+    if (!legacyOverride &amp;&amp; ((trackHasOnlyForcedSubtitles &amp;&amp; displayMode != ForcedOnly) || (!trackHasOnlyForcedSubtitles &amp;&amp; displayMode == ForcedOnly)))
+        return 0;
+
+    Vector&lt;String&gt; userPreferredCaptionLanguages = preferredLanguages();
+
+    if (displayMode == Automatic || trackHasOnlyForcedSubtitles) {
+
+        if (!mediaElement || !mediaElement-&gt;player())
+            return 0;
+
+        String textTrackLanguage = track-&gt;language();
+        if (textTrackLanguage.isEmpty())
+            return 0;
+
+        Vector&lt;String&gt; languageList;
+        languageList.reserveCapacity(1);
+
+        String audioTrackLanguage;
+        if (testingMode())
+            audioTrackLanguage = primaryAudioTrackLanguageOverride();
+        else
+            audioTrackLanguage = mediaElement-&gt;player()-&gt;languageOfPrimaryAudioTrack();
+
+        if (audioTrackLanguage.isEmpty())
+            return 0;
+
+        if (trackHasOnlyForcedSubtitles) {
+            languageList.append(audioTrackLanguage);
+            size_t offset = indexOfBestMatchingLanguageInList(textTrackLanguage, languageList);
+
+            // Only consider a forced-only track if it IS in the same language as the primary audio track.
+            if (offset)
+                return 0;
+        } else {
+            languageList.append(defaultLanguage());
+
+            // Only enable a text track if the current audio track is NOT in the user's preferred language ...
+            size_t offset = indexOfBestMatchingLanguageInList(audioTrackLanguage, languageList);
+            if (!offset)
+                return 0;
+
+            // and the text track matches the user's preferred language.
+            offset = indexOfBestMatchingLanguageInList(textTrackLanguage, languageList);
+            if (offset)
+                return 0;
+        }
+
+        userPreferredCaptionLanguages = languageList;
+    }
+
+    int trackScore = 0;
+
+    if (userPrefersCaptions()) {
+        // When the user prefers accessiblity tracks, rank is SDH, then CC, then subtitles.
+        if (track-&gt;kind() == track-&gt;subtitlesKeyword())
+            trackScore = 1;
+        else if (track-&gt;isClosedCaptions())
+            trackScore = 2;
+        else
+            trackScore = 3;
+    } else {
+        // When the user prefers translation tracks, rank is subtitles, then SDH, then CC tracks.
+        if (track-&gt;kind() == track-&gt;subtitlesKeyword())
+            trackScore = 3;
+        else if (!track-&gt;isClosedCaptions())
+            trackScore = 2;
+        else
+            trackScore = 1;
+    }
+
+    return trackScore + textTrackLanguageSelectionScore(track, userPreferredCaptionLanguages);
+}
+
+static bool textTrackCompare(const RefPtr&lt;TextTrack&gt;&amp; a, const RefPtr&lt;TextTrack&gt;&amp; b)
+{
+    String preferredLanguageDisplayName = displayNameForLanguageLocale(languageIdentifier(defaultLanguage()));
+    String aLanguageDisplayName = displayNameForLanguageLocale(languageIdentifier(a-&gt;language()));
+    String bLanguageDisplayName = displayNameForLanguageLocale(languageIdentifier(b-&gt;language()));
+
+    // Tracks in the user's preferred language are always at the top of the menu.
+    bool aIsPreferredLanguage = !codePointCompare(aLanguageDisplayName, preferredLanguageDisplayName);
+    bool bIsPreferredLanguage = !codePointCompare(bLanguageDisplayName, preferredLanguageDisplayName);
+    if ((aIsPreferredLanguage || bIsPreferredLanguage) &amp;&amp; (aIsPreferredLanguage != bIsPreferredLanguage))
+        return aIsPreferredLanguage;
+
+    // Tracks not in the user's preferred language sort first by language ...
+    if (codePointCompare(aLanguageDisplayName, bLanguageDisplayName))
+        return codePointCompare(aLanguageDisplayName, bLanguageDisplayName) &lt; 0;
+
+    // ... but when tracks have the same language, main program content sorts next highest ...
+    bool aIsMainContent = a-&gt;isMainProgramContent();
+    bool bIsMainContent = b-&gt;isMainProgramContent();
+    if ((aIsMainContent || bIsMainContent) &amp;&amp; (aIsMainContent != bIsMainContent))
+        return aIsMainContent;
+
+    // ... and main program trakcs sort higher than CC tracks ...
+    bool aIsCC = a-&gt;isClosedCaptions();
+    bool bIsCC = b-&gt;isClosedCaptions();
+    if ((aIsCC || bIsCC) &amp;&amp; (aIsCC != bIsCC)) {
+        if (aIsCC)
+            return aIsMainContent;
+        return bIsMainContent;
+    }
+
+    // ... and tracks of the same type and language sort by the menu item text.
+    return codePointCompare(trackDisplayName(a.get()), trackDisplayName(b.get())) &lt; 0;
+}
+
+Vector&lt;RefPtr&lt;TextTrack&gt; &gt; CaptionUserPreferencesMediaAF::sortedTrackListForMenu(TextTrackList* trackList)
+{
+    ASSERT(trackList);
+
+    Vector&lt;RefPtr&lt;TextTrack&gt; &gt; tracksForMenu;
+    HashSet&lt;String&gt; languagesIncluded;
+    bool prefersAccessibilityTracks = userPrefersCaptions();
+    bool filterTrackList = shouldFilterTrackMenu();
+
+    for (unsigned i = 0, length = trackList-&gt;length(); i &lt; length; ++i) {
+        TextTrack* track = trackList-&gt;item(i);
+        String language = displayNameForLanguageLocale(track-&gt;language());
+
+        if (track-&gt;containsOnlyForcedSubtitles())
+            continue;
+        
+        if (track-&gt;isEasyToRead()) {
+            if (!language.isEmpty())
+                languagesIncluded.add(language);
+            tracksForMenu.append(track);
+            continue;
+        }
+
+        if (!language.isEmpty() &amp;&amp; track-&gt;isMainProgramContent()) {
+            bool isAccessibilityTrack = track-&gt;kind() == track-&gt;captionsKeyword();
+            if (prefersAccessibilityTracks) {
+                // In the first pass, include only caption tracks if the user prefers accessibility tracks.
+                if (!isAccessibilityTrack &amp;&amp; filterTrackList) {
+                    LOG(Media, &quot;CaptionUserPreferencesMediaAF::sortedTrackListForMenu - skipping '%s' track with language '%s' because it is NOT an accessibility track&quot;, track-&gt;kind().string().utf8().data(), language.utf8().data());
+                    continue;
+                }
+            } else {
+                // In the first pass, only include the first non-CC or SDH track with each language if the user prefers translation tracks.
+                if (isAccessibilityTrack &amp;&amp; filterTrackList) {
+                    LOG(Media, &quot;CaptionUserPreferencesMediaAF::sortedTrackListForMenu - skipping '%s' track with language '%s' because it is an accessibility track&quot;, track-&gt;kind().string().utf8().data(), language.utf8().data());
+                    continue;
+                }
+                if (languagesIncluded.contains(language)  &amp;&amp; filterTrackList) {
+                    LOG(Media, &quot;CaptionUserPreferencesMediaAF::sortedTrackListForMenu - skipping '%s' track with language '%s' because it is not the first with this language&quot;, track-&gt;kind().string().utf8().data(), language.utf8().data());
+                    continue;
+                }
+            }
+        }
+
+        if (!language.isEmpty())
+            languagesIncluded.add(language);
+        tracksForMenu.append(track);
+    }
+
+    // Now that we have filtered for the user's accessibility/translation preference, add  all tracks with a unique language without regard to track type.
+    for (unsigned i = 0, length = trackList-&gt;length(); i &lt; length; ++i) {
+        TextTrack* track = trackList-&gt;item(i);
+        String language = displayNameForLanguageLocale(track-&gt;language());
+
+        // All candidates with no languge were added the first time through.
+        if (language.isEmpty())
+            continue;
+
+        if (track-&gt;containsOnlyForcedSubtitles())
+            continue;
+
+        if (!languagesIncluded.contains(language) &amp;&amp; track-&gt;isMainProgramContent()) {
+            languagesIncluded.add(language);
+            tracksForMenu.append(track);
+            LOG(Media, &quot;CaptionUserPreferencesMediaAF::sortedTrackListForMenu - adding '%s' track with language '%s' because it is the only track with this language&quot;, track-&gt;kind().string().utf8().data(), language.utf8().data());
+        }
+    }
+
+    nonCopyingSort(tracksForMenu.begin(), tracksForMenu.end(), textTrackCompare);
+
+    tracksForMenu.insert(0, TextTrack::captionMenuOffItem());
+    tracksForMenu.insert(1, TextTrack::captionMenuAutomaticItem());
+
+    return tracksForMenu;
+}
+    
+}
+
+#endif // ENABLE(VIDEO_TRACK)
</ins></span></pre></div>
<a id="tagsSafari53747SourceWebCorepageCaptionUserPreferencesMediaAFhfromrev152004trunkSourceWebCorepageCaptionUserPreferencesMediaAFh"></a>
<div class="copfile"><h4>Copied: tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMediaAF.h (from rev 152004, trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.h) (0 => 152112)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMediaAF.h                                (rev 0)
+++ tags/Safari-537.47/Source/WebCore/page/CaptionUserPreferencesMediaAF.h        2013-06-27 17:47:44 UTC (rev 152112)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+/*
+ * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CaptionUserPreferencesMediaAF_h
+#define CaptionUserPreferencesMediaAF_h
+
+#if ENABLE(VIDEO_TRACK)
+
+#include &quot;CSSPropertyNames.h&quot;
+#include &quot;CaptionUserPreferences.h&quot;
+#include &quot;Color.h&quot;
+#include &lt;wtf/HashSet.h&gt;
+
+namespace WebCore {
+
+class CaptionUserPreferencesMediaAF : public CaptionUserPreferences {
+public:
+    static PassOwnPtr&lt;CaptionUserPreferencesMediaAF&gt; create(PageGroup* group) { return adoptPtr(new CaptionUserPreferencesMediaAF(group)); }
+    virtual ~CaptionUserPreferencesMediaAF();
+
+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+    virtual CaptionDisplayMode captionDisplayMode() const OVERRIDE;
+    virtual void setCaptionDisplayMode(CaptionDisplayMode) OVERRIDE;
+
+    virtual bool userPrefersCaptions() const OVERRIDE;
+    virtual bool userPrefersSubtitles() const OVERRIDE;
+
+    virtual float captionFontSizeScaleAndImportance(bool&amp;) const OVERRIDE;
+
+    virtual void setInterestedInCaptionPreferenceChanges() OVERRIDE;
+
+    virtual void setPreferredLanguage(const String&amp;) OVERRIDE;
+    virtual Vector&lt;String&gt; preferredLanguages() const OVERRIDE;
+
+    virtual void captionPreferencesChanged() OVERRIDE;
+
+    bool shouldFilterTrackMenu() const { return true; }
+#else
+    bool shouldFilterTrackMenu() const { return false; }
+#endif
+
+    virtual String captionsStyleSheetOverride() const OVERRIDE;
+    virtual int textTrackSelectionScore(TextTrack*, HTMLMediaElement*) const OVERRIDE;
+    virtual Vector&lt;RefPtr&lt;TextTrack&gt; &gt; sortedTrackListForMenu(TextTrackList*) OVERRIDE;
+    virtual String displayNameForTrack(TextTrack*) const OVERRIDE;
+
+private:
+    CaptionUserPreferencesMediaAF(PageGroup*);
+
+#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
+    String captionsWindowCSS() const;
+    String captionsBackgroundCSS() const;
+    String captionsTextColorCSS() const;
+    Color captionsTextColor(bool&amp;) const;
+    String captionsDefaultFontCSS() const;
+    Color captionsEdgeColorForTextColor(const Color&amp;) const;
+    String windowRoundedCornerRadiusCSS() const;
+    String captionsTextEdgeCSS() const;
+    String cssPropertyWithTextEdgeColor(CSSPropertyID, const String&amp;, const Color&amp;, bool) const;
+    String colorPropertyCSS(CSSPropertyID, const Color&amp;, bool) const;
+
+    bool m_listeningForPreferenceChanges;
+#endif
+};
+
+}
+#endif
+
+#endif
</ins></span></pre></div>
<a id="tagsSafari53747SourceWebCorepagePageGroupcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-537.47/Source/WebCore/page/PageGroup.cpp (152111 => 152112)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-537.47/Source/WebCore/page/PageGroup.cpp        2013-06-27 17:45:17 UTC (rev 152111)
+++ tags/Safari-537.47/Source/WebCore/page/PageGroup.cpp        2013-06-27 17:47:44 UTC (rev 152112)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> #if (PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)) || HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
</span><del>-#include &quot;CaptionUserPreferencesMac.h&quot;
</del><ins>+#include &quot;CaptionUserPreferencesMediaAF.h&quot;
</ins><span class="cx"> #else
</span><span class="cx"> #include &quot;CaptionUserPreferences.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -420,7 +420,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_captionPreferences)
</span><span class="cx"> #if (PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)) || HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
</span><del>-        m_captionPreferences = CaptionUserPreferencesMac::create(this);
</del><ins>+        m_captionPreferences = CaptionUserPreferencesMediaAF::create(this);
</ins><span class="cx"> #else
</span><span class="cx">         m_captionPreferences = CaptionUserPreferences::create(this);
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>