<!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>[171158] 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/171158">171158</a></dd>
<dt>Author</dt> <dd>roger_fong@apple.com</dd>
<dt>Date</dt> <dd>2014-07-16 16:34:23 -0700 (Wed, 16 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Captions container should not clip content.
https://bugs.webkit.org/show_bug.cgi?id=134840.
&lt;rdar://problem/14553608&gt;.

Reviewed by Simon Fraser.

Tests: media/track/track-in-band-subtitles-too-large.html
       media/track/track-long-word-container-sizing.html

* Modules/mediacontrols/mediaControlsApple.css:
(video::-webkit-media-text-track-container):
Set word break property of WebCTT cues to normal to make it consistent with in-band cues.
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
Set -webkit-min-content on min-width/min-height property of the text track display.
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
Do the same for WebVTT cues.

* media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt: Rebaseline.
* media/track/captions-webvtt/long-word-small-track-display.vtt: Added.
* media/track/track-in-band-subtitles-too-large-expected.txt: Added.
* media/track/track-in-band-subtitles-too-large.html: Added.
* media/track/track-long-word-container-sizing-expected.txt: Added.
* media/track/track-long-word-container-sizing.html: Added.

We no longer break in the middle of a word, this test is no longer useful.
* media/track/captions-webvtt/long-word.vtt: Removed.
* media/track/track-word-breaking-expected.txt: Removed.
* media/track/track-word-breaking.html: Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmediatracktrackcuerenderingsnaptolinesnotsetexpectedtxt">trunk/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsmediaControlsApplecss">trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.css</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueGenericcpp">trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTCuecpp">trunk/Source/WebCore/html/track/VTTCue.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediatrackcaptionswebvttlongwordsmalltrackdisplayvtt">trunk/LayoutTests/media/track/captions-webvtt/long-word-small-track-display.vtt</a></li>
<li><a href="#trunkLayoutTestsmediatracktrackinbandsubtitlestoolargeexpectedtxt">trunk/LayoutTests/media/track/track-in-band-subtitles-too-large-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatracktrackinbandsubtitlestoolargehtml">trunk/LayoutTests/media/track/track-in-band-subtitles-too-large.html</a></li>
<li><a href="#trunkLayoutTestsmediatracktracklongwordcontainersizingexpectedtxt">trunk/LayoutTests/media/track/track-long-word-container-sizing-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatracktracklongwordcontainersizinghtml">trunk/LayoutTests/media/track/track-long-word-container-sizing.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmediatrackcaptionswebvttlongwordvtt">trunk/LayoutTests/media/track/captions-webvtt/long-word.vtt</a></li>
<li><a href="#trunkLayoutTestsmediatracktrackwordbreakingexpectedtxt">trunk/LayoutTests/media/track/track-word-breaking-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmediatracktrackwordbreakinghtml">trunk/LayoutTests/media/track/track-word-breaking.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (171157 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-07-16 23:11:49 UTC (rev 171157)
+++ trunk/LayoutTests/ChangeLog        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-07-16  Roger Fong  &lt;roger_fong@apple.com&gt;
+
+        Captions container should not clip content.
+        https://bugs.webkit.org/show_bug.cgi?id=134840.
+        &lt;rdar://problem/14553608&gt;.
+
+        Reviewed by Simon Fraser.
+
+        * media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt: Rebaseline.
+        * media/track/captions-webvtt/long-word-small-track-display.vtt: Added.
+        * media/track/track-in-band-subtitles-too-large-expected.txt: Added.
+        * media/track/track-in-band-subtitles-too-large.html: Added.
+        * media/track/track-long-word-container-sizing-expected.txt: Added.
+        * media/track/track-long-word-container-sizing.html: Added.
+        
+        We no longer break in the middle of a word, this test is no longer useful.
+        * media/track/captions-webvtt/long-word.vtt: Removed.
+        * media/track/track-word-breaking-expected.txt: Removed.
+        * media/track/track-word-breaking.html: Removed.
+
</ins><span class="cx"> 2014-07-16  Mike West  &lt;mkwst@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         CSP: Drop 'script-nonce' directive.
</span></span></pre></div>
<a id="trunkLayoutTestsmediatrackcaptionswebvttlongwordsmalltrackdisplayvtt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/track/captions-webvtt/long-word-small-track-display.vtt (0 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/captions-webvtt/long-word-small-track-display.vtt                                (rev 0)
+++ trunk/LayoutTests/media/track/captions-webvtt/long-word-small-track-display.vtt        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+WEBVTT
+
+1
+00:00:00.000 --&gt; 00:00:02.000 size:50% align:middle position:0%
+thiswordisquitelongindeed
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatrackcaptionswebvttlongwordvtt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/captions-webvtt/long-word.vtt (171157 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/captions-webvtt/long-word.vtt        2014-07-16 23:11:49 UTC (rev 171157)
+++ trunk/LayoutTests/media/track/captions-webvtt/long-word.vtt        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -1,9 +0,0 @@
</span><del>-WEBVTT
-
-1
-00:00:00.000 --&gt; 00:00:02.000
-first caption
-
-2
-00:00:02.000 --&gt; 00:01:00.000
-mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
</del></span></pre></div>
<a id="trunkLayoutTestsmediatracktrackcuerenderingsnaptolinesnotsetexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt (171157 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt        2014-07-16 23:11:49 UTC (rev 171157)
+++ trunk/LayoutTests/media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx"> * Cue 0 *
</span><span class="cx"> EXPECTED (cueDisplayElement.innerText == 'This is a demo track to illustrate positioning features of cues.') OK
</span><span class="cx"> Cue alignment (default or as specified): middle
</span><del>-Cue left position (percentage): 50
</del><ins>+Cue left position (percentage): 51
</ins><span class="cx"> Cue top position (percentage): 100
</span><span class="cx"> 
</span><span class="cx"> ** Center **
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx"> * Cue 0 *
</span><span class="cx"> EXPECTED (cueDisplayElement.innerText == 'Using HTML5 captions, you can position the cues anywhere.') OK
</span><span class="cx"> Cue alignment (default or as specified): middle
</span><del>-Cue left position (percentage): 50
</del><ins>+Cue left position (percentage): 51
</ins><span class="cx"> Cue top position (percentage): 50
</span><span class="cx"> 
</span><span class="cx"> ** Top left **
</span></span></pre></div>
<a id="trunkLayoutTestsmediatracktrackinbandsubtitlestoolargeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/track/track-in-band-subtitles-too-large-expected.txt (0 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/track-in-band-subtitles-too-large-expected.txt                                (rev 0)
+++ trunk/LayoutTests/media/track/track-in-band-subtitles-too-large-expected.txt        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x278
+  RenderBlock {HTML} at (0,0) size 800x278
+    RenderBody {BODY} at (8,16) size 784x254
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 430x18
+          text run at (0,0) width 430: &quot;Tests that in-band caption container expands when subtitles don't fit.&quot;
+      RenderBlock (anonymous) at (0,34) size 784x184
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,218) size 784x36
+        RenderText {#text} at (0,0) size 107x18
+          text run at (0,0) width 107: &quot;EVENT(seeked)&quot;
+        RenderBR {BR} at (107,0) size 0x18
+        RenderText {#text} at (0,18) size 102x18
+          text run at (0,18) width 102: &quot;END OF TEST&quot;
+        RenderBR {BR} at (102,18) size 0x18
+layer at (8,50) size 320x180
+  RenderVideo {VIDEO} at (0,0) size 320x180
+layer at (8,50) size 320x180
+  RenderFlexibleBox {DIV} at (0,0) size 320x180
+layer at (8,50) size 320x155
+  RenderBlock (relative positioned) {DIV} at (0,0) size 320x155 [color=#FFFFFF]
+layer at (123,140) size 89x62 scrollWidth 90
+  RenderBlock (positioned) {DIV} at (115,89) size 90x63
+    RenderBlock {DIV} at (0,0) size 89x62
+      RenderInline {SPAN} at (0,0) size 90x62 [color=#FFFF00CC] [bgcolor=#000000CC]
+        RenderText {#text} at (0,0) size 90x62
+          text run at (0,0) width 89: &quot;English&quot;
+          text run at (89,0) width 1: &quot; &quot;
+          text run at (37,31) width 15: &quot;5&quot;
+          text run at (52,31) width 8: &quot; &quot;
+layer at (8,205) size 320x25
+  RenderFlexibleBox {DIV} at (0,155) size 320x25
+layer at (14,210) size 16x16
+  RenderButton {BUTTON} at (6,4) size 16x17 [color=#FFFFFF]
+layer at (40,210) size 16x16
+  RenderButton {BUTTON} at (32,5) size 16x16 [color=#FFFFFF]
+layer at (57,213) size 187x11
+  RenderFlexibleBox {DIV} at (49,7) size 187x12
+layer at (57,213) size 45x11
+  RenderFlexibleBox {DIV} at (0,0) size 45x11 [color=#FFFFFF]
+    RenderBlock (anonymous) at (10,0) size 25x11
+      RenderText {#text} at (0,0) size 25x11
+        text run at (0,0) width 25: &quot;00:09&quot;
+layer at (199,213) size 45x11
+  RenderFlexibleBox {DIV} at (142,0) size 45x11 [color=#FFFFFF]
+    RenderBlock (anonymous) at (8,0) size 29x11
+      RenderText {#text} at (0,0) size 29x11
+        text run at (0,0) width 29: &quot;-00:20&quot;
+layer at (104,214) size 93x9
+  RenderFlexibleBox {DIV} at (47,1) size 93x9
+    RenderSlider {INPUT} at (0,0) size 93x9 [color=#909090] [bgcolor=#4A4A4A]
+      RenderFlexibleBox {DIV} at (0,0) size 93x9
+        RenderBlock {DIV} at (0,1) size 93x7
+layer at (132,215) size 6x6
+  RenderBlock {DIV} at (27,0) size 7x6 [bgcolor=#FFFFFF]
+layer at (244,207) size 22x22
+  RenderFlexibleBox {DIV} at (236,2) size 22x22
+layer at (244,207) size 2x22
+  RenderFlexibleBox {DIV} at (0,0) size 2x22 [border: (1px solid #000000F3)]
+    RenderSlider {INPUT} at (-7,6) size 2x10 [color=#909090] [border: (1px solid #000000DF)]
+      RenderFlexibleBox {DIV} at (1,1) size 0x8
+        RenderBlock {DIV} at (0,0) size 0x8
+layer at (230,214) size 8x8
+  RenderBlock {DIV} at (-8,0) size 8x8
+layer at (247,210) size 16x16
+  RenderButton {BUTTON} at (3,3) size 16x16 [color=#FFFFFF]
+layer at (275,210) size 16x16
+  RenderButton {BUTTON} at (267,5) size 16x16 [color=#FFFFFF]
+layer at (305,210) size 16x16
+  RenderButton {BUTTON} at (297,5) size 16x16 [color=#FFFFFF]
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatracktrackinbandsubtitlestoolargehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/track/track-in-band-subtitles-too-large.html (0 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/track-in-band-subtitles-too-large.html                                (rev 0)
+++ trunk/LayoutTests/media/track/track-in-band-subtitles-too-large.html        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;script src=../media-file.js&gt;&lt;/script&gt;
+        &lt;script src=../media-controls.js&gt;&lt;/script&gt;
+        &lt;script&gt;
+            var requirePixelDump = true;
+
+            function loaded()
+            {
+                if (window.testRunner)
+                {
+                    testRunner.waitUntilDone();
+                    findMediaElement();
+                    internals.setCaptionsStyleSheetOverride('video::cue { font-size:27px; } video::-webkit-media-text-track-display { width: 10%; }');
+                    internals.setCaptionDisplayMode('AlwaysOn');
+                    setTimeout(function() { 
+                        video.currentTime = 9.5;
+                    }, 1000);
+                    waitForEvent('seeked', endTest);
+                }
+            }
+        &lt;/script&gt;
+
+        &lt;script src=../video-test.js&gt;&lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body onload=&quot;loaded()&quot;&gt;
+        &lt;p&gt;Tests that in-band caption container expands when subtitles don't fit.&lt;/p&gt;
+        &lt;video width=&quot;320&quot; height=&quot;180&quot; src='../content/CC+Subtitles.mov' controls&gt;
+        &lt;/video&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatracktracklongwordcontainersizingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/track/track-long-word-container-sizing-expected.txt (0 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/track-long-word-container-sizing-expected.txt                                (rev 0)
+++ trunk/LayoutTests/media/track/track-long-word-container-sizing-expected.txt        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+CONSOLE MESSAGE: line 25: ReferenceError: Can't find variable: setCaptionDisplayMode
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock (anonymous) at (0,0) size 784x240
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,240) size 784x54
+        RenderText {#text} at (0,0) size 162x18
+          text run at (0,0) width 162: &quot;EVENT(canplaythrough)&quot;
+        RenderBR {BR} at (162,14) size 0x0
+        RenderText {#text} at (0,18) size 107x18
+          text run at (0,18) width 107: &quot;EVENT(seeked)&quot;
+        RenderBR {BR} at (107,32) size 0x0
+        RenderText {#text} at (0,36) size 102x18
+          text run at (0,36) width 102: &quot;END OF TEST&quot;
+        RenderBR {BR} at (102,50) size 0x0
+layer at (8,8) size 320x240
+  RenderVideo {VIDEO} at (0,0) size 320x240
+layer at (8,8) size 320x240
+  RenderFlexibleBox {DIV} at (0,0) size 320x240
+layer at (8,8) size 320x215
+  RenderBlock (relative positioned) {DIV} at (0,0) size 320x215 [color=#FFFFFF]
+layer at (8,209) size 144x14
+  RenderBlock (positioned) {DIV} at (0,201) size 144x14
+    RenderBlock {DIV} at (0,0) size 144x14
+      RenderInline {SPAN} at (0,0) size 144x14 [bgcolor=#000000CC]
+        RenderText {#text} at (0,0) size 144x14
+          text run at (0,0) width 144: &quot;thiswordisquitelongindeed&quot;
+layer at (8,223) size 320x25
+  RenderFlexibleBox {DIV} at (0,215) size 320x25
+layer at (14,228) size 16x16
+  RenderButton {BUTTON} at (6,4) size 16x17 [color=#FFFFFF]
+layer at (40,228) size 16x16
+  RenderButton {BUTTON} at (32,5) size 16x16 [color=#FFFFFF]
+layer at (57,231) size 187x11
+  RenderFlexibleBox {DIV} at (49,7) size 187x12
+layer at (57,231) size 45x11
+  RenderFlexibleBox {DIV} at (0,0) size 45x11 [color=#FFFFFF]
+    RenderBlock (anonymous) at (10,0) size 25x11
+      RenderText {#text} at (0,0) size 25x11
+        text run at (0,0) width 25: &quot;00:01&quot;
+layer at (199,231) size 45x11
+  RenderFlexibleBox {DIV} at (142,0) size 45x11 [color=#FFFFFF]
+    RenderBlock (anonymous) at (8,0) size 29x11
+      RenderText {#text} at (0,0) size 29x11
+        text run at (0,0) width 29: &quot;-00:05&quot;
+layer at (104,232) size 93x9
+  RenderFlexibleBox {DIV} at (47,1) size 93x9
+    RenderSlider {INPUT} at (0,0) size 93x9 [color=#909090] [bgcolor=#4A4A4A]
+      RenderFlexibleBox {DIV} at (0,0) size 93x9
+        RenderBlock {DIV} at (0,1) size 93x7
+layer at (118,233) size 6x6
+  RenderBlock {DIV} at (14,0) size 7x6 [bgcolor=#FFFFFF]
+layer at (244,225) size 22x22
+  RenderFlexibleBox {DIV} at (236,2) size 22x22
+layer at (244,225) size 2x22
+  RenderFlexibleBox {DIV} at (0,0) size 2x22 [border: (1px solid #000000F3)]
+    RenderSlider {INPUT} at (-7,6) size 2x10 [color=#909090] [border: (1px solid #000000DF)]
+      RenderFlexibleBox {DIV} at (1,1) size 0x8
+        RenderBlock {DIV} at (0,0) size 0x8
+layer at (230,232) size 8x8
+  RenderBlock {DIV} at (-8,0) size 8x8
+layer at (247,228) size 16x16
+  RenderButton {BUTTON} at (3,3) size 16x16 [color=#FFFFFF]
+layer at (275,228) size 16x16
+  RenderButton {BUTTON} at (267,5) size 16x16 [color=#FFFFFF]
+layer at (305,228) size 16x16
+  RenderButton {BUTTON} at (297,5) size 16x16 [color=#FFFFFF]
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatracktracklongwordcontainersizinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/media/track/track-long-word-container-sizing.html (0 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/track-long-word-container-sizing.html                                (rev 0)
+++ trunk/LayoutTests/media/track/track-long-word-container-sizing.html        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;html&gt;
+    &lt;head&gt;
+        &lt;script src=../media-file.js&gt;&lt;/script&gt;
+        &lt;script src=../media-controls.js&gt;&lt;/script&gt;
+        &lt;script&gt;
+        var requirePixelDump = true;
+
+        function seekToCaption()
+        {
+            video.currentTime = 1;
+        }
+
+        function loaded()
+        {
+            if (window.testRunner)
+            {
+                testRunner.waitUntilDone();
+                findMediaElement();
+                video.src = findMediaFile('video', '../content/test');
+                waitForEvent('canplaythrough', seekToCaption);
+                waitForEvent('seeked', endTest);
+            }
+        }
+
+        setCaptionDisplayMode('AlwaysOn');
+        &lt;/script&gt;
+
+        &lt;script src=../video-test.js&gt;&lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body onload=&quot;loaded()&quot;&gt;
+        &lt;video controls &gt;
+            &lt;track src=&quot;captions-webvtt/long-word-small-track-display.vtt&quot; kind=&quot;captions&quot; default&gt;
+        &lt;/video&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsmediatracktrackwordbreakingexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/track-word-breaking-expected.txt (171157 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/track-word-breaking-expected.txt        2014-07-16 23:11:49 UTC (rev 171157)
+++ trunk/LayoutTests/media/track/track-word-breaking-expected.txt        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -1,8 +0,0 @@
</span><del>-
-Test that line breaks are forced in captions.
-EVENT(canplaythrough)
-Single line caption height recorded.
-EVENT(seeked)
-Second caption was more than twice as tall as first caption. OK
-END OF TEST
-
</del></span></pre></div>
<a id="trunkLayoutTestsmediatracktrackwordbreakinghtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/media/track/track-word-breaking.html (171157 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/media/track/track-word-breaking.html        2014-07-16 23:11:49 UTC (rev 171157)
+++ trunk/LayoutTests/media/track/track-word-breaking.html        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-&lt;html&gt;
-    &lt;head&gt;
-        &lt;script src=../media-file.js&gt;&lt;/script&gt;
-        &lt;script src=../video-test.js&gt;&lt;/script&gt;
-        &lt;script src=../media-controls.js&gt;&lt;/script&gt;
-        &lt;script&gt;
-
-        var singleLineRect;
-
-        function testUnbreakableLine()
-        {
-            var multiLineRect = textTrackDisplayElement(video).firstChild.firstChild.getBoundingClientRect();
-            var ratio = multiLineRect.height / singleLineRect.height;
-            logResult(ratio &gt; 2, &quot;Second caption was more than twice as tall as first caption.&quot;)
-            endTest();
-        }
-
-        function testSingleLine()
-        {
-            singleLineRect = textTrackDisplayElement(video).firstChild.firstChild.getBoundingClientRect();
-            consoleWrite(&quot;Single line caption height recorded.&quot;);
-            video.currentTime = 3;
-        }
-
-        function loaded()
-        {
-            consoleWrite('Test that line breaks are forced in captions.');
-            findMediaElement();
-            waitForEvent('canplaythrough', testSingleLine);
-            waitForEvent('seeked', testUnbreakableLine);
-            video.src = findMediaFile('video', '../content/test');
-        }
-
-        setCaptionDisplayMode('Automatic');
-        &lt;/script&gt;
-    &lt;/head&gt;
-    &lt;body onload=&quot;loaded()&quot;&gt;
-        &lt;video controls &gt;
-            &lt;track src=&quot;captions-webvtt/long-word.vtt&quot; kind=&quot;captions&quot; default&gt;
-        &lt;/video&gt;
-    &lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (171157 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-07-16 23:11:49 UTC (rev 171157)
+++ trunk/Source/WebCore/ChangeLog        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-07-16  Roger Fong  &lt;roger_fong@apple.com&gt;
+
+        Captions container should not clip content.
+        https://bugs.webkit.org/show_bug.cgi?id=134840.
+        &lt;rdar://problem/14553608&gt;.
+
+        Reviewed by Simon Fraser.
+
+        Tests: media/track/track-in-band-subtitles-too-large.html
+               media/track/track-long-word-container-sizing.html
+
+        * Modules/mediacontrols/mediaControlsApple.css:
+        (video::-webkit-media-text-track-container):
+        Set word break property of WebCTT cues to normal to make it consistent with in-band cues.
+        * html/track/TextTrackCueGeneric.cpp:
+        (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
+        Set -webkit-min-content on min-width/min-height property of the text track display.
+        * html/track/VTTCue.cpp:
+        (WebCore::VTTCueBox::applyCSSProperties):
+        Do the same for WebVTT cues.
+
</ins><span class="cx"> 2014-07-16  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] replace AVPlayerItem on the main thread
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsmediaControlsApplecss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.css (171157 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.css        2014-07-16 23:11:49 UTC (rev 171157)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.css        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -709,7 +709,6 @@
</span><span class="cx">     text-decoration: none;
</span><span class="cx">     pointer-events: none;
</span><span class="cx">     -webkit-user-select: none;
</span><del>-    word-break: break-word;
</del><span class="cx"> 
</span><span class="cx">     -webkit-flex: 1 1;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueGenericcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp (171157 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp        2014-07-16 23:11:49 UTC (rev 171157)
+++ trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -81,6 +81,11 @@
</span><span class="cx">             setInlineStyleProperty(CSSPropertyHeight, size,  CSSPrimitiveValue::CSS_PERCENTAGE);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (cue-&gt;getWritingDirection() == VTTCue::Horizontal)
+        setInlineStyleProperty(CSSPropertyMinWidth, &quot;-webkit-min-content&quot;);
+    else
+        setInlineStyleProperty(CSSPropertyMinHeight, &quot;-webkit-min-content&quot;);
+
</ins><span class="cx">     if (cue-&gt;foregroundColor().isValid())
</span><span class="cx">         cueElement-&gt;setInlineStyleProperty(CSSPropertyColor, cue-&gt;foregroundColor().serialized());
</span><span class="cx">     if (cue-&gt;highlightColor().isValid())
</span><span class="lines">@@ -105,7 +110,6 @@
</span><span class="cx">         setInlineStyleProperty(CSSPropertyBackgroundColor, cue-&gt;backgroundColor().serialized());
</span><span class="cx">     setInlineStyleProperty(CSSPropertyWebkitWritingMode, cue-&gt;getCSSWritingMode(), false);
</span><span class="cx">     setInlineStyleProperty(CSSPropertyWhiteSpace, CSSValuePreWrap);
</span><del>-    setInlineStyleProperty(CSSPropertyWordBreak, CSSValueNormal);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TextTrackCueGeneric::TextTrackCueGeneric(ScriptExecutionContext&amp; context, double start, double end, const String&amp; content)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTCue.cpp (171157 => 171158)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTCue.cpp        2014-07-16 23:11:49 UTC (rev 171157)
+++ trunk/Source/WebCore/html/track/VTTCue.cpp        2014-07-16 23:34:23 UTC (rev 171158)
</span><span class="lines">@@ -174,9 +174,11 @@
</span><span class="cx">     if (m_cue.vertical() == horizontalKeyword()) {
</span><span class="cx">         setInlineStyleProperty(CSSPropertyWidth, static_cast&lt;double&gt;(m_cue.getCSSSize()), CSSPrimitiveValue::CSS_PERCENTAGE);
</span><span class="cx">         setInlineStyleProperty(CSSPropertyHeight, CSSValueAuto);
</span><ins>+        setInlineStyleProperty(CSSPropertyMinWidth, &quot;-webkit-min-content&quot;);
</ins><span class="cx">     } else {
</span><span class="cx">         setInlineStyleProperty(CSSPropertyWidth, CSSValueAuto);
</span><span class="cx">         setInlineStyleProperty(CSSPropertyHeight, static_cast&lt;double&gt;(m_cue.getCSSSize()),  CSSPrimitiveValue::CSS_PERCENTAGE);
</span><ins>+        setInlineStyleProperty(CSSPropertyMinHeight, &quot;-webkit-min-content&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // The 'text-align' property on the (root) List of WebVTT Node Objects must
</span></span></pre>
</div>
</div>

</body>
</html>