<!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>[51191] trunk</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/51191">51191</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2009-11-19 10:14:01 -0800 (Thu, 19 Nov 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;

        Reviewed by Dan Bernstein.

        &lt;rdar://problem/7035231&gt;
        Support closed caption in &lt;video&gt; element

        Test: media/media-captions.html

        * WebCore.base.exp:
        * accessibility/AccessibilityMediaControls.cpp:
        (WebCore::AccessibilityMediaControl::controlTypeName):
            Define ShowClosedCaptionsButton and HideClosedCaptionsButton.

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
            Add MediaToggleClosedCaptionsButtonPart.

        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::extractPseudoType):
            Define and match mediaControlsToggleClosedCaptionsButton.

        * css/CSSSelector.h:
        (WebCore::CSSSelector::):
        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
            Define and match PseudoMediaControlsToggleClosedCaptions.

        * css/CSSValueKeywords.in:
            Define and use media-toggle-closed-captions-button.

        * css/mediaControls.css:
        * css/mediaControlsQuickTime.css:
            Add webkit-media-controls-toggle-closed-captions-button.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement): 
            Initialize m_closedCaptionsVisible.
        (WebCore::HTMLMediaElement::loadInternal): 
            Set m_closedCaptionsVisible to false.
        (WebCore::HTMLMediaElement::hasClosedCaptions): 
        (WebCore::HTMLMediaElement::closedCaptionsVisible): 
        (WebCore::HTMLMediaElement::setClosedCaptionsVisible): 
            New, captions internal methods.
        (WebCore::HTMLMediaElement::setWebkitClosedCaptionsVisible): 
        (WebCore::HTMLMediaElement::webkitClosedCaptionsVisible): 
        (WebCore::HTMLMediaElement::webkitHasClosedCaptions): 
            New, captions DOM API.

        * html/HTMLMediaElement.h:
        * html/HTMLMediaElement.idl:
            Declare methods needed for captions API.

        * platform/ThemeTypes.h:
            Add MediaToggleClosedCaptionsButtonPart.

        * platform/android/LocalizedStringsAndroid.cpp:
        (WebCore::localizedMediaControlElementString):
        (WebCore::localizedMediaControlElementHelpText):
        (WebCore::localizedMediaTimeDescription):
            Add empty implmentations.

        * platform/graphics/MediaPlayer.cpp:
        (WebCore::NullMediaPlayerPrivate::hasClosedCaptions):
        (WebCore::NullMediaPlayerPrivate::setClosedCaptionsVisible):
            New, empty implementations of media engine closed caption functions.
        (WebCore::MediaPlayer::hasClosedCaptions):
        (WebCore::MediaPlayer::setClosedCaptionsVisible):
            New, call media engine closed caption functions.

        * platform/graphics/MediaPlayer.h:
        * platform/graphics/MediaPlayerPrivate.h:
        (WebCore::MediaPlayerPrivateInterface::hasClosedCaptions):
        (WebCore::MediaPlayerPrivateInterface::setClosedCaptionsVisible):
            Declare new media engine methods.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::MediaPlayerPrivate::hasClosedCaptions):
        (WebCore::MediaPlayerPrivate::setClosedCaptionsVisible):
            New, QTKit implementation of closed caption methods.

        * platform/gtk/LocalizedStringsGtk.cpp:
        (WebCore::localizedMediaControlElementString):
        (WebCore::localizedMediaControlElementHelpText):
            Add help text for ShowClosedCaptionsButton and HideClosedCaptionsButton.

        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
            Declare and initialize wkQTMovieHasClosedCaptions and wkQTMovieSetShowClosedCaptions.

        * rendering/MediaControlElements.cpp:
        (WebCore::MediaControlInputElement::MediaControlInputElement):
            Deal with MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON.
        (WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
        (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
        (WebCore::MediaControlToggleClosedCaptionsButtonElement::updateDisplayType):
            New, implement the closed caption toggle button,

        * rendering/MediaControlElements.h:
            Define MediaShowClosedCaptionsButton and MediaHideClosedCaptionsButton,
            declare MediaControlToggleClosedCaptionsButtonElement.

        * rendering/RenderMedia.cpp:
        (WebCore::RenderMedia::styleDidChange):
        (WebCore::RenderMedia::createToggleClosedCaptionsButton):
        (WebCore::RenderMedia::createStatusDisplay):
        (WebCore::RenderMedia::updateControls):
        (WebCore::RenderMedia::forwardEvent):
        * rendering/RenderMedia.h:
            Deal with m_toggleClosedCaptionsButton.

        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::paint):
            Deal with MediaToggleClosedCaptionsButtonPart.

        * rendering/RenderTheme.h:
        * rendering/RenderThemeMac.h:
            Declare paintMediaToggleClosedCaptionsButton.

        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::paintMediaToggleClosedCaptionsButton):
            New.
        (WebCore::RenderThemeMac::shouldRenderMediaControlPart):
            Don't render captions toggle button unless we are using the new theme, the
            movie has captions, and the movie is in a &lt;video&gt; element since we currently
            rely on QTKit to render the captions.

        * rendering/style/RenderStyleConstants.h:
            Define MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON.

2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;

        Reviewed by Dan Bernstein.

        &lt;rdar://problem/7035231&gt;
        Support closed caption in &lt;video&gt; element

        * media/media-captions-expected.txt: Added.
        * media/media-captions.html: Added.
        * media/content/counting-captioned.mov: Added.

        * platform/gtk/Skipped:
        * platform/mac-leopard/Skipped:
        * platform/mac-tiger/Skipped:
        * platform/win/Skipped:
            Skipped on platforms that don't support closed captions yet.

2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;

        Reviewed by Dan Bernstein.

        &lt;rdar://problem/7035231&gt;
        Support closed caption in &lt;video&gt; element

        * English.lproj/Localizable.strings:
            Add strings for toggle captions button.

2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;

        Reviewed by Dan Bernstein.

        &lt;rdar://problem/7035231&gt;
        Support closed caption in &lt;video&gt; element

        * WebCoreSupport/WebSystemInterface.m:
        (InitWebCoreSystemInterface):
            Add QTMovieHasClosedCaptions and QTMovieSetShowClosedCaptions.

        * WebCoreSupport/WebViewFactory.mm:
        (-[WebViewFactory localizedMediaControlElementString:]):
        (-[WebViewFactory localizedMediaControlElementHelpText:]):
            Add accessibility help strings for media controller closed caption button.

2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;

        Reviewed by Dan Bernstein.

        &lt;rdar://problem/7035231&gt;
        Support closed caption in &lt;video&gt; element

        * WebCoreLocalizedStrings.cpp:
        (WebCore::localizedMediaControlElementString):
        (WebCore::localizedMediaControlElementHelpText):
            Add accessibility help strings for media controller closed caption button.

2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;

        Reviewed by Dan Bernstein.

        &lt;rdar://problem/7035231&gt;
        Support closed caption in &lt;video&gt; element

        * WebKitSystemInterface.h:
            Add prototypes for WKQTMovieHasClosedCaptions and WKQTMovieSetShowClosedCaptions,
            define WKMediaUIPartToggleClosedCaptionsButton.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkSkipped">trunk/LayoutTests/platform/gtk/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformmacleopardSkipped">trunk/LayoutTests/platform/mac-leopard/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformmactigerSkipped">trunk/LayoutTests/platform/mac-tiger/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformwinSkipped">trunk/LayoutTests/platform/win/Skipped</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreWebCorebaseexp">trunk/WebCore/WebCore.base.exp</a></li>
<li><a href="#trunkWebCoreaccessibilityAccessibilityMediaControlscpp">trunk/WebCore/accessibility/AccessibilityMediaControls.cpp</a></li>
<li><a href="#trunkWebCorecssCSSPrimitiveValueMappingsh">trunk/WebCore/css/CSSPrimitiveValueMappings.h</a></li>
<li><a href="#trunkWebCorecssCSSSelectorcpp">trunk/WebCore/css/CSSSelector.cpp</a></li>
<li><a href="#trunkWebCorecssCSSSelectorh">trunk/WebCore/css/CSSSelector.h</a></li>
<li><a href="#trunkWebCorecssCSSStyleSelectorcpp">trunk/WebCore/css/CSSStyleSelector.cpp</a></li>
<li><a href="#trunkWebCorecssCSSValueKeywordsin">trunk/WebCore/css/CSSValueKeywords.in</a></li>
<li><a href="#trunkWebCorecssmediaControlscss">trunk/WebCore/css/mediaControls.css</a></li>
<li><a href="#trunkWebCorecssmediaControlsQuickTimecss">trunk/WebCore/css/mediaControlsQuickTime.css</a></li>
<li><a href="#trunkWebCorehtmlHTMLMediaElementcpp">trunk/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkWebCorehtmlHTMLMediaElementh">trunk/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkWebCorehtmlHTMLMediaElementidl">trunk/WebCore/html/HTMLMediaElement.idl</a></li>
<li><a href="#trunkWebCoreplatformThemeTypesh">trunk/WebCore/platform/ThemeTypes.h</a></li>
<li><a href="#trunkWebCoreplatformandroidLocalizedStringsAndroidcpp">trunk/WebCore/platform/android/LocalizedStringsAndroid.cpp</a></li>
<li><a href="#trunkWebCoreplatformgraphicsMediaPlayercpp">trunk/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkWebCoreplatformgraphicsMediaPlayerh">trunk/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkWebCoreplatformgraphicsMediaPlayerPrivateh">trunk/WebCore/platform/graphics/MediaPlayerPrivate.h</a></li>
<li><a href="#trunkWebCoreplatformgraphicsmacMediaPlayerPrivateQTKith">trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h</a></li>
<li><a href="#trunkWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm">trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm</a></li>
<li><a href="#trunkWebCoreplatformgtkLocalizedStringsGtkcpp">trunk/WebCore/platform/gtk/LocalizedStringsGtk.cpp</a></li>
<li><a href="#trunkWebCoreplatformmacWebCoreSystemInterfaceh">trunk/WebCore/platform/mac/WebCoreSystemInterface.h</a></li>
<li><a href="#trunkWebCoreplatformmacWebCoreSystemInterfacemm">trunk/WebCore/platform/mac/WebCoreSystemInterface.mm</a></li>
<li><a href="#trunkWebCorerenderingMediaControlElementscpp">trunk/WebCore/rendering/MediaControlElements.cpp</a></li>
<li><a href="#trunkWebCorerenderingMediaControlElementsh">trunk/WebCore/rendering/MediaControlElements.h</a></li>
<li><a href="#trunkWebCorerenderingRenderMediacpp">trunk/WebCore/rendering/RenderMedia.cpp</a></li>
<li><a href="#trunkWebCorerenderingRenderMediah">trunk/WebCore/rendering/RenderMedia.h</a></li>
<li><a href="#trunkWebCorerenderingRenderThemecpp">trunk/WebCore/rendering/RenderTheme.cpp</a></li>
<li><a href="#trunkWebCorerenderingRenderThemeh">trunk/WebCore/rendering/RenderTheme.h</a></li>
<li><a href="#trunkWebCorerenderingRenderThemeMach">trunk/WebCore/rendering/RenderThemeMac.h</a></li>
<li><a href="#trunkWebCorerenderingRenderThemeMacmm">trunk/WebCore/rendering/RenderThemeMac.mm</a></li>
<li><a href="#trunkWebCorerenderingstyleRenderStyleConstantsh">trunk/WebCore/rendering/style/RenderStyleConstants.h</a></li>
<li><a href="#trunkWebKitChangeLog">trunk/WebKit/ChangeLog</a></li>
<li><a href="#trunkWebKitEnglishlprojLocalizablestrings">trunk/WebKit/English.lproj/Localizable.strings</a></li>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacWebCoreSupportWebSystemInterfacem">trunk/WebKit/mac/WebCoreSupport/WebSystemInterface.m</a></li>
<li><a href="#trunkWebKitmacWebCoreSupportWebViewFactorymm">trunk/WebKit/mac/WebCoreSupport/WebViewFactory.mm</a></li>
<li><a href="#trunkWebKitwinChangeLog">trunk/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkWebKitwinWebCoreLocalizedStringscpp">trunk/WebKit/win/WebCoreLocalizedStrings.cpp</a></li>
<li><a href="#trunkWebKitLibrariesChangeLog">trunk/WebKitLibraries/ChangeLog</a></li>
<li><a href="#trunkWebKitLibrariesWebKitSystemInterfaceh">trunk/WebKitLibraries/WebKitSystemInterface.h</a></li>
<li><a href="#trunkWebKitLibrarieslibWebKitSystemInterfaceLeoparda">trunk/WebKitLibraries/libWebKitSystemInterfaceLeopard.a</a></li>
<li><a href="#trunkWebKitLibrarieslibWebKitSystemInterfaceSnowLeoparda">trunk/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a</a></li>
<li><a href="#trunkWebKitLibrarieslibWebKitSystemInterfaceTigera">trunk/WebKitLibraries/libWebKitSystemInterfaceTiger.a</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediacontentcountingcaptionedmov">trunk/LayoutTests/media/content/counting-captioned.mov</a></li>
<li><a href="#trunkLayoutTestsmediamediacaptionsexpectedtxt">trunk/LayoutTests/media/media-captions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediamediacaptionshtml">trunk/LayoutTests/media/media-captions.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/LayoutTests/ChangeLog        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        Reviewed by Dan Bernstein.
+
+        &lt;rdar://problem/7035231&gt;
+        Support closed caption in &lt;video&gt; element
+
+        * media/media-captions-expected.txt: Added.
+        * media/media-captions.html: Added.
+        * media/content/counting-captioned.mov: Added.
+
+        * platform/gtk/Skipped:
+        * platform/mac-leopard/Skipped:
+        * platform/mac-tiger/Skipped:
+        * platform/win/Skipped:
+            Skipped on platforms that don't support closed captions yet.
+
</ins><span class="cx"> 2009-11-19  Pavel Feldman  &lt;pfeldman@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Gustavo Noronha Silva.
</span></span></pre></div>
<a id="trunkLayoutTestsmediacontentcountingcaptionedmov"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/media/content/counting-captioned.mov</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/media/content/counting-captioned.mov
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsmediamediacaptionsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/media-captions-expected.txt (0 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/media-captions-expected.txt                                (rev 0)
+++ trunk/LayoutTests/media/media-captions-expected.txt        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+Test media element close caption API.
+
+Test before movie is open:
+EXPECTED (mediaElement.webkitHasClosedCaptions == 'false') OK
+EXPECTED (mediaElement.webkitClosedCaptionsVisible == 'false') OK
+
+Loading &quot;content/test.wav&quot;. Audio-only file without captions.
+EVENT(loadstart)
+EVENT(durationchange)
+EVENT(loadedmetadata)
+EXPECTED (mediaElement.webkitHasClosedCaptions == 'false') OK
+EXPECTED (mediaElement.webkitClosedCaptionsVisible == 'false') OK
+*** enabling captions
+EXPECTED (mediaElement.webkitClosedCaptionsVisible == 'false') OK
+
+Loading &quot;content/counting-captioned.mov&quot;. QuickTime movie with captions..
+EVENT(loadstart)
+EVENT(durationchange)
+EVENT(loadedmetadata)
+EXPECTED (mediaElement.webkitHasClosedCaptions == 'true') OK
+EXPECTED (mediaElement.webkitClosedCaptionsVisible == 'false') OK
+*** enabling captions
+EXPECTED (mediaElement.webkitClosedCaptionsVisible == 'true') OK
+
+END OF TEST
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmediamediacaptionshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/media-captions.html (0 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/media-captions.html                                (rev 0)
+++ trunk/LayoutTests/media/media-captions.html        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+&lt;html&gt;
+    &lt;head&gt;
+        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
+        &lt;title&gt;closed caption API test&lt;/title&gt;
+
+        &lt;script src=video-test.js&gt;&lt;/script&gt;
+        &lt;script src=media-fullscreen.js&gt;&lt;/script&gt;
+
+        &lt;script&gt;
+            var movieInfo = 
+            {
+                current : -1,
+                movies : 
+                [ 
+                    {
+                        url : &quot;content/test.wav&quot;, 
+                        description : &quot;Audio-only file without captions&quot;, 
+                        hasCaptions : false,
+                    },
+                    {
+                        url : &quot;content/counting-captioned.mov&quot;, 
+                        description : &quot;QuickTime movie with captions.&quot;, 
+                        hasCaptions : true,
+                    },
+                ]
+            };
+
+
+            function canplaythrough()
+            {
+                var movie = movieInfo.movies[movieInfo.current];
+            
+                testExpected(&quot;mediaElement.webkitHasClosedCaptions&quot;, movie.hasCaptions);
+                testExpected(&quot;mediaElement.webkitClosedCaptionsVisible&quot;, false);
+                
+                // Try to enable captions, they should only be enabled after if the movie has captions.
+                consoleWrite(&quot;*** enabling captions&quot;);
+                mediaElement.webkitClosedCaptionsVisible = true;
+                testExpected(&quot;mediaElement.webkitClosedCaptionsVisible&quot;, movie.hasCaptions);
+
+                openNextMovie();
+            }
+            
+            function openNextMovie()
+            {
+                consoleWrite(&quot;&quot;);
+
+                movieInfo.current++;
+                if (movieInfo.current &gt;= movieInfo.movies.length)
+                {
+                    endTest();
+                    return;
+                }
+
+                var url = movieInfo.movies[movieInfo.current].url;
+                video.src = url;
+                var desc = &quot;&lt;b&gt;Loading&lt;/b&gt; &lt;em&gt;\&quot;&quot;+ url + &quot;\&quot;&lt;/em&gt;&quot; + 
+                            &quot;. &quot; + movieInfo.movies[movieInfo.current].description + &quot;.&lt;/em&gt;&quot;;
+                consoleWrite(desc);
+                if (movieInfo.current &gt; 0)
+                    video.load();
+            }
+            
+            function start()
+            {
+                findMediaElement();
+
+                waitForEvent(&quot;error&quot;);
+                waitForEvent(&quot;loadstart&quot;);
+                waitForEvent(&quot;waiting&quot;);
+                waitForEvent(&quot;ratechange&quot;);
+                waitForEvent(&quot;durationchange&quot;);
+                waitForEvent(&quot;pause&quot;);
+                waitForEvent(&quot;play&quot;);
+                waitForEvent(&quot;playing&quot;);
+
+                waitForEvent('loadedmetadata', canplaythrough);
+
+                consoleWrite(&quot;&lt;b&gt;Test before movie is open:&lt;/b&gt;&quot;);
+                testExpected(&quot;mediaElement.webkitHasClosedCaptions&quot;, false);
+                testExpected(&quot;mediaElement.webkitClosedCaptionsVisible&quot;, false);
+            
+                openNextMovie();
+            }
+
+        &lt;/script&gt;
+
+    &lt;/head&gt;
+
+    &lt;body onload=&quot;start()&quot;&gt;
+
+        &lt;video controls&gt;&lt;/video&gt;
+
+        &lt;p&gt;Test media element close caption API.&lt;/p&gt;
+
+    &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/Skipped (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/Skipped        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/LayoutTests/platform/gtk/Skipped        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -3612,6 +3612,8 @@
</span><span class="cx"> # Tests requiring fullscreen &lt;video&gt; support
</span><span class="cx"> media/media-fullscreen-inline.html
</span><span class="cx"> media/media-fullscreen-not-in-document.html
</span><ins>+# Requires media engine closed caption support
+media/media-captions.html
</ins><span class="cx"> 
</span><span class="cx"> # Tests in plugins/ directory
</span><span class="cx"> #   These tests require ObjC plugin, do not bother trying to get them to work
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacleopardSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-leopard/Skipped (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-leopard/Skipped        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/LayoutTests/platform/mac-leopard/Skipped        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -25,5 +25,8 @@
</span><span class="cx"> media/media-fullscreen-inline.html
</span><span class="cx"> media/media-fullscreen-not-in-document.html
</span><span class="cx"> 
</span><ins>+# Requires media engine closed caption support
+media/media-captions.html
+
</ins><span class="cx"> # Tests of accessibility functionality not supported on Leopard
</span><span class="cx"> accessibility/aria-list-and-listitem.html
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmactigerSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-tiger/Skipped (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-tiger/Skipped        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/LayoutTests/platform/mac-tiger/Skipped        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -67,6 +67,9 @@
</span><span class="cx"> media/media-fullscreen-inline.html
</span><span class="cx"> media/media-fullscreen-not-in-document.html
</span><span class="cx"> 
</span><ins>+# Requires media engine closed caption support
+media/media-captions.html
+
</ins><span class="cx"> # Tests of accessibility functionality not supported on Tiger
</span><span class="cx"> accessibility/aria-list-and-listitem.html
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwinSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/Skipped (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/Skipped        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/LayoutTests/platform/win/Skipped        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -55,6 +55,9 @@
</span><span class="cx"> media/media-fullscreen-inline.html
</span><span class="cx"> media/media-fullscreen-not-in-document.html
</span><span class="cx"> 
</span><ins>+# Requires media engine closed caption support
+media/media-captions.html
+
</ins><span class="cx"> # &lt;rdar://problem/5075790&gt; Layout tests that depend on certain fonts don't match Mac results:
</span><span class="cx"> #                          - Mac OS X and Windows do not have an Arabic font in common
</span><span class="cx"> fast/text/international/bidi-AN-after-L.html
</span></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/ChangeLog        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -1,3 +1,134 @@
</span><ins>+2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        Reviewed by Dan Bernstein.
+
+        &lt;rdar://problem/7035231&gt;
+        Support closed caption in &lt;video&gt; element
+
+        Test: media/media-captions.html
+
+        * WebCore.base.exp:
+        * accessibility/AccessibilityMediaControls.cpp:
+        (WebCore::AccessibilityMediaControl::controlTypeName):
+            Define ShowClosedCaptionsButton and HideClosedCaptionsButton.
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+            Add MediaToggleClosedCaptionsButtonPart.
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::extractPseudoType):
+            Define and match mediaControlsToggleClosedCaptionsButton.
+
+        * css/CSSSelector.h:
+        (WebCore::CSSSelector::):
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+            Define and match PseudoMediaControlsToggleClosedCaptions.
+
+        * css/CSSValueKeywords.in:
+            Define and use media-toggle-closed-captions-button.
+
+        * css/mediaControls.css:
+        * css/mediaControlsQuickTime.css:
+            Add webkit-media-controls-toggle-closed-captions-button.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement): 
+            Initialize m_closedCaptionsVisible.
+        (WebCore::HTMLMediaElement::loadInternal): 
+            Set m_closedCaptionsVisible to false.
+        (WebCore::HTMLMediaElement::hasClosedCaptions): 
+        (WebCore::HTMLMediaElement::closedCaptionsVisible): 
+        (WebCore::HTMLMediaElement::setClosedCaptionsVisible): 
+            New, captions internal methods.
+        (WebCore::HTMLMediaElement::setWebkitClosedCaptionsVisible): 
+        (WebCore::HTMLMediaElement::webkitClosedCaptionsVisible): 
+        (WebCore::HTMLMediaElement::webkitHasClosedCaptions): 
+            New, captions DOM API.
+
+        * html/HTMLMediaElement.h:
+        * html/HTMLMediaElement.idl:
+            Declare methods needed for captions API.
+
+        * platform/ThemeTypes.h:
+            Add MediaToggleClosedCaptionsButtonPart.
+
+        * platform/android/LocalizedStringsAndroid.cpp:
+        (WebCore::localizedMediaControlElementString):
+        (WebCore::localizedMediaControlElementHelpText):
+        (WebCore::localizedMediaTimeDescription):
+            Add empty implmentations.
+
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::NullMediaPlayerPrivate::hasClosedCaptions):
+        (WebCore::NullMediaPlayerPrivate::setClosedCaptionsVisible):
+            New, empty implementations of media engine closed caption functions.
+        (WebCore::MediaPlayer::hasClosedCaptions):
+        (WebCore::MediaPlayer::setClosedCaptionsVisible):
+            New, call media engine closed caption functions.
+
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::hasClosedCaptions):
+        (WebCore::MediaPlayerPrivateInterface::setClosedCaptionsVisible):
+            Declare new media engine methods.
+
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivate::hasClosedCaptions):
+        (WebCore::MediaPlayerPrivate::setClosedCaptionsVisible):
+            New, QTKit implementation of closed caption methods.
+
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::localizedMediaControlElementString):
+        (WebCore::localizedMediaControlElementHelpText):
+            Add help text for ShowClosedCaptionsButton and HideClosedCaptionsButton.
+
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+            Declare and initialize wkQTMovieHasClosedCaptions and wkQTMovieSetShowClosedCaptions.
+
+        * rendering/MediaControlElements.cpp:
+        (WebCore::MediaControlInputElement::MediaControlInputElement):
+            Deal with MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON.
+        (WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
+        (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
+        (WebCore::MediaControlToggleClosedCaptionsButtonElement::updateDisplayType):
+            New, implement the closed caption toggle button,
+
+        * rendering/MediaControlElements.h:
+            Define MediaShowClosedCaptionsButton and MediaHideClosedCaptionsButton,
+            declare MediaControlToggleClosedCaptionsButtonElement.
+
+        * rendering/RenderMedia.cpp:
+        (WebCore::RenderMedia::styleDidChange):
+        (WebCore::RenderMedia::createToggleClosedCaptionsButton):
+        (WebCore::RenderMedia::createStatusDisplay):
+        (WebCore::RenderMedia::updateControls):
+        (WebCore::RenderMedia::forwardEvent):
+        * rendering/RenderMedia.h:
+            Deal with m_toggleClosedCaptionsButton.
+
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::paint):
+            Deal with MediaToggleClosedCaptionsButtonPart.
+
+        * rendering/RenderTheme.h:
+        * rendering/RenderThemeMac.h:
+            Declare paintMediaToggleClosedCaptionsButton.
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintMediaToggleClosedCaptionsButton):
+            New.
+        (WebCore::RenderThemeMac::shouldRenderMediaControlPart):
+            Don't render captions toggle button unless we are using the new theme, the
+            movie has captions, and the movie is in a &lt;video&gt; element since we currently
+            rely on QTKit to render the captions.
+
+        * rendering/style/RenderStyleConstants.h:
+            Define MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON.
+
</ins><span class="cx"> 2009-11-19  Kevin Ollivier  &lt;kevino@theolliviers.com&gt;
</span><span class="cx"> 
</span><span class="cx">         wx build fix. Add missing header.
</span></span></pre></div>
<a id="trunkWebCoreWebCorebaseexp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.base.exp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.base.exp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/WebCore.base.exp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -1021,9 +1021,11 @@
</span><span class="cx"> _wkQTIncludeOnlyModernMediaFileTypes
</span><span class="cx"> _wkQTMovieDataRate
</span><span class="cx"> _wkQTMovieGetType
</span><ins>+_wkQTMovieHasClosedCaptions
</ins><span class="cx"> _wkQTMovieMaxTimeLoaded
</span><span class="cx"> _wkQTMovieMaxTimeLoadedChangeNotification
</span><span class="cx"> _wkQTMovieMaxTimeSeekable
</span><ins>+_wkQTMovieSetShowClosedCaptions
</ins><span class="cx"> _wkQTMovieViewSetDrawSynchronously
</span><span class="cx"> _wkSetCGFontRenderingMode
</span><span class="cx"> _wkSetDragImage
</span></span></pre></div>
<a id="trunkWebCoreaccessibilityAccessibilityMediaControlscpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/accessibility/AccessibilityMediaControls.cpp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/accessibility/AccessibilityMediaControls.cpp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/accessibility/AccessibilityMediaControls.cpp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -113,6 +113,8 @@
</span><span class="cx">     DEFINE_STATIC_LOCAL(const String, mediaStatusDisplayName, (&quot;StatusDisplay&quot;));
</span><span class="cx">     DEFINE_STATIC_LOCAL(const String, mediaCurrentTimeDisplay, (&quot;CurrentTimeDisplay&quot;));
</span><span class="cx">     DEFINE_STATIC_LOCAL(const String, mediaTimeRemainingDisplay, (&quot;TimeRemainingDisplay&quot;));
</span><ins>+    DEFINE_STATIC_LOCAL(const String, mediaShowClosedCaptionsButtonName, (&quot;ShowClosedCaptionsButton&quot;));
+    DEFINE_STATIC_LOCAL(const String, mediaHideClosedCaptionsButtonName, (&quot;HideClosedCaptionsButton&quot;));
</ins><span class="cx"> 
</span><span class="cx">     switch (controlType()) {
</span><span class="cx">     case MediaFullscreenButton:
</span><span class="lines">@@ -139,6 +141,10 @@
</span><span class="cx">         return mediaCurrentTimeDisplay;
</span><span class="cx">     case MediaTimeRemainingDisplay:
</span><span class="cx">         return mediaTimeRemainingDisplay;
</span><ins>+    case MediaShowClosedCaptionsButton:
+        return mediaShowClosedCaptionsButtonName;
+    case MediaHideClosedCaptionsButton:
+        return mediaHideClosedCaptionsButtonName;
</ins><span class="cx"> 
</span><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="lines">@@ -187,6 +193,8 @@
</span><span class="cx">     case MediaReturnToRealtimeButton:
</span><span class="cx">     case MediaUnMuteButton:
</span><span class="cx">     case MediaPauseButton:
</span><ins>+    case MediaShowClosedCaptionsButton:
+    case MediaHideClosedCaptionsButton:
</ins><span class="cx">         return ButtonRole;
</span><span class="cx"> 
</span><span class="cx">     case MediaStatusDisplay:
</span></span></pre></div>
<a id="trunkWebCorecssCSSPrimitiveValueMappingsh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/css/CSSPrimitiveValueMappings.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/css/CSSPrimitiveValueMappings.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/css/CSSPrimitiveValueMappings.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2007 Alexey Proskuryakov &lt;ap@nypop.com&gt;.
</span><del>- * Copyright (C) 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -230,6 +230,9 @@
</span><span class="cx">         case MediaReturnToRealtimeButtonPart:
</span><span class="cx">             m_value.ident = CSSValueMediaReturnToRealtimeButton;
</span><span class="cx">             break;
</span><ins>+        case MediaToggleClosedCaptionsButtonPart:
+            m_value.ident = CSSValueMediaToggleClosedCaptionsButton;
+            break;
</ins><span class="cx">         case MediaSliderPart:
</span><span class="cx">             m_value.ident = CSSValueMediaSlider;
</span><span class="cx">             break;
</span></span></pre></div>
<a id="trunkWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/css/CSSSelector.cpp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/css/CSSSelector.cpp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/css/CSSSelector.cpp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -116,6 +116,7 @@
</span><span class="cx">     DEFINE_STATIC_LOCAL(AtomicString, mediaControlsSeekForwardButton, (&quot;-webkit-media-controls-seek-forward-button&quot;));
</span><span class="cx">     DEFINE_STATIC_LOCAL(AtomicString, mediaControlsRewindButton, (&quot;-webkit-media-controls-rewind-button&quot;));
</span><span class="cx">     DEFINE_STATIC_LOCAL(AtomicString, mediaControlsReturnToRealtimeButton, (&quot;-webkit-media-controls-return-to-realtime-button&quot;));
</span><ins>+    DEFINE_STATIC_LOCAL(AtomicString, mediaControlsToggleClosedCaptionsButton, (&quot;-webkit-media-controls-toggle-closed-captions-button&quot;));
</ins><span class="cx">     DEFINE_STATIC_LOCAL(AtomicString, mediaControlsStatusDisplay, (&quot;-webkit-media-controls-status-display&quot;));
</span><span class="cx">     DEFINE_STATIC_LOCAL(AtomicString, mediaControlsFullscreenButton, (&quot;-webkit-media-controls-fullscreen-button&quot;));
</span><span class="cx">     DEFINE_STATIC_LOCAL(AtomicString, mediaControlsTimelineContainer, (&quot;-webkit-media-controls-timeline-container&quot;));
</span><span class="lines">@@ -271,6 +272,9 @@
</span><span class="cx">     } else if (m_value == mediaControlsReturnToRealtimeButton) {
</span><span class="cx">         m_pseudoType = PseudoMediaControlsReturnToRealtimeButton;
</span><span class="cx">         element = true;
</span><ins>+    } else if (m_value == mediaControlsToggleClosedCaptionsButton) {
+        m_pseudoType = PseudoMediaControlsToggleClosedCaptions;
+        element = true;
</ins><span class="cx">     } else if (m_value == mediaControlsStatusDisplay) {
</span><span class="cx">         m_pseudoType = PseudoMediaControlsStatusDisplay;
</span><span class="cx">         element = true;
</span></span></pre></div>
<a id="trunkWebCorecssCSSSelectorh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/css/CSSSelector.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/css/CSSSelector.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/css/CSSSelector.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -174,6 +174,7 @@
</span><span class="cx">             PseudoMediaControlsVolumeSliderContainer,
</span><span class="cx">             PseudoMediaControlsCurrentTimeDisplay,
</span><span class="cx">             PseudoMediaControlsTimeRemainingDisplay,
</span><ins>+            PseudoMediaControlsToggleClosedCaptions,
</ins><span class="cx">             PseudoMediaControlsTimeline,
</span><span class="cx">             PseudoMediaControlsVolumeSlider,
</span><span class="cx">             PseudoMediaControlsSeekBackButton,
</span></span></pre></div>
<a id="trunkWebCorecssCSSStyleSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/css/CSSStyleSelector.cpp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/css/CSSStyleSelector.cpp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/css/CSSStyleSelector.cpp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -2556,6 +2556,9 @@
</span><span class="cx">             case CSSSelector::PseudoMediaControlsReturnToRealtimeButton:
</span><span class="cx">                 dynamicPseudo = MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON;
</span><span class="cx">                 return true;
</span><ins>+            case CSSSelector::PseudoMediaControlsToggleClosedCaptions:
+                dynamicPseudo = MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON;
+                return true;
</ins><span class="cx">             case CSSSelector::PseudoMediaControlsStatusDisplay:
</span><span class="cx">                 dynamicPseudo = MEDIA_CONTROLS_STATUS_DISPLAY;
</span><span class="cx">                 return true;
</span></span></pre></div>
<a id="trunkWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/css/CSSValueKeywords.in (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/css/CSSValueKeywords.in        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/css/CSSValueKeywords.in        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -511,6 +511,7 @@
</span><span class="cx"> media-seek-forward-button
</span><span class="cx"> media-rewind-button
</span><span class="cx"> media-return-to-realtime-button
</span><ins>+media-toggle-closed-captions-button
</ins><span class="cx"> media-slider
</span><span class="cx"> media-sliderthumb
</span><span class="cx"> media-volume-slider-container
</span></span></pre></div>
<a id="trunkWebCorecssmediaControlscss"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/css/mediaControls.css (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/css/mediaControls.css        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/css/mediaControls.css        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -124,3 +124,7 @@
</span><span class="cx"> audio::-webkit-media-controls-return-to-realtime-button, video::-webkit-media-controls-return-to-realtime-button {
</span><span class="cx">     display: none;
</span><span class="cx"> }
</span><ins>+
+audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button {
+    display: none;
+}
</ins></span></pre></div>
<a id="trunkWebCorecssmediaControlsQuickTimecss"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/css/mediaControlsQuickTime.css (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/css/mediaControlsQuickTime.css        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/css/mediaControlsQuickTime.css        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx">     height: 16px;
</span><span class="cx">     margin-left: 7px;
</span><span class="cx">     margin-right: 7px;
</span><del>-    -webkit-box-ordinal-group: 3; /* At the very end */
</del><ins>+    -webkit-box-ordinal-group: 4; /* At the very end */
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> audio::-webkit-media-controls-rewind-button, video::-webkit-media-controls-rewind-button {
</span><span class="lines">@@ -175,3 +175,13 @@
</span><span class="cx">     text-indent: 0;
</span><span class="cx">     text-decoration: none;
</span><span class="cx"> }
</span><ins>+
+audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button {
+    -webkit-appearance: media-toggle-closed-captions-button;
+    display: -webkit-box;
+    width: 16px;
+    height: 16px;
+    margin-left: 7px;
+    margin-right: 7px;
+    -webkit-box-ordinal-group: 3; /* between mute and fullscreen */
+}
</ins></span></pre></div>
<a id="trunkWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLMediaElement.cpp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLMediaElement.cpp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/html/HTMLMediaElement.cpp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -117,6 +117,7 @@
</span><span class="cx">     , m_pausedInternal(false)
</span><span class="cx">     , m_sendProgressEvents(true)
</span><span class="cx">     , m_isFullscreen(false)
</span><ins>+    , m_closedCaptionsVisible(false)
</ins><span class="cx"> #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
</span><span class="cx">     , m_needWidgetUpdate(false)
</span><span class="cx"> #endif
</span><span class="lines">@@ -482,6 +483,7 @@
</span><span class="cx">     m_autoplaying = true;
</span><span class="cx">     m_playedTimeRanges = TimeRanges::create();
</span><span class="cx">     m_lastSeekTime = 0;
</span><ins>+    m_closedCaptionsVisible = false;
</ins><span class="cx"> 
</span><span class="cx">     // 6
</span><span class="cx">     setPlaybackRate(defaultPlaybackRate());
</span><span class="lines">@@ -1852,6 +1854,43 @@
</span><span class="cx">     return m_isFullscreen;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool HTMLMediaElement::hasClosedCaptions() const
+{
+    return m_player &amp;&amp; m_player-&gt;hasClosedCaptions();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool HTMLMediaElement::closedCaptionsVisible() const
+{
+    return m_closedCaptionsVisible;
+}
+
+void HTMLMediaElement::setClosedCaptionsVisible(bool closedCaptionVisible)
+{
+    if (!m_player ||!hasClosedCaptions())
+        return;
+
+    m_closedCaptionsVisible = closedCaptionVisible;
+    m_player-&gt;setClosedCaptionsVisible(closedCaptionVisible);
+    if (renderer())
+        renderer()-&gt;updateFromElement();
+}
+
+void HTMLMediaElement::setWebkitClosedCaptionsVisible(bool visible)
+{
+    setClosedCaptionsVisible(visible);
+}
+
+bool HTMLMediaElement::webkitClosedCaptionsVisible() const
+{
+    return closedCaptionsVisible();
+}
+
+
+bool HTMLMediaElement::webkitHasClosedCaptions() const
+{
+    return hasClosedCaptions();
+}
+
+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLMediaElement.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLMediaElement.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/html/HTMLMediaElement.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -137,7 +137,12 @@
</span><span class="cx">     void webkitExitFullScreen();
</span><span class="cx">     bool webkitSupportsFullscreen();
</span><span class="cx">     bool webkitDisplayingFullscreen();
</span><del>-    
</del><ins>+
+// captions
+    bool webkitHasClosedCaptions() const;
+    bool webkitClosedCaptionsVisible() const;
+    void setWebkitClosedCaptionsVisible(bool);
+
</ins><span class="cx"> // controls
</span><span class="cx">     bool controls() const;
</span><span class="cx">     void setControls(bool);
</span><span class="lines">@@ -168,6 +173,10 @@
</span><span class="cx">     void enterFullscreen();
</span><span class="cx">     void exitFullscreen();
</span><span class="cx"> 
</span><ins>+    bool hasClosedCaptions() const;
+    bool closedCaptionsVisible() const;
+    void setClosedCaptionsVisible(bool);
+
</ins><span class="cx"> protected:
</span><span class="cx">     float getTimeOffsetAttribute(const QualifiedName&amp;, float valueOnError) const;
</span><span class="cx">     void setTimeOffsetAttribute(const QualifiedName&amp;, float value);
</span><span class="lines">@@ -325,6 +334,7 @@
</span><span class="cx">     bool m_sendProgressEvents : 1;
</span><span class="cx"> 
</span><span class="cx">     bool m_isFullscreen : 1;
</span><ins>+    bool m_closedCaptionsVisible : 1;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
</span><span class="cx">     bool m_needWidgetUpdate : 1;
</span></span></pre></div>
<a id="trunkWebCorehtmlHTMLMediaElementidl"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLMediaElement.idl (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLMediaElement.idl        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/html/HTMLMediaElement.idl        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -86,5 +86,8 @@
</span><span class="cx">     void webkitEnterFullScreen()
</span><span class="cx">         raises (DOMException);
</span><span class="cx">     void webkitExitFullScreen();
</span><ins>+
+    readonly attribute boolean webkitHasClosedCaptions;
+    attribute boolean webkitClosedCaptionsVisible;
</ins><span class="cx"> };
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebCoreplatformThemeTypesh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/ThemeTypes.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/ThemeTypes.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/platform/ThemeTypes.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     NoControlPart, CheckboxPart, RadioPart, PushButtonPart, SquareButtonPart, ButtonPart,
</span><span class="cx">     ButtonBevelPart, DefaultButtonPart, ListButtonPart, ListboxPart, ListItemPart,
</span><span class="cx">     MediaFullscreenButtonPart, MediaMuteButtonPart, MediaPlayButtonPart, MediaSeekBackButtonPart, 
</span><del>-    MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart,
</del><ins>+    MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart, MediaToggleClosedCaptionsButtonPart,
</ins><span class="cx">     MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart,
</span><span class="cx">     MediaControlsBackgroundPart, MediaCurrentTimePart, MediaTimeRemainingPart,
</span><span class="cx">     MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart,
</span></span></pre></div>
<a id="trunkWebCoreplatformandroidLocalizedStringsAndroidcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/android/LocalizedStringsAndroid.cpp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/android/LocalizedStringsAndroid.cpp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/platform/android/LocalizedStringsAndroid.cpp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -279,6 +279,24 @@
</span><span class="cx">     return String();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String localizedMediaControlElementString(const String&amp; controlName)
+{
+    notImplemented();
+    return String();
+}
+
+String localizedMediaControlElementHelpText(const String&amp; controlName)
+{
+    notImplemented();
+    return String();
+}
+
+String localizedMediaTimeDescription(const String&amp; controlName)
+{
+    notImplemented();
+    return String();
+}
+
</ins><span class="cx"> String searchableIndexIntroduction()
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span></span></pre></div>
<a id="trunkWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/graphics/MediaPlayer.cpp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/graphics/MediaPlayer.cpp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/platform/graphics/MediaPlayer.cpp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -89,6 +89,9 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void setVolume(float) { }
</span><span class="cx"> 
</span><ins>+    virtual bool hasClosedCaptions() const { return false; }
+    virtual void setClosedCaptionsVisible(bool) { };
+
</ins><span class="cx">     virtual MediaPlayer::NetworkState networkState() const { return MediaPlayer::Empty; }
</span><span class="cx">     virtual MediaPlayer::ReadyState readyState() const { return MediaPlayer::HaveNothing; }
</span><span class="cx"> 
</span><span class="lines">@@ -375,6 +378,16 @@
</span><span class="cx">     m_private-&gt;setVolume(volume);   
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool MediaPlayer::hasClosedCaptions() const
+{
+    return m_private-&gt;hasClosedCaptions();
+}
+
+void MediaPlayer::setClosedCaptionsVisible(bool closedCaptionsVisible)
+{
+    m_private-&gt;setClosedCaptionsVisible(closedCaptionsVisible);
+}
+
</ins><span class="cx"> float MediaPlayer::rate() const
</span><span class="cx"> {
</span><span class="cx">     return m_rate;
</span></span></pre></div>
<a id="trunkWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/graphics/MediaPlayer.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/graphics/MediaPlayer.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/platform/graphics/MediaPlayer.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -180,7 +180,10 @@
</span><span class="cx">     
</span><span class="cx">     float volume() const;
</span><span class="cx">     void setVolume(float);
</span><del>-    
</del><ins>+
+    bool hasClosedCaptions() const;
+    void setClosedCaptionsVisible(bool closedCaptionsVisible);
+
</ins><span class="cx">     int dataRate() const;
</span><span class="cx"> 
</span><span class="cx">     bool autobuffer() const;    
</span></span></pre></div>
<a id="trunkWebCoreplatformgraphicsMediaPlayerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/graphics/MediaPlayerPrivate.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/graphics/MediaPlayerPrivate.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/platform/graphics/MediaPlayerPrivate.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -76,6 +76,9 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void setVolume(float) = 0;
</span><span class="cx"> 
</span><ins>+    virtual bool hasClosedCaptions() const { return false; }    
+    virtual void setClosedCaptionsVisible(bool) { }
+
</ins><span class="cx">     virtual MediaPlayer::NetworkState networkState() const = 0;
</span><span class="cx">     virtual MediaPlayer::ReadyState readyState() const = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoreplatformgraphicsmacMediaPlayerPrivateQTKith"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -101,6 +101,9 @@
</span><span class="cx">     void setVolume(float);
</span><span class="cx">     void setPreservesPitch(bool);
</span><span class="cx"> 
</span><ins>+    bool hasClosedCaptions() const;
+    void setClosedCaptionsVisible(bool);
+
</ins><span class="cx">     void setEndTime(float time);
</span><span class="cx"> 
</span><span class="cx">     int dataRate() const;
</span></span></pre></div>
<a id="trunkWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -746,6 +746,27 @@
</span><span class="cx">         [m_qtMovie.get() setVolume:volume];  
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool MediaPlayerPrivate::hasClosedCaptions() const
+{
+    if (!metaDataAvailable())
+        return false;
+    return wkQTMovieHasClosedCaptions(m_qtMovie.get());  
+}
+
+void MediaPlayerPrivate::setClosedCaptionsVisible(bool closedCaptionsVisible)
+{
+    if (metaDataAvailable()) {
+        wkQTMovieSetShowClosedCaptions(m_qtMovie.get(), closedCaptionsVisible);
+
+#if USE(ACCELERATED_COMPOSITING) &amp;&amp; (!defined(BUILDING_ON_TIGER) &amp;&amp; !defined(BUILDING_ON_LEOPARD))
+    if (closedCaptionsVisible &amp;&amp; m_qtVideoLayer) {
+        // Captions will be rendered upsided down unless we flag the movie as flipped (again). See &lt;rdar://7408440&gt;.
+        [m_qtVideoLayer.get() setGeometryFlipped:YES];
+    }
+#endif
+    }
+}
+
</ins><span class="cx"> void MediaPlayerPrivate::setRate(float rate)
</span><span class="cx"> {
</span><span class="cx">     if (m_qtMovie)
</span></span></pre></div>
<a id="trunkWebCoreplatformgtkLocalizedStringsGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/gtk/LocalizedStringsGtk.cpp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/gtk/LocalizedStringsGtk.cpp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/platform/gtk/LocalizedStringsGtk.cpp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -392,6 +392,10 @@
</span><span class="cx">         return String::fromUTF8(_(&quot;fast forward&quot;));
</span><span class="cx">     if (name == &quot;SeekBackButton&quot;)
</span><span class="cx">         return String::fromUTF8(_(&quot;fast reverse&quot;));
</span><ins>+    if (name == &quot;ShowClosedCaptionsButton&quot;)
+        return String::fromUTF8(_(&quot;show closed captions&quot;));
+    if (name == &quot;HideClosedCaptionsButton&quot;)
+        return String::fromUTF8(_(&quot;hide closed captions&quot;));
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return String();
</span><span class="lines">@@ -431,6 +435,10 @@
</span><span class="cx">         return String::fromUTF8(_(&quot;seek quickly forward&quot;));
</span><span class="cx">     if (name == &quot;FullscreenButton&quot;)
</span><span class="cx">         return String::fromUTF8(_(&quot;Play movie in fullscreen mode&quot;));
</span><ins>+    if (name == &quot;ShowClosedCaptionsButton&quot;)
+        return String::fromUTF8(_(&quot;start displaying closed captions&quot;));
+    if (name == &quot;HideClosedCaptionsButton&quot;)
+        return String::fromUTF8(_(&quot;stop displaying closed captions&quot;));
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return String();
</span></span></pre></div>
<a id="trunkWebCoreplatformmacWebCoreSystemInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/mac/WebCoreSystemInterface.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/mac/WebCoreSystemInterface.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/platform/mac/WebCoreSystemInterface.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -125,6 +125,8 @@
</span><span class="cx"> extern NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
</span><span class="cx"> extern float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
</span><span class="cx"> extern int (*wkQTMovieGetType)(QTMovie* movie);
</span><ins>+extern BOOL (*wkQTMovieHasClosedCaptions)(QTMovie* movie);
+extern void (*wkQTMovieSetShowClosedCaptions)(QTMovie* movie, BOOL showClosedCaptions);
</ins><span class="cx"> extern void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
</span><span class="cx"> extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
</span><span class="cx"> extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
</span></span></pre></div>
<a id="trunkWebCoreplatformmacWebCoreSystemInterfacemm"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/mac/WebCoreSystemInterface.mm (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/mac/WebCoreSystemInterface.mm        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/platform/mac/WebCoreSystemInterface.mm        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -59,6 +59,8 @@
</span><span class="cx"> NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
</span><span class="cx"> float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
</span><span class="cx"> int (*wkQTMovieGetType)(QTMovie* movie);
</span><ins>+BOOL (*wkQTMovieHasClosedCaptions)(QTMovie* movie);
+void (*wkQTMovieSetShowClosedCaptions)(QTMovie* movie, BOOL showClosedCaptions);
</ins><span class="cx"> void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
</span><span class="cx"> void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
</span><span class="cx"> void (*wkSetDragImage)(NSImage*, NSPoint offset);
</span></span></pre></div>
<a id="trunkWebCorerenderingMediaControlElementscpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/MediaControlElements.cpp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/MediaControlElements.cpp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/rendering/MediaControlElements.cpp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -348,6 +348,9 @@
</span><span class="cx">     case MEDIA_CONTROLS_VOLUME_SLIDER:
</span><span class="cx">         m_displayType = MediaVolumeSlider;
</span><span class="cx">         break;
</span><ins>+    case MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON:
+        m_displayType = MediaShowClosedCaptionsButton;
+        break;
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">         break;
</span><span class="lines">@@ -578,6 +581,29 @@
</span><span class="cx"> 
</span><span class="cx"> // ----------------------------
</span><span class="cx"> 
</span><ins>+MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement(Document* doc, HTMLMediaElement* element)
+    : MediaControlInputElement(doc, MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON, &quot;button&quot;, element)
+{
+}
+
+void MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler(Event* event)
+{
+    if (event-&gt;type() == eventNames().clickEvent) {
+        m_mediaElement-&gt;setClosedCaptionsVisible(!m_mediaElement-&gt;closedCaptionsVisible());
+        setChecked(m_mediaElement-&gt;closedCaptionsVisible());
+        event-&gt;setDefaultHandled();
+    }
+    HTMLInputElement::defaultEventHandler(event);
+}
+
+void MediaControlToggleClosedCaptionsButtonElement::updateDisplayType()
+{
+    setDisplayType(m_mediaElement-&gt;closedCaptionsVisible() ? MediaHideClosedCaptionsButton : MediaShowClosedCaptionsButton);
+}
+
+
+// ----------------------------
+
</ins><span class="cx"> MediaControlTimelineElement::MediaControlTimelineElement(Document* document, HTMLMediaElement* element)
</span><span class="cx">     : MediaControlInputElement(document, MEDIA_CONTROLS_TIMELINE, &quot;range&quot;, element)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkWebCorerenderingMediaControlElementsh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/MediaControlElements.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/MediaControlElements.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/rendering/MediaControlElements.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -54,6 +54,8 @@
</span><span class="cx">     MediaSliderThumb,
</span><span class="cx">     MediaRewindButton,
</span><span class="cx">     MediaReturnToRealtimeButton,
</span><ins>+    MediaShowClosedCaptionsButton,
+    MediaHideClosedCaptionsButton,
</ins><span class="cx">     MediaUnMuteButton,
</span><span class="cx">     MediaPauseButton,
</span><span class="cx">     MediaTimelineContainer,
</span><span class="lines">@@ -221,6 +223,15 @@
</span><span class="cx"> 
</span><span class="cx"> // ----------------------------
</span><span class="cx"> 
</span><ins>+class MediaControlToggleClosedCaptionsButtonElement : public MediaControlInputElement {
+public:
+    MediaControlToggleClosedCaptionsButtonElement(Document*, HTMLMediaElement*);
+    virtual void defaultEventHandler(Event*);
+    virtual void updateDisplayType();
+};    
+
+// ----------------------------
+
</ins><span class="cx"> class MediaControlTimelineElement : public MediaControlInputElement {
</span><span class="cx"> public:
</span><span class="cx">     MediaControlTimelineElement(Document*, HTMLMediaElement*);
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderMediacpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderMedia.cpp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderMedia.cpp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/rendering/RenderMedia.cpp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -121,6 +121,8 @@
</span><span class="cx">             m_rewindButton-&gt;updateStyle();
</span><span class="cx">         if (m_returnToRealtimeButton)
</span><span class="cx">             m_returnToRealtimeButton-&gt;updateStyle();
</span><ins>+        if (m_toggleClosedCaptionsButton)
+            m_toggleClosedCaptionsButton-&gt;updateStyle();
</ins><span class="cx">         if (m_statusDisplay)
</span><span class="cx">             m_statusDisplay-&gt;updateStyle();
</span><span class="cx">         if (m_timelineContainer)
</span><span class="lines">@@ -223,6 +225,13 @@
</span><span class="cx">     m_returnToRealtimeButton-&gt;attachToParent(m_panel.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void RenderMedia::createToggleClosedCaptionsButton()
+{
+    ASSERT(!m_toggleClosedCaptionsButton);
+    m_toggleClosedCaptionsButton = new MediaControlToggleClosedCaptionsButtonElement(document(), mediaElement());
+    m_toggleClosedCaptionsButton-&gt;attachToParent(m_panel.get());
+}
+
</ins><span class="cx"> void RenderMedia::createStatusDisplay()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_statusDisplay);
</span><span class="lines">@@ -310,6 +319,7 @@
</span><span class="cx">             m_volumeSliderContainer = 0;
</span><span class="cx">             m_volumeSlider = 0;
</span><span class="cx">             m_controlsShadowRoot = 0;
</span><ins>+            m_toggleClosedCaptionsButton = 0;
</ins><span class="cx">         }
</span><span class="cx">         m_opacityAnimationTo = 1.0f;
</span><span class="cx">         m_opacityAnimationTimer.stop();
</span><span class="lines">@@ -324,6 +334,7 @@
</span><span class="cx">             createRewindButton();
</span><span class="cx">             createPlayButton();
</span><span class="cx">             createReturnToRealtimeButton();
</span><ins>+            createToggleClosedCaptionsButton();
</ins><span class="cx">             createStatusDisplay();
</span><span class="cx">             createTimelineContainer();
</span><span class="cx">             if (m_timelineContainer) {
</span><span class="lines">@@ -379,6 +390,8 @@
</span><span class="cx">         m_rewindButton-&gt;update();
</span><span class="cx">     if (m_returnToRealtimeButton)
</span><span class="cx">         m_returnToRealtimeButton-&gt;update();
</span><ins>+    if (m_toggleClosedCaptionsButton)
+        m_toggleClosedCaptionsButton-&gt;update();
</ins><span class="cx">     if (m_statusDisplay)
</span><span class="cx">         m_statusDisplay-&gt;update();
</span><span class="cx">     if (m_fullscreenButton)
</span><span class="lines">@@ -535,6 +548,9 @@
</span><span class="cx">         if (m_returnToRealtimeButton &amp;&amp; m_returnToRealtimeButton-&gt;hitTest(point))
</span><span class="cx">             m_returnToRealtimeButton-&gt;defaultEventHandler(event);
</span><span class="cx"> 
</span><ins>+       if (m_toggleClosedCaptionsButton &amp;&amp; m_toggleClosedCaptionsButton-&gt;hitTest(point))
+            m_toggleClosedCaptionsButton-&gt;defaultEventHandler(event);
+
</ins><span class="cx">         if (m_timeline &amp;&amp; m_timeline-&gt;hitTest(point))
</span><span class="cx">             m_timeline-&gt;defaultEventHandler(event);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderMediah"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderMedia.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderMedia.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/rendering/RenderMedia.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> class MediaControlSeekButtonElement;
</span><span class="cx"> class MediaControlRewindButtonElement;
</span><span class="cx"> class MediaControlReturnToRealtimeButtonElement;
</span><ins>+class MediaControlToggleClosedCaptionsButtonElement;
</ins><span class="cx"> class MediaControlTimelineElement;
</span><span class="cx"> class MediaControlVolumeSliderElement;
</span><span class="cx"> class MediaControlFullscreenButtonElement;
</span><span class="lines">@@ -96,6 +97,7 @@
</span><span class="cx">     void createSeekForwardButton();
</span><span class="cx">     void createRewindButton();
</span><span class="cx">     void createReturnToRealtimeButton();
</span><ins>+    void createToggleClosedCaptionsButton();
</ins><span class="cx">     void createStatusDisplay();
</span><span class="cx">     void createTimelineContainer();
</span><span class="cx">     void createTimeline();
</span><span class="lines">@@ -123,6 +125,7 @@
</span><span class="cx">     RefPtr&lt;MediaControlSeekButtonElement&gt; m_seekForwardButton;
</span><span class="cx">     RefPtr&lt;MediaControlRewindButtonElement&gt; m_rewindButton;
</span><span class="cx">     RefPtr&lt;MediaControlReturnToRealtimeButtonElement&gt; m_returnToRealtimeButton;
</span><ins>+    RefPtr&lt;MediaControlToggleClosedCaptionsButtonElement&gt; m_toggleClosedCaptionsButton;
</ins><span class="cx">     RefPtr&lt;MediaControlTimelineElement&gt; m_timeline;
</span><span class="cx">     RefPtr&lt;MediaControlVolumeSliderElement&gt; m_volumeSlider;
</span><span class="cx">     RefPtr&lt;MediaControlFullscreenButtonElement&gt; m_fullscreenButton;
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderThemecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderTheme.cpp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderTheme.cpp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/rendering/RenderTheme.cpp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /**
</span><span class="cx">  * This file is part of the theme implementation for form controls in WebCore.
</span><span class="cx">  *
</span><del>- * Copyright (C) 2005, 2006, 2007, 2008 Apple Computer, Inc.
</del><ins>+ * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Computer, Inc.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -278,6 +278,8 @@
</span><span class="cx">             return paintMediaRewindButton(o, paintInfo, r);
</span><span class="cx">         case MediaReturnToRealtimeButtonPart:
</span><span class="cx">             return paintMediaReturnToRealtimeButton(o, paintInfo, r);
</span><ins>+        case MediaToggleClosedCaptionsButtonPart:
+            return paintMediaToggleClosedCaptionsButton(o, paintInfo, r);
</ins><span class="cx">         case MediaSliderPart:
</span><span class="cx">             return paintMediaSliderTrack(o, paintInfo, r);
</span><span class="cx">         case MediaSliderThumbPart:
</span><span class="lines">@@ -416,6 +418,8 @@
</span><span class="cx">         return mediaElement-&gt;movieLoadType() == MediaPlayer::LiveStream;
</span><span class="cx">     case MediaFullscreenButtonPart:
</span><span class="cx">         return mediaElement-&gt;supportsFullscreen();
</span><ins>+    case MediaToggleClosedCaptionsButtonPart:
+        return mediaElement-&gt;hasClosedCaptions();
</ins><span class="cx">     default:
</span><span class="cx">         return true;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderThemeh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderTheme.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderTheme.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/rendering/RenderTheme.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -250,6 +250,7 @@
</span><span class="cx">     virtual bool paintMediaVolumeSliderThumb(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;) { return true; }
</span><span class="cx">     virtual bool paintMediaRewindButton(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;) { return true; }
</span><span class="cx">     virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;) { return true; }
</span><ins>+    virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;) { return true; }
</ins><span class="cx">     virtual bool paintMediaControlsBackground(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;) { return true; }
</span><span class="cx">     virtual bool paintMediaCurrentTime(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;) { return true; }
</span><span class="cx">     virtual bool paintMediaTimeRemaining(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;) { return true; }
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderThemeMach"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderThemeMac.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderThemeMac.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/rendering/RenderThemeMac.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -126,6 +126,7 @@
</span><span class="cx">     virtual bool paintMediaSliderThumb(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;);
</span><span class="cx">     virtual bool paintMediaRewindButton(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;);
</span><span class="cx">     virtual bool paintMediaReturnToRealtimeButton(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;);
</span><ins>+    virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;);
</ins><span class="cx">     virtual bool paintMediaControlsBackground(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;);
</span><span class="cx">     virtual bool paintMediaCurrentTime(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;);
</span><span class="cx">     virtual bool paintMediaTimeRemaining(RenderObject*, const RenderObject::PaintInfo&amp;, const IntRect&amp;);
</span></span></pre></div>
<a id="trunkWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/RenderThemeMac.mm (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/RenderThemeMac.mm        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/rendering/RenderThemeMac.mm        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -1644,7 +1644,22 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RenderThemeMac::paintMediaToggleClosedCaptionsButton(RenderObject* o, const RenderObject::PaintInfo&amp; paintInfo, const IntRect&amp; r)
+{
+    HTMLInputElement* node = static_cast&lt;HTMLInputElement*&gt;(o-&gt;node());
+    if (!node)
+        return false;
+    
+    MediaControlToggleClosedCaptionsButtonElement* btn = static_cast&lt;MediaControlToggleClosedCaptionsButtonElement*&gt;(node);
+    if (!btn)
+        return false;
</ins><span class="cx"> 
</span><ins>+    LocalCurrentGraphicsContext localContext(paintInfo.context);
+    wkDrawMediaUIPart(btn-&gt;displayType(), mediaControllerTheme(), paintInfo.context-&gt;platformContext(), r, getMediaUIPartStateFlags(node));
+
+    return false;
+}

</ins><span class="cx"> bool RenderThemeMac::paintMediaControlsBackground(RenderObject* o, const RenderObject::PaintInfo&amp; paintInfo, const IntRect&amp; r)
</span><span class="cx"> {
</span><span class="cx">     Node* node = o-&gt;node();
</span><span class="lines">@@ -1690,12 +1705,20 @@
</span><span class="cx">         return String();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderThemeMac::shouldRenderMediaControlPart(ControlPart part, Element* e)
</del><ins>+bool RenderThemeMac::shouldRenderMediaControlPart(ControlPart part, Element* element)
</ins><span class="cx"> {
</span><span class="cx">     if (part == MediaFullscreenButtonPart)
</span><span class="cx">         return mediaControllerTheme() == MediaControllerThemeQuickTime;
</span><span class="cx"> 
</span><del>-    return RenderTheme::shouldRenderMediaControlPart(part, e);
</del><ins>+    if (part == MediaToggleClosedCaptionsButtonPart) {
+
+        // We rely on QTKit to render captions so don't enable the button unless it will be able to do so.
+        HTMLMediaElement* mediaElement = static_cast&lt;HTMLMediaElement*&gt;(element);
+        if (mediaControllerTheme() != MediaControllerThemeQuickTime || !element-&gt;hasTagName(videoTag) || !mediaElement-&gt;hasVideo())
+            return false;
+    }
+
+    return RenderTheme::shouldRenderMediaControlPart(part, element);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(VIDEO)
</span></span></pre></div>
<a id="trunkWebCorerenderingstyleRenderStyleConstantsh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/rendering/style/RenderStyleConstants.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/rendering/style/RenderStyleConstants.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebCore/rendering/style/RenderStyleConstants.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 2000 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2000 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
</span><span class="cx">  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx">  *
</span><span class="lines">@@ -69,8 +69,9 @@
</span><span class="cx">     NOPSEUDO, FIRST_LINE, FIRST_LETTER, BEFORE, AFTER, SELECTION, FIRST_LINE_INHERITED, SCROLLBAR, FILE_UPLOAD_BUTTON, INPUT_PLACEHOLDER,
</span><span class="cx">     SLIDER_THUMB, SEARCH_CANCEL_BUTTON, SEARCH_DECORATION, SEARCH_RESULTS_DECORATION, SEARCH_RESULTS_BUTTON, MEDIA_CONTROLS_PANEL,
</span><span class="cx">     MEDIA_CONTROLS_PLAY_BUTTON, MEDIA_CONTROLS_MUTE_BUTTON, MEDIA_CONTROLS_TIMELINE, MEDIA_CONTROLS_TIMELINE_CONTAINER,
</span><del>-    MEDIA_CONTROLS_VOLUME_SLIDER, MEDIA_CONTROLS_VOLUME_SLIDER_CONTAINER, MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY, MEDIA_CONTROLS_SEEK_BACK_BUTTON,
-    MEDIA_CONTROLS_SEEK_FORWARD_BUTTON, MEDIA_CONTROLS_FULLSCREEN_BUTTON, MEDIA_CONTROLS_REWIND_BUTTON, MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON,
</del><ins>+    MEDIA_CONTROLS_VOLUME_SLIDER, MEDIA_CONTROLS_VOLUME_SLIDER_CONTAINER, MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY, 
+    MEDIA_CONTROLS_SEEK_BACK_BUTTON, MEDIA_CONTROLS_SEEK_FORWARD_BUTTON, MEDIA_CONTROLS_FULLSCREEN_BUTTON, MEDIA_CONTROLS_REWIND_BUTTON, 
+    MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON, MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON,
</ins><span class="cx">     MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER,
</span><span class="cx">     INPUT_LIST_BUTTON,
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/ChangeLog (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/ChangeLog        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebKit/ChangeLog        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        Reviewed by Dan Bernstein.
+
+        &lt;rdar://problem/7035231&gt;
+        Support closed caption in &lt;video&gt; element
+
+        * English.lproj/Localizable.strings:
+            Add strings for toggle captions button.
+
</ins><span class="cx"> 2009-11-18  Michelangelo De Simone  &lt;micdesim@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Adler.
</span></span></pre></div>
<a id="trunkWebKitEnglishlprojLocalizablestrings"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/English.lproj/Localizable.strings (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/English.lproj/Localizable.strings        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebKit/English.lproj/Localizable.strings        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -556,6 +556,9 @@
</span><span class="cx"> /* accessibility role description for headings */
</span><span class="cx"> &quot;heading&quot; = &quot;heading&quot;;
</span><span class="cx"> 
</span><ins>+/* accessibility role description for hide closed captions button */
+&quot;hide closed captions&quot; = &quot;hide closed captions&quot;;
+
</ins><span class="cx"> /* accessibility role description for image map */
</span><span class="cx"> &quot;image map&quot; = &quot;image map&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -733,12 +736,21 @@
</span><span class="cx"> /* HTTP result code string */
</span><span class="cx"> &quot;service unavailable&quot; = &quot;service unavailable&quot;;
</span><span class="cx"> 
</span><ins>+/* accessibility role description for show closed captions button */
+&quot;show closed captions&quot; = &quot;show closed captions&quot;;
+
+/* accessibility help text for show closed captions button */
+&quot;start displaying closed captions&quot; = &quot;start displaying closed captions&quot;;
+
</ins><span class="cx"> /* accessibility role description for movie status */
</span><span class="cx"> &quot;status&quot; = &quot;status&quot;;
</span><span class="cx"> 
</span><span class="cx"> /* Validation message for input form controls with value not respecting the step attribute */
</span><span class="cx"> &quot;step mismatch&quot; = &quot;step mismatch&quot;;
</span><span class="cx"> 
</span><ins>+/* accessibility help text for hide closed captions button */
+&quot;stop displaying closed captions&quot; = &quot;stop displaying closed captions&quot;;
+
</ins><span class="cx"> /* HTTP result code string */
</span><span class="cx"> &quot;success&quot; = &quot;success&quot;;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebKit/mac/ChangeLog        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        Reviewed by Dan Bernstein.
+
+        &lt;rdar://problem/7035231&gt;
+        Support closed caption in &lt;video&gt; element
+
+        * WebCoreSupport/WebSystemInterface.m:
+        (InitWebCoreSystemInterface):
+            Add QTMovieHasClosedCaptions and QTMovieSetShowClosedCaptions.
+
+        * WebCoreSupport/WebViewFactory.mm:
+        (-[WebViewFactory localizedMediaControlElementString:]):
+        (-[WebViewFactory localizedMediaControlElementHelpText:]):
+            Add accessibility help strings for media controller closed caption button.
+
</ins><span class="cx"> 2009-11-18  Michelangelo De Simone  &lt;micdesim@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Adler.
</span></span></pre></div>
<a id="trunkWebKitmacWebCoreSupportWebSystemInterfacem"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebCoreSupport/WebSystemInterface.m (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebCoreSupport/WebSystemInterface.m        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebKit/mac/WebCoreSupport/WebSystemInterface.m        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -80,6 +80,8 @@
</span><span class="cx">     INIT(QTMovieMaxTimeLoadedChangeNotification);
</span><span class="cx">     INIT(QTMovieMaxTimeSeekable);
</span><span class="cx">     INIT(QTMovieGetType);
</span><ins>+    INIT(QTMovieHasClosedCaptions);
+    INIT(QTMovieSetShowClosedCaptions);
</ins><span class="cx">     INIT(QTMovieViewSetDrawSynchronously);
</span><span class="cx"> 
</span><span class="cx"> #ifndef BUILDING_ON_TIGER
</span></span></pre></div>
<a id="trunkWebKitmacWebCoreSupportWebViewFactorymm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebCoreSupport/WebViewFactory.mm (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebCoreSupport/WebViewFactory.mm        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebKit/mac/WebCoreSupport/WebViewFactory.mm        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -692,6 +692,11 @@
</span><span class="cx">         return UI_STRING(&quot;fast forward&quot;, &quot;accessibility role description for fast forward button&quot;);
</span><span class="cx">     if ([name isEqualToString:@&quot;SeekBackButton&quot;])
</span><span class="cx">         return UI_STRING(&quot;fast reverse&quot;, &quot;accessibility role description for fast reverse button&quot;);
</span><ins>+    if ([name isEqualToString:@&quot;ShowClosedCaptionsButton&quot;])
+        return UI_STRING(&quot;show closed captions&quot;, &quot;accessibility role description for show closed captions button&quot;);
+    if ([name isEqualToString:@&quot;HideClosedCaptionsButton&quot;])
+        return UI_STRING(&quot;hide closed captions&quot;, &quot;accessibility role description for hide closed captions button&quot;);
+
</ins><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return @&quot;&quot;;
</span><span class="cx"> }
</span><span class="lines">@@ -731,6 +736,10 @@
</span><span class="cx">         return UI_STRING(&quot;seek quickly forward&quot;, &quot;accessibility help text for fast forward button&quot;);
</span><span class="cx">     if ([name isEqualToString:@&quot;FullscreenButton&quot;])
</span><span class="cx">         return UI_STRING(&quot;Play movie in fullscreen mode&quot;, &quot;accessibility help text for enter fullscreen button&quot;);
</span><ins>+    if ([name isEqualToString:@&quot;ShowClosedCaptionsButton&quot;])
+        return UI_STRING(&quot;start displaying closed captions&quot;, &quot;accessibility help text for show closed captions button&quot;);
+    if ([name isEqualToString:@&quot;HideClosedCaptionsButton&quot;])
+        return UI_STRING(&quot;stop displaying closed captions&quot;, &quot;accessibility help text for hide closed captions button&quot;);
</ins><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return @&quot;&quot;;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/ChangeLog (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/ChangeLog        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebKit/win/ChangeLog        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        Reviewed by Dan Bernstein.
+
+        &lt;rdar://problem/7035231&gt;
+        Support closed caption in &lt;video&gt; element
+
+        * WebCoreLocalizedStrings.cpp:
+        (WebCore::localizedMediaControlElementString):
+        (WebCore::localizedMediaControlElementHelpText):
+            Add accessibility help strings for media controller closed caption button.
+
</ins><span class="cx"> 2009-11-18  Michelangelo De Simone  &lt;micdesim@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Adler.
</span></span></pre></div>
<a id="trunkWebKitwinWebCoreLocalizedStringscpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/win/WebCoreLocalizedStrings.cpp (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/win/WebCoreLocalizedStrings.cpp        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebKit/win/WebCoreLocalizedStrings.cpp        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -151,6 +151,10 @@
</span><span class="cx">         return String(LPCTSTR_UI_STRING(&quot;fast forward&quot;, &quot;accessibility role description for fast forward button&quot;));
</span><span class="cx">     if (name == &quot;SeekBackButton&quot;)
</span><span class="cx">         return String(LPCTSTR_UI_STRING(&quot;fast reverse&quot;, &quot;accessibility role description for fast reverse button&quot;));
</span><ins>+    if (name == &quot;ShowClosedCaptionsButton&quot;)
+        return String(LPCTSTR_UI_STRING(&quot;show closed captions&quot;, &quot;accessibility role description for show closed captions button&quot;));
+    if (name == &quot;HideClosedCaptionsButton&quot;)
+        return String(LPCTSTR_UI_STRING(&quot;hide closed captions&quot;, &quot;accessibility role description for hide closed captions button&quot;));
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return String();
</span><span class="lines">@@ -190,6 +194,10 @@
</span><span class="cx">         return String(LPCTSTR_UI_STRING(&quot;seek quickly forward&quot;, &quot;accessibility help text for fast forward button&quot;));
</span><span class="cx">     if (name == &quot;FullscreenButton&quot;)
</span><span class="cx">         return String(LPCTSTR_UI_STRING(&quot;Play movie in fullscreen mode&quot;, &quot;accessibility help text for enter fullscreen button&quot;));
</span><ins>+    if (name == &quot;ShowClosedCaptionsButton&quot;)
+        return String(LPCTSTR_UI_STRING(&quot;start displaying closed captions&quot;, &quot;accessibility help text for show closed captions button&quot;));
+    if (name == &quot;HideClosedCaptionsButton&quot;)
+        return String(LPCTSTR_UI_STRING(&quot;stop displaying closed captions&quot;, &quot;accessibility help text for hide closed captions button&quot;));
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return String();
</span></span></pre></div>
<a id="trunkWebKitLibrariesChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitLibraries/ChangeLog (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitLibraries/ChangeLog        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebKitLibraries/ChangeLog        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2009-11-19  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        Reviewed by Dan Bernstein.
+
+        &lt;rdar://problem/7035231&gt;
+        Support closed caption in &lt;video&gt; element
+
+        * WebKitSystemInterface.h:
+            Add prototypes for WKQTMovieHasClosedCaptions and WKQTMovieSetShowClosedCaptions,
+            define WKMediaUIPartToggleClosedCaptionsButton.
+
</ins><span class="cx"> 2009-11-13  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Dan Bernstein.
</span></span></pre></div>
<a id="trunkWebKitLibrariesWebKitSystemInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/WebKitLibraries/WebKitSystemInterface.h (51190 => 51191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitLibraries/WebKitSystemInterface.h        2009-11-19 18:10:05 UTC (rev 51190)
+++ trunk/WebKitLibraries/WebKitSystemInterface.h        2009-11-19 18:14:01 UTC (rev 51191)
</span><span class="lines">@@ -188,6 +188,9 @@
</span><span class="cx"> 
</span><span class="cx"> int WKQTMovieGetType(QTMovie* movie);
</span><span class="cx"> 
</span><ins>+BOOL WKQTMovieHasClosedCaptions(QTMovie* movie);
+void WKQTMovieSetShowClosedCaptions(QTMovie* movie, BOOL showClosedCaptions);
+
</ins><span class="cx"> unsigned WKQTIncludeOnlyModernMediaFileTypes(void);
</span><span class="cx"> int WKQTMovieDataRate(QTMovie* movie);
</span><span class="cx"> float WKQTMovieMaxTimeLoaded(QTMovie* movie);
</span><span class="lines">@@ -207,6 +210,7 @@
</span><span class="cx">     WKMediaUIPartSliderThumb,
</span><span class="cx">     WKMediaUIPartRewindButton,
</span><span class="cx">     WKMediaUIPartSeekToRealtimeButton,
</span><ins>+    WKMediaUIPartToggleClosedCaptionsButton,
</ins><span class="cx">     WKMediaUIPartUnMuteButton,
</span><span class="cx">     WKMediaUIPartPauseButton,
</span><span class="cx">     WKMediaUIPartBackground,
</span></span></pre></div>
<a id="trunkWebKitLibrarieslibWebKitSystemInterfaceLeoparda"></a>
<div class="binary"><h4>Modified: trunk/WebKitLibraries/libWebKitSystemInterfaceLeopard.a</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkWebKitLibrarieslibWebKitSystemInterfaceSnowLeoparda"></a>
<div class="binary"><h4>Modified: trunk/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkWebKitLibrarieslibWebKitSystemInterfaceTigera"></a>
<div class="binary"><h4>Modified: trunk/WebKitLibraries/libWebKitSystemInterfaceTiger.a</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
</div>

</body>
</html>